本文整理匯總了Java中org.manifold.compiler.middle.Schematic.addConnectionType方法的典型用法代碼示例。如果您正苦於以下問題:Java Schematic.addConnectionType方法的具體用法?Java Schematic.addConnectionType怎麽用?Java Schematic.addConnectionType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.manifold.compiler.middle.Schematic
的用法示例。
在下文中一共展示了Schematic.addConnectionType方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testAddConnectionType_AlreadyDefined_ThrowsException
import org.manifold.compiler.middle.Schematic; //導入方法依賴的package包/類
@Test(expected = MultipleDefinitionException.class)
public void testAddConnectionType_AlreadyDefined_ThrowsException()
throws SchematicException {
Schematic sch = new Schematic("test");
// add the first constraint type
String connectionTypeName = "TestConnection";
try {
ConnectionTypeValue cv1 = ConnectionTypeValue.getInstance();
sch.addConnectionType(connectionTypeName, cv1);
} catch (MultipleDefinitionException e) {
fail("exception thrown too early");
}
// try to add another constraint type with the same name
ConnectionTypeValue cv2 = ConnectionTypeValue.getInstance();
sch.addConnectionType(connectionTypeName, cv2);
}
示例2: testGetConnectionType
import org.manifold.compiler.middle.Schematic; //導入方法依賴的package包/類
@Test
public void testGetConnectionType() throws SchematicException {
Schematic sch = new Schematic("test");
// add the first constraint type
String connectionTypeName = "TestConstraint";
ConnectionTypeValue cv1 = ConnectionTypeValue.getInstance();
sch.addConnectionType(connectionTypeName, cv1);
ConnectionTypeValue actual = sch.getConnectionType(connectionTypeName);
assertEquals(cv1, actual);
}