use of org.apache.aries.blueprint.plugin.test.MyBean1 in project aries by apache.
the class BlueprintFileWriterTest method testGenerateBeanWithInitDestroyAndfieldInjection.
@Test
public void testGenerateBeanWithInitDestroyAndfieldInjection() throws Exception {
Node bean1 = getBeanById("myBean1");
assertXpathEquals(bean1, "@class", MyBean1.class.getName());
assertXpathEquals(bean1, "@init-method", "init");
assertXpathEquals(bean1, "@destroy-method", "destroy");
assertXpathEquals(bean1, "@field-injection", "true");
assertXpathDoesNotExist(bean1, "@scope");
}
use of org.apache.aries.blueprint.plugin.test.MyBean1 in project aries by apache.
the class BlueprintFileWriterTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
ClassFinder classFinder = new ClassFinder(BlueprintFileWriterTest.class.getClassLoader());
long start = System.currentTimeMillis();
Set<Class<?>> beanClasses = findClasses(classFinder, Arrays.asList(MyBean1.class.getPackage().getName(), ReferenceListenerToProduceWithoutAnnotation.class.getPackage().getName()));
Set<String> namespaces = new HashSet<>(Arrays.asList(NS_JPA, NS_TX1));
Map<String, String> customParameters = new HashMap<>();
customParameters.put("ex.t", "1");
customParameters.put("example.p1", "v1");
customParameters.put("example.p2", "v2");
BlueprintConfigurationImpl blueprintConfiguration = new BlueprintConfigurationImpl(namespaces, null, customParameters);
Blueprint blueprint = new Blueprint(blueprintConfiguration, beanClasses);
ByteArrayOutputStream os = new ByteArrayOutputStream();
new BlueprintFileWriter(os).write(blueprint);
xmlAsBytes = os.toByteArray();
System.out.println("Generation took " + (System.currentTimeMillis() - start) + " millis");
System.out.println(new String(xmlAsBytes, "UTF-8"));
document = readToDocument(xmlAsBytes, false);
xpath = XPathFactory.newInstance().newXPath();
}
Aggregations