Package org.jboss.shrinkwrap.api.spec

Examples of org.jboss.shrinkwrap.api.spec.JavaArchive.addAsResource()


        final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
        jar.addPackage(CallerRoleCheckerBean.class.getPackage());
        jar.addClasses(Util.class, SecurityRoleLinkTestCaseSetup.class);
        jar.addClasses(AbstractSecurityDomainSetup.class, EjbSecurityDomainSetup.class);
        jar.addAsResource("ejb/security/rolelink/users.properties", "users.properties");
        jar.addAsResource("ejb/security/rolelink/roles.properties", "roles.properties");
        jar.addAsManifestResource("ejb/security/rolelink/ejb-jar.xml", "ejb-jar.xml");
        jar.addAsManifestResource("ejb/security/rolelink/jboss-ejb3.xml", "jboss-ejb3.xml");

        return jar;
    }
View Full Code Here


        String serviceActivatorPath = "META-INF/services/" + ServiceActivator.class.getName();
        final URL serviceActivatorURL = this.getClass().getClassLoader().getResource("arquillian-service/" + serviceActivatorPath);
        if (serviceActivatorURL == null) {
            throw new RuntimeException("No arquillian-service/" + serviceActivatorPath + " found by classloader: " + this.getClass().getClassLoader());
        }
        archive.addAsResource(new UrlAsset(serviceActivatorURL), serviceActivatorPath);

        // Add META-INF/jbosgi-xservice.properties which registers the arquillian service with the OSGi layer
        // Generated default imports for OSGi tests are defined in {@link AbstractOSGiApplicationArchiveProcessor}
        StringBuffer props = new StringBuffer(Constants.BUNDLE_SYMBOLICNAME + ": " + archive.getName() + "\n");
        props.append(Constants.EXPORT_PACKAGE + ": ");
View Full Code Here

        props.append("org.junit,org.junit.runner,javax.inject,org.osgi.framework");
        archive.add(new StringAsset(props.toString()), XSERVICE_PROPERTIES_NAME);

        // Replace the loadable extensions with the collected set
        archive.delete(ArchivePaths.create(loadableExtentionsPath));
        archive.addAsResource(new Asset() {
            @Override
            public InputStream openStream() {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                PrintWriter pw = new PrintWriter(new OutputStreamWriter(baos));
                for (String line : loadableExtensions) {
View Full Code Here

        testClassesJar.addAsResource("test/metadata/resource-type/duplicateResourceType.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/update2-v1_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/update2-v2_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/update4-v1_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/update4-v2_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/updateResourceTypeBundleTarget-v1.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/updateResourceTypeBundleTarget-v2.xml");

        testClassesJar.addAsResource("org/rhq/enterprise/server/plugins/ant/recipe-no-manageRootDir.xml");

        // create test ear by starting with rhq.ear and thinning it
View Full Code Here

        testClassesJar.addAsResource("test/metadata/resource-type/update2-v1_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/update2-v2_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/update4-v1_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/update4-v2_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/updateResourceTypeBundleTarget-v1.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/updateResourceTypeBundleTarget-v2.xml");

        testClassesJar.addAsResource("org/rhq/enterprise/server/plugins/ant/recipe-no-manageRootDir.xml");

        // create test ear by starting with rhq.ear and thinning it
        String projectVersion = System.getProperty("rhq.version");
View Full Code Here

        testClassesJar.addAsResource("test/metadata/resource-type/update4-v1_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/update4-v2_0.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/updateResourceTypeBundleTarget-v1.xml");
        testClassesJar.addAsResource("test/metadata/resource-type/updateResourceTypeBundleTarget-v2.xml");

        testClassesJar.addAsResource("org/rhq/enterprise/server/plugins/ant/recipe-no-manageRootDir.xml");

        // create test ear by starting with rhq.ear and thinning it
        String projectVersion = System.getProperty("rhq.version");
        String rhqCoreClientApiVersion = System.getProperty("rhq-core-client-api.version");
        if ((rhqCoreClientApiVersion == null) || rhqCoreClientApiVersion.trim().isEmpty()) {
View Full Code Here

        serverPluginsBean = LookupUtil.getServerPluginManager();
        pluginService.masterConfig.getPluginDirectory().mkdirs();

        JavaArchive archive = ShrinkWrap.create(JavaArchive.class);
        URL res = this.getClass().getClassLoader().getResource("serverplugins/simple-generic-serverplugin.xml");
        archive.addAsResource(res, "META-INF/rhq-serverplugin.xml");

        File pluginFile = new File(pluginService.masterConfig.getPluginDirectory(), TEST_PLUGIN_JAR_NAME);

        archive.as(ZipExporter.class).exportTo(pluginFile, true);
View Full Code Here

        testClassesJar.addClass(BuilderException.class);
        testClassesJar.addClasses(PropertyMatcher.class, MatchResult.class, PropertyMatchException.class);
        testClassesJar.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); // add CDI injection (needed by arquillian injection);
        //TOD0 (jshaughn): Once we have identified all of the necessary test resource files, see if we can just add the
        //      entire /resources dir in one statement
        testClassesJar.addAsResource("binary-blob-sample.jar");
        testClassesJar.addAsResource("test-alert-sender-serverplugin.xml");
        testClassesJar.addAsResource("test-assist-color-number.txt");
        testClassesJar.addAsResource("test-ldap.properties");
        testClassesJar.addAsResource("test-scheduler.properties");
        testClassesJar.addAsResource("cassandra-test.properties");
View Full Code Here

        testClassesJar.addClasses(PropertyMatcher.class, MatchResult.class, PropertyMatchException.class);
        testClassesJar.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); // add CDI injection (needed by arquillian injection);
        //TOD0 (jshaughn): Once we have identified all of the necessary test resource files, see if we can just add the
        //      entire /resources dir in one statement
        testClassesJar.addAsResource("binary-blob-sample.jar");
        testClassesJar.addAsResource("test-alert-sender-serverplugin.xml");
        testClassesJar.addAsResource("test-assist-color-number.txt");
        testClassesJar.addAsResource("test-ldap.properties");
        testClassesJar.addAsResource("test-scheduler.properties");
        testClassesJar.addAsResource("cassandra-test.properties");
        testClassesJar
View Full Code Here

        testClassesJar.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); // add CDI injection (needed by arquillian injection);
        //TOD0 (jshaughn): Once we have identified all of the necessary test resource files, see if we can just add the
        //      entire /resources dir in one statement
        testClassesJar.addAsResource("binary-blob-sample.jar");
        testClassesJar.addAsResource("test-alert-sender-serverplugin.xml");
        testClassesJar.addAsResource("test-assist-color-number.txt");
        testClassesJar.addAsResource("test-ldap.properties");
        testClassesJar.addAsResource("test-scheduler.properties");
        testClassesJar.addAsResource("cassandra-test.properties");
        testClassesJar
            .addAsResource("org/rhq/enterprise/server/configuration/metadata/configuration_metadata_manager_bean_test_v1.xml");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.