use of org.apache.aries.application.modelling.ModelledResource in project aries by apache.
the class AbstractEJBModellerTest method testEJBJARAndAnnotatedInWebZip.
@Test
public void testEJBJARAndAnnotatedInWebZip() throws Exception {
ModelledResource mr = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(baos);
addToZip(zos, "MANIFEST_3.MF", "META-INF/MANIFEST.MF");
addToZip(zos, "ejb-jar.xml", "WEB-INF/ejb-jar.xml");
addToZip(zos, "beans/StatelessSessionBean.class");
addToZip(zos, "beans/StatefulSessionBean.class");
zos.close();
mr = model(baos.toByteArray());
Collection<? extends ExportedService> services = mr.getExportedServices();
assertEquals("Wrong number of services", 3, services.size());
assertTrue(services.containsAll(getXMLservices()));
assertTrue(services.containsAll(getAnnotatedservices()));
}
use of org.apache.aries.application.modelling.ModelledResource in project aries by apache.
the class AbstractEJBModellerTest method testEJBJARAndAnnotatedInZip.
@Test
public void testEJBJARAndAnnotatedInZip() throws Exception {
ModelledResource mr = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(baos);
addToZip(zos, "MANIFEST_1.MF", "META-INF/MANIFEST.MF");
addToZip(zos, "ejb-jar.xml", "META-INF/ejb-jar.xml");
addToZip(zos, "beans/StatelessSessionBean.class");
addToZip(zos, "beans/StatefulSessionBean.class");
zos.close();
mr = model(baos.toByteArray());
Collection<? extends ExportedService> services = mr.getExportedServices();
assertEquals("Wrong number of services", 3, services.size());
assertTrue(services.containsAll(getXMLservices()));
assertTrue(services.containsAll(getAnnotatedservices()));
}
use of org.apache.aries.application.modelling.ModelledResource in project aries by apache.
the class AbstractEJBModellerTest method testEJBJARInWebZip.
@Test
public void testEJBJARInWebZip() throws Exception {
ModelledResource mr = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(baos);
addToZip(zos, "MANIFEST_3.MF", "META-INF/MANIFEST.MF");
addToZip(zos, "ejb-jar.xml", "WEB-INF/ejb-jar.xml");
zos.close();
mr = model(baos.toByteArray());
Collection<? extends ExportedService> services = mr.getExportedServices();
assertEquals("Wrong number of services", 2, services.size());
assertTrue(services.containsAll(getXMLservices()));
assertTrue(Collections.disjoint(services, getAnnotatedservices()));
}
use of org.apache.aries.application.modelling.ModelledResource in project aries by apache.
the class AbstractEJBModellerTest method testAnnotatedOnlyInZip.
@Test
public void testAnnotatedOnlyInZip() throws Exception {
ModelledResource mr = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(baos);
addToZip(zos, "MANIFEST_1.MF", "META-INF/MANIFEST.MF");
addToZip(zos, "beans/StatelessSessionBean.class");
addToZip(zos, "beans/StatefulSessionBean.class");
zos.close();
mr = model(baos.toByteArray());
Collection<? extends ExportedService> services = mr.getExportedServices();
assertEquals("Wrong number of services", 1, services.size());
assertTrue(Collections.disjoint(services, getXMLservices()));
assertTrue(services.containsAll(getAnnotatedservices()));
}
use of org.apache.aries.application.modelling.ModelledResource in project aries by apache.
the class AbstractEJBModellerTest method testEJBJARInWrongPlaceWebZip.
@Test
public void testEJBJARInWrongPlaceWebZip() throws Exception {
ModelledResource mr = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(baos);
addToZip(zos, "MANIFEST_3.MF", "META-INF/MANIFEST.MF");
addToZip(zos, "ejb-jar.xml", "META-INF/ejb-jar.xml");
zos.close();
mr = model(baos.toByteArray());
Collection<? extends ExportedService> services = mr.getExportedServices();
assertEquals("Wrong number of services", 0, services.size());
}
Aggregations