Search in sources :

Example 41 with ModelledResource

use of org.apache.aries.application.modelling.ModelledResource in project aries by apache.

the class AbstractEJBModellerTest method testAnnotatedOnlyInWebZip.

@Test
public void testAnnotatedOnlyInWebZip() 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, "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()));
}
Also used : ZipOutputStream(java.util.zip.ZipOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ModelledResource(org.apache.aries.application.modelling.ModelledResource) Test(org.junit.Test) AbstractIntegrationTest(org.apache.aries.itest.AbstractIntegrationTest)

Aggregations

ModelledResource (org.apache.aries.application.modelling.ModelledResource)41 Test (org.junit.Test)21 ArrayList (java.util.ArrayList)16 ByteArrayOutputStream (java.io.ByteArrayOutputStream)11 ZipOutputStream (java.util.zip.ZipOutputStream)11 ResolverException (org.apache.aries.application.management.ResolverException)11 AbstractIntegrationTest (org.apache.aries.itest.AbstractIntegrationTest)11 DeployedBundles (org.apache.aries.application.modelling.DeployedBundles)10 File (java.io.File)8 Content (org.apache.aries.application.Content)8 ApplicationMetadata (org.apache.aries.application.ApplicationMetadata)7 FileOutputStream (java.io.FileOutputStream)6 HashSet (java.util.HashSet)6 MethodCall (org.apache.aries.unittest.mocks.MethodCall)6 Manifest (java.util.jar.Manifest)5 AriesApplication (org.apache.aries.application.management.AriesApplication)5 ExportedPackage (org.apache.aries.application.modelling.ExportedPackage)5 HashMap (java.util.HashMap)4 Attributes (java.util.jar.Attributes)4 InvalidAttributeException (org.apache.aries.application.InvalidAttributeException)4