use of org.apache.felix.ipojo.manipulator.metadata.annotation.ComponentWorkbench in project felix by apache.
the class ComponentVisitorTestCase method testPublicFactoryDeprecationSupport.
public void testPublicFactoryDeprecationSupport() throws Exception {
Reporter reporter = mock(Reporter.class);
ComponentWorkbench workbench = new ComponentWorkbench(null, clazz());
ComponentVisitor visitor = new ComponentVisitor(workbench, reporter);
visitor.visit("public_factory", "false");
visitor.visitEnd();
Element root = workbench.getRoot();
assertNotNull(root);
assertEquals("false", root.getAttribute("public"));
}
use of org.apache.felix.ipojo.manipulator.metadata.annotation.ComponentWorkbench in project felix by apache.
the class HandlerDeclarationVisitorTestCase method setUp.
@Override
public void setUp() throws Exception {
reporter = mock(Reporter.class);
workbench = new ComponentWorkbench(null, node());
workbench.setRoot(new Element("container", null));
visitor = new HandlerDeclarationVisitor(workbench, builder(), reporter);
}
use of org.apache.felix.ipojo.manipulator.metadata.annotation.ComponentWorkbench in project felix by apache.
the class MethodBindVisitorTestCase method testNoIdentifierAndNoSpecificationProvided.
public void testNoIdentifierAndNoSpecificationProvided() throws Exception {
Reporter reporter = mock(Reporter.class);
ComponentWorkbench workbench = new ComponentWorkbench(null, type());
MethodNode node = new MethodNode();
node.name = "notify";
node.desc = "()V";
MethodBindVisitor visitor = new MethodBindVisitor(workbench, Action.BIND, node, reporter);
visitor.visitEnd();
verify(reporter).error(anyString(), anyVararg());
}
use of org.apache.felix.ipojo.manipulator.metadata.annotation.ComponentWorkbench in project felix by apache.
the class MethodBindVisitorTestCase method testNoIdentifierButSpecificationAsAttributeProvided.
public void testNoIdentifierButSpecificationAsAttributeProvided() throws Exception {
Reporter reporter = mock(Reporter.class);
ComponentWorkbench workbench = new ComponentWorkbench(null, type());
MethodNode node = new MethodNode();
node.name = "notify";
node.desc = "()V";
MethodBindVisitor visitor = new MethodBindVisitor(workbench, Action.BIND, node, reporter);
visitor.visit("specification", "my.Service");
visitor.visitEnd();
assertNotNull(workbench.getIds().get("my.Service"));
}
Aggregations