本文整理汇总了Java中org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.ConcreteModuleGeneratedObjectFactory类的典型用法代码示例。如果您正苦于以下问题:Java ConcreteModuleGeneratedObjectFactory类的具体用法?Java ConcreteModuleGeneratedObjectFactory怎么用?Java ConcreteModuleGeneratedObjectFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConcreteModuleGeneratedObjectFactory类属于org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory包,在下文中一共展示了ConcreteModuleGeneratedObjectFactory类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test
import org.opendaylight.controller.config.yangjmxgenerator.plugin.gofactory.ConcreteModuleGeneratedObjectFactory; //导入依赖的package包/类
@Test
public void test() throws Exception {
FullyQualifiedName fqn = new FullyQualifiedName("foo.bar", "Baz");
FullyQualifiedName abstractFQN = new FullyQualifiedName("foo.bar", "AbstractBaz");
String nullableDescription = null;
ModuleMXBeanEntry moduleMXBeanEntry = mockModuleMXBeanEntry(fqn, abstractFQN, nullableDescription);
Optional<String> copyright = Optional.absent();
Optional<String> header = Optional.absent();
GeneratedObject go = new ConcreteModuleGeneratedObjectFactory().toGeneratedObject(moduleMXBeanEntry, copyright, header);
Entry<FullyQualifiedName, File> entry = go.persist(generatorOutputPath).get();
File dstFile = entry.getValue();
Node c = parse(dstFile);
assertEquals(fqn.getPackageName(), ((ASTCompilationUnit) c).getPackageDeclaration().getPackageNameImage());
assertEquals(fqn.getTypeName(), c.getFirstDescendantOfType(ASTClassOrInterfaceDeclaration.class).getImage());
assertHasMethodNamed(c, "customValidation");
assertHasMethodNamed(c, "createInstance");
}