Package org.apache.aries.unittest.fixture.ArchiveFixture

Examples of org.apache.aries.unittest.fixture.ArchiveFixture.Fixture


                blueprint.append("</reference>");
            }
        }
        blueprint.append("</blueprint>");
       
        Fixture jar = ArchiveFixture.newJar()
            .manifest().symbolicName("sample"+no)
                .attribute("Import-Package", "org.osgi.framework")
            .end()
            .binary("org/apache/aries/blueprint/itests/comp/Listener.class",
                    getClass().getClassLoader().getResourceAsStream(
                            "org/apache/aries/blueprint/itests/comp/Listener.class"))
            .binary("org/apache/aries/blueprint/itests/comp/ListFactory.class",
                    getClass().getClassLoader().getResourceAsStream(
                            "org/apache/aries/blueprint/itests/comp/ListFactory.class"))
                           
            .file("OSGI-INF/blueprint/blueprint.xml", blueprint.toString())
            .end();
       
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        jar.writeOut(bout);
       
        return new ByteArrayInputStream(bout.toByteArray());
    }
View Full Code Here


      // no actual assertions, we just don't want to deadlock
    }
   
    @Test
    public void testScheduledExecMemoryLeak() throws Exception {
        Fixture jar = ArchiveFixture.newJar()
            .manifest().symbolicName("test.bundle").end()
            .file("OSGI-INF/blueprint/blueprint.xml")
                .line("<blueprint xmlns=\"http://www.osgi.org/xmlns/blueprint/v1.0.0\">")
                .line("<reference interface=\"java.util.List\" />")
                .line("</blueprint>").end().end();
       
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        jar.writeOut(bout);
       
        Bundle b = bundleContext.installBundle("test.bundle", new ByteArrayInputStream(bout.toByteArray()));
       
        for (int i=0; i<16; i++) System.gc();
        long startFreeMemory = Runtime.getRuntime().freeMemory();
View Full Code Here

TOP

Related Classes of org.apache.aries.unittest.fixture.ArchiveFixture.Fixture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.