當前位置: 首頁>>代碼示例>>Java>>正文


Java ReadVariableAction類代碼示例

本文整理匯總了Java中org.eclipse.uml2.uml.ReadVariableAction的典型用法代碼示例。如果您正苦於以下問題:Java ReadVariableAction類的具體用法?Java ReadVariableAction怎麽用?Java ReadVariableAction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ReadVariableAction類屬於org.eclipse.uml2.uml包,在下文中一共展示了ReadVariableAction類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testLink

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testLink() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.link_and_unlink");
	Class clsA = cls(model, "A");
	Property otherEnd = property(clsA, "OtherEnd", "B");
	Class clsB = cls(model, "B");
	Property thisEnd = property(clsB, "ThisEnd", "A");

	SequenceNode body = loadActionCode(model, "A", "testLink");
	SequenceNode linkStmt = node(body, 0, "link inst1 to inst2;", SequenceNode.class);
	node(linkStmt, 0, "inst1", ReadVariableAction.class);
	node(linkStmt, 1, "inst2", ReadVariableAction.class);
	CreateLinkAction linkNode = node(linkStmt, 2, "link inst1 to inst2", CreateLinkAction.class);
	assertEquals(thisEnd, linkNode.getEndData().get(0).getEnd());
	assertNotNull(linkNode.getEndData().get(0).getValue());
	assertEquals(otherEnd, linkNode.getEndData().get(1).getEnd());
	assertNotNull(linkNode.getEndData().get(1).getValue());
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:19,代碼來源:TestActionCode.java

示例2: testUnlink

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testUnlink() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.link_and_unlink");
	Class clsA = cls(model, "A");
	Property otherEnd = property(clsA, "OtherEnd", "B");
	Class clsB = cls(model, "B");
	Property thisEnd = property(clsB, "ThisEnd", "A");

	SequenceNode body = loadActionCode(model, "A", "testUnlink");
	SequenceNode linkStmt = node(body, 0, "unlink inst1 from inst2;", SequenceNode.class);
	node(linkStmt, 0, "inst1", ReadVariableAction.class);
	node(linkStmt, 1, "inst2", ReadVariableAction.class);
	DestroyLinkAction linkNode = node(linkStmt, 2, "unlink inst1 from inst2", DestroyLinkAction.class);
	assertEquals(thisEnd, linkNode.getEndData().get(0).getEnd());
	assertNotNull(linkNode.getEndData().get(0).getValue());
	assertEquals(otherEnd, linkNode.getEndData().get(1).getEnd());
	assertNotNull(linkNode.getEndData().get(1).getValue());
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:19,代碼來源:TestActionCode.java

示例3: testSend

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testSend() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.send");
	Class clsA = cls(model, "A");
	Property otherEnd = property(clsA, "B_end", "B");
	Class clsB = cls(model, "B");
	Property thisEnd = property(clsB, "A_end", "A");

	SequenceNode body = loadActionCode(model, "A", "test");
	SequenceNode sendStmt = node(body, 0, "send create Sig to select(a -> B_end);", SequenceNode.class);
	node(sendStmt, 0, "create Sig", SequenceNode.class);
	node(sendStmt, 1, "a", ReadVariableAction.class);
	ReadLinkAction readLink = node(sendStmt, 2, "a -> B_end", ReadLinkAction.class);
	node(sendStmt, 3, "select(a -> B_end)", CallOperationAction.class);
	node(sendStmt, 4, "send create Sig to select(a -> B_end)", SendObjectAction.class);
	assertEquals(thisEnd, readLink.getEndData().get(0).getEnd());
	assertNotNull(readLink.getEndData().get(0).getValue());
	assertEquals(otherEnd, readLink.getEndData().get(1).getEnd());
	assertEquals(null, readLink.getEndData().get(1).getValue());
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:21,代碼來源:TestStructure.java

示例4: testSignal

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testSignal() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.signal");
	Signal sig = signal(model, "Sig");
	SignalEvent sigEvent = signalEvent(model, "Sig");
	assertEquals(sig, sigEvent.getSignal());
	Class sigFactory = cls(model, "#Sig_factory");
	Operation sigCtor = operation(sigFactory, "Sig");
	assertEquals(4, sigCtor.getOwnedParameters().size());

	SequenceNode body = loadActionCode(model, "A", "test");
	SequenceNode createNode = node(body, 0, "create Sig", SequenceNode.class);
	CreateObjectAction initiateNode = node(createNode, 0, "instantiate Sig", CreateObjectAction.class);
	assertEquals(sig, initiateNode.getClassifier());
	node(createNode, 1, "#temp=instantiate Sig", AddVariableValueAction.class);
	node(createNode, 2, "1", ValueSpecificationAction.class);
	node(createNode, 3, "true", ValueSpecificationAction.class);
	node(createNode, 4, "\"test\"", ValueSpecificationAction.class);
	node(createNode, 5, "#temp", ReadVariableAction.class);
	CallOperationAction ctorCall = node(createNode, 6, "Sig(Sig p0, Integer p1, Boolean p2, String p3)",
			CallOperationAction.class);
	assertEquals(sigCtor, ctorCall.getOperation());
	node(createNode, 7, "#temp", ReadVariableAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:25,代碼來源:TestStructure.java

示例5: caseAVariableAccess

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Override
public void caseAVariableAccess(AVariableAccess node) {
    ReadVariableAction action = (ReadVariableAction) builder.createAction(IRepository.PACKAGE
            .getReadVariableAction());
    try {
        super.caseAVariableAccess(node);
        final OutputPin result = action.createResult(null, null);
        builder.registerOutput(result);
        String variableName = TextUMLCore.getSourceMiner().getIdentifier(node.getIdentifier());
        Variable variable = builder.getVariable(variableName);
        ensure(variable != null, node.getIdentifier(), Severity.ERROR, () -> "Unknown local variable '" + variableName + "'");
        action.setVariable(variable);
        TypeUtils.copyType(variable, result, getBoundElement());
        fillDebugInfo(action, node);
    } finally {
        builder.closeAction();
    }
    checkIncomings(action, node.getIdentifier(), getBoundElement());
}
 
開發者ID:abstratt,項目名稱:textuml,代碼行數:20,代碼來源:BehaviorGenerator.java

示例6: testPostfixOperation

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testPostfixOperation() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.compound_ops");
	SequenceNode body = loadActionCode(model, "TestClass", "test");
	SequenceNode postStmtNode = (SequenceNode) body.getNode("this.fld=this.fld++;");
	SequenceNode postExprNode = (SequenceNode) postStmtNode.getNode("this.fld=this.fld++");
	node(postExprNode, 0, "this", ReadSelfAction.class);
	node(postExprNode, 1, "this.fld", ReadStructuralFeatureAction.class);
	node(postExprNode, 2, "#temp=this.fld", AddVariableValueAction.class);
	node(postExprNode, 3, "this.fld", ReadStructuralFeatureAction.class);
	node(postExprNode, 4, "1", ValueSpecificationAction.class);
	node(postExprNode, 5, "this.fld++", CallOperationAction.class);
	node(postExprNode, 6, "this.fld=this.fld++", AddStructuralFeatureValueAction.class);
	node(postExprNode, 7, "#temp", ReadVariableAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:16,代碼來源:TestActionCode.java

示例7: testCreateActionBehavior

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testCreateActionBehavior() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.create_and_destroy");
	SequenceNode body = loadActionCode(model, "TestClass", "testCreate");
	SequenceNode createNode = (SequenceNode) body.getNode("create TestClass");
	node(createNode, 0, "instantiate TestClass", CreateObjectAction.class);
	node(createNode, 1, "#temp=instantiate TestClass", AddVariableValueAction.class);
	node(createNode, 2, "#temp", ReadVariableAction.class);
	node(createNode, 3, "1", ValueSpecificationAction.class);
	node(createNode, 4, "2", ValueSpecificationAction.class);
	node(createNode, 5, "#temp.TestClass(Integer p0, Integer p1)", CallOperationAction.class);
	node(createNode, 6, "#temp", ReadVariableAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:14,代碼來源:TestActionCode.java

示例8: testDestroyActionBehavior

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testDestroyActionBehavior() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.create_and_destroy");
	SequenceNode body = loadActionCode(model, "TestClass", "testDestroy");
	SequenceNode createNode = (SequenceNode) body.getNode("delete cls;");
	node(createNode, 0, "cls", ReadVariableAction.class);
	node(createNode, 1, "delete cls", DestroyObjectAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:9,代碼來源:TestActionCode.java

示例9: testStart

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testStart() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.start");

	SequenceNode body = loadActionCode(model, "TestClass", "test");
	SequenceNode logStmt = node(body, 0, "start inst;", SequenceNode.class);
	node(logStmt, 0, "inst", ReadVariableAction.class);
	node(logStmt, 1, "start inst", StartObjectBehaviorAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:10,代碼來源:TestActionCode.java

示例10: testToString

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testToString() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.toString");

	SequenceNode body = loadActionCode(model, "TestClass", "testToString");
	SequenceNode toStringStmt = node(body, 0, "sut.toString;", SequenceNode.class);
	node(toStringStmt, 0, "sut", ReadVariableAction.class);
	node(toStringStmt, 1, "sut.toString", CallOperationAction.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:10,代碼來源:TestActionCode.java

示例11: testForEachLoop

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testForEachLoop() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.foreach_control");
	SequenceNode body = loadActionCode(model, "TestClass", "test");
	ExpansionRegion exp = node(body, 0, "foreach (coll)", ExpansionRegion.class);
	inputElement(exp, 0, "coll_expansion");
	node(exp, 0, "coll", ReadVariableAction.class);
	SequenceNode inner = node(exp, 1, null, SequenceNode.class);
	node(inner, 0, "this.sum=this.sum+i;", SequenceNode.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:11,代碼來源:TestControlStructures.java

示例12: testIf

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testIf() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.if_control");
	SequenceNode body = loadActionCode(model, "TestClass", "testIf");
	SequenceNode ifNode = node(body, 0, "if (test)", SequenceNode.class);
	node(ifNode, 0, "test", ReadVariableAction.class);
	node(ifNode, 1, "#if_cond=test", AddVariableValueAction.class);
	ConditionalNode condNode = node(ifNode, 2, null, ConditionalNode.class);
	clauseTest(condNode, 0, "#if_cond", ReadVariableAction.class);
	SequenceNode clauseBody = clauseBody(condNode, 0, null, SequenceNode.class);
	node(clauseBody, 0, "Action.log(\"then\");", SequenceNode.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:13,代碼來源:TestControlStructures.java

示例13: testIfElse

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testIfElse() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.if_control");
	SequenceNode body = loadActionCode(model, "TestClass", "testIfElse");
	SequenceNode ifNode = node(body, 0, "if (test)", SequenceNode.class);
	node(ifNode, 0, "test", ReadVariableAction.class);
	node(ifNode, 1, "#if_cond=test", AddVariableValueAction.class);
	ConditionalNode condNode = node(ifNode, 2, null, ConditionalNode.class);
	clauseTest(condNode, 0, "#if_cond", ReadVariableAction.class);
	SequenceNode clauseBody = clauseBody(condNode, 0, null, SequenceNode.class);
	node(clauseBody, 0, "Action.log(\"then\");", SequenceNode.class);
	clauseTest(condNode, 1, "!#if_cond", CallOperationAction.class);
	SequenceNode elseBody = clauseBody(condNode, 1, null, SequenceNode.class);
	node(elseBody, 0, "Action.log(\"else\");", SequenceNode.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:16,代碼來源:TestControlStructures.java

示例14: testInlineIf

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testInlineIf() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.if_control");
	SequenceNode body = loadActionCode(model, "TestClass", "testInlineIf");
	SequenceNode ifNode = node(body, 0, "if (test)", SequenceNode.class);
	node(ifNode, 0, "test", ReadVariableAction.class);
	node(ifNode, 1, "#if_cond=test", AddVariableValueAction.class);
	ConditionalNode condNode = node(ifNode, 2, null, ConditionalNode.class);
	clauseTest(condNode, 0, "#if_cond", ReadVariableAction.class);
	clauseBody(condNode, 0, "Action.log(\"then\");", SequenceNode.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:12,代碼來源:TestControlStructures.java

示例15: testInlineIfElse

import org.eclipse.uml2.uml.ReadVariableAction; //導入依賴的package包/類
@Test
public void testInlineIfElse() throws Exception {
	Model model = model("hu.elte.txtuml.export.uml2.tests.models.if_control");
	SequenceNode body = loadActionCode(model, "TestClass", "testInlineIfElse");
	SequenceNode ifNode = node(body, 0, "if (test)", SequenceNode.class);
	node(ifNode, 0, "test", ReadVariableAction.class);
	node(ifNode, 1, "#if_cond=test", AddVariableValueAction.class);
	ConditionalNode condNode = node(ifNode, 2, null, ConditionalNode.class);
	clauseTest(condNode, 0, "#if_cond", ReadVariableAction.class);
	clauseBody(condNode, 0, "Action.log(\"then\");", SequenceNode.class);
	clauseTest(condNode, 1, "!#if_cond", CallOperationAction.class);
	clauseBody(condNode, 1, "Action.log(\"else\");", SequenceNode.class);
}
 
開發者ID:ELTE-Soft,項目名稱:txtUML,代碼行數:14,代碼來源:TestControlStructures.java


注:本文中的org.eclipse.uml2.uml.ReadVariableAction類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。