@Deployment public static JavaArchive createTestArchive() { return ShrinkWrap.create(JavaArchive.class, "test.jar") .addPackages(true, DeploymentRoot.class.getPackage()) .addAsManifestResource(new ByteArrayAsset("".getBytes()), ArchivePaths.create("beans.xml")) .addAsManifestResource("test-persistence.xml", ArchivePaths.create("persistence.xml")); }
@Deployment(name = "ws-testbean", testable = false) @TargetsContainer("jboss") public static JavaArchive createWSTestDeployment() { JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "ws-testbean.jar"); archive.addAsResource(new File("../../unit-tests/trust/target/test-classes/handlers.xml")); archive.addAsResource( new File( "../../unit-tests/trust/target/test-classes/org/picketlink/test/trust/ws/WSTestBean.class"), ArchivePaths.create("org/picketlink/test/trust/ws/WSTestBean.class")); archive.addAsManifestResource( new File("../../unit-tests/trust/target/test-classes/jboss-deployment-structure.xml")); archive.addAsResource( new File("../../unit-tests/trust/target/test-classes/props/sts-users.properties"), ArchivePaths.create("users.properties")); archive.addAsResource( new File("../../unit-tests/trust/target/test-classes/props/sts-roles.properties"), ArchivePaths.create("roles.properties")); archive.addAsResource( new File("../../unit-tests/trust/target/test-classes/props/sts-config.properties"), ArchivePaths.create("sts-config.properties")); archive.addClass(org.picketlink.test.trust.ws.WSTest.class); return archive; }
@Deployment() public static Archive<?> createDeployment() { return ShrinkWrap.create(JavaArchive.class, "jbpm-human-task-cdi.jar") .addPackage("org.jboss.seam.persistence") // seam-persistence .addPackage("org.jboss.seam.transaction") // seam-persistence .addPackage("org.jbpm.shared.services.api") .addPackage("org.jbpm.shared.services.impl") .addPackage("org.jbpm.services.task") .addPackage("org.jbpm.services.task.annotations") .addPackage("org.jbpm.services.task.api") .addPackage("org.jbpm.services.task.impl") .addPackage("org.jbpm.services.task.events") .addPackage("org.jbpm.services.task.exception") .addPackage("org.jbpm.services.task.identity") .addPackage("org.jbpm.services.task.factories") .addPackage("org.jbpm.services.task.internals") .addPackage("org.jbpm.services.task.internals.lifecycle") .addPackage("org.jbpm.services.task.internals.email") // email producer .addPackage("org.jbpm.services.task.lifecycle.listeners") .addPackage("org.jbpm.services.task.query") .addPackage("org.jbpm.services.task.util") .addPackage("org.jbpm.services.task.commands") // This should not be required here .addPackage("org.jbpm.services.task.deadlines") // deadlines .addPackage("org.jbpm.services.task.deadlines.notifications.impl.email") // emial support .addPackage("org.jbpm.services.task.subtask") .addAsManifestResource("META-INF/persistence.xml", ArchivePaths.create("persistence.xml")) .addAsManifestResource("META-INF/Taskorm.xml", ArchivePaths.create("Taskorm.xml")) .addAsManifestResource("beans-deadlines.xml", ArchivePaths.create("beans.xml")); }
protected File buildDefaultPar_1_0() { String fileName = "defaultpar_1_0.par"; JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName); archive.addClasses( ApplicationServer1.class, Lighter1.class, Money1.class, Mouse1.class, IncrementListener1.class, Version1.class); ArchivePath path = ArchivePaths.create("META-INF/orm.xml"); archive.addAsResource("defaultpar_1_0/META-INF/orm.xml", path); path = ArchivePaths.create("META-INF/persistence.xml"); archive.addAsResource("defaultpar_1_0/META-INF/persistence.xml", path); path = ArchivePaths.create("org/hibernate/jpa/test/pack/defaultpar_1_0/Mouse.hbm.xml"); archive.addAsResource( "defaultpar_1_0/org/hibernate/jpa/test/pack/defaultpar_1_0/Mouse1.hbm.xml", path); path = ArchivePaths.create("org/hibernate/jpa/test/pack/defaultpar_1_0/package-info.class"); archive.addAsResource("org/hibernate/jpa/test/pack/defaultpar_1_0/package-info.class", path); File testPackage = new File(packageTargetDir, fileName); archive.as(ZipExporter.class).exportTo(testPackage, true); return testPackage; }
protected File buildWar() { String fileName = "war.war"; WebArchive archive = ShrinkWrap.create(WebArchive.class, fileName); archive.addClasses( org.hibernate.jpa.test.pack.war.ApplicationServer.class, org.hibernate.jpa.test.pack.war.IncrementListener.class, org.hibernate.jpa.test.pack.war.Lighter.class, org.hibernate.jpa.test.pack.war.Money.class, org.hibernate.jpa.test.pack.war.Mouse.class, org.hibernate.jpa.test.pack.war.OtherIncrementListener.class, org.hibernate.jpa.test.pack.war.Version.class); ArchivePath path = ArchivePaths.create("WEB-INF/classes/META-INF/orm.xml"); archive.addAsResource("war/WEB-INF/classes/META-INF/orm.xml", path); path = ArchivePaths.create("WEB-INF/classes/META-INF/persistence.xml"); archive.addAsResource("war/WEB-INF/classes/META-INF/persistence.xml", path); path = ArchivePaths.create("WEB-INF/classes/org/hibernate/jpa/test/pack/war/Mouse.hbm.xml"); archive.addAsResource( "war/WEB-INF/classes/org/hibernate/jpa/test/pack/war/Mouse.hbm.xml", path); File testPackage = new File(packageTargetDir, fileName); archive.as(ZipExporter.class).exportTo(testPackage, true); return testPackage; }
@Deployment() public static Archive<?> createDeployment() { return ShrinkWrap.create(JavaArchive.class, "domain-services.jar") .addPackage("org.jbpm.services.task") .addPackage("org.jbpm.services.task.wih") // work items org.jbpm.services.task.wih .addPackage("org.jbpm.services.task.annotations") .addPackage("org.jbpm.services.task.api") .addPackage("org.jbpm.services.task.impl") .addPackage("org.jbpm.services.task.events") .addPackage("org.jbpm.services.task.exception") .addPackage("org.jbpm.services.task.identity") .addPackage("org.jbpm.services.task.factories") .addPackage("org.jbpm.services.task.internals") .addPackage("org.jbpm.services.task.internals.lifecycle") .addPackage("org.jbpm.services.task.lifecycle.listeners") .addPackage("org.jbpm.services.task.query") .addPackage("org.jbpm.services.task.util") .addPackage("org.jbpm.services.task.commands") // This should not be required here .addPackage("org.jbpm.services.task.deadlines") // deadlines .addPackage("org.jbpm.services.task.deadlines.notifications.impl") .addPackage("org.jbpm.services.task.subtask") .addPackage("org.jbpm.services.task.rule") .addPackage("org.jbpm.services.task.rule.impl") .addPackage("org.jbpm.services.task.audit.service") .addPackage("org.kie.internal.runtime.manager") .addPackage("org.kie.internal.runtime.manager.context") .addPackage("org.kie.internal.runtime.manager.cdi.qualifier") .addPackage("org.jbpm.runtime.manager.impl") .addPackage("org.jbpm.runtime.manager.impl.cdi") .addPackage("org.jbpm.runtime.manager.impl.factory") .addPackage("org.jbpm.runtime.manager.impl.jpa") .addPackage("org.jbpm.runtime.manager.impl.manager") .addPackage("org.jbpm.runtime.manager.impl.task") .addPackage("org.jbpm.runtime.manager.impl.tx") .addPackage("org.jbpm.shared.services.api") .addPackage("org.jbpm.shared.services.impl") .addPackage("org.jbpm.shared.services.impl.tx") .addPackage("org.jbpm.kie.services.api") .addPackage("org.jbpm.kie.services.impl") .addPackage("org.jbpm.kie.services.api.bpmn2") .addPackage("org.jbpm.kie.services.impl.bpmn2") .addPackage("org.jbpm.kie.services.impl.event.listeners") .addPackage("org.jbpm.kie.services.impl.audit") .addPackage("org.jbpm.kie.services.impl.form") .addPackage("org.jbpm.kie.services.impl.form.provider") .addPackage("org.jbpm.services.cdi") .addPackage("org.jbpm.services.cdi.impl") .addPackage("org.jbpm.services.cdi.impl.form") .addPackage("org.jbpm.services.cdi.impl.manager") .addPackage("org.jbpm.services.cdi.producer") .addPackage("org.jbpm.services.cdi.impl.security") .addPackage("org.jbpm.test.util") .addPackage("org.jbpm.kie.services.test") .addPackage("org.jbpm.services.cdi.test") // Identity Provider Test Impl here .addClass("org.jbpm.services.cdi.test.util.CDITestHelperNoTaskService") .addAsResource("jndi.properties", "jndi.properties") .addAsManifestResource("META-INF/persistence.xml", ArchivePaths.create("persistence.xml")) .addAsManifestResource("META-INF/beans.xml", ArchivePaths.create("beans.xml")); }
/** * Test to make sue an archive can be exported and nested archives are also in exported. * * @throws Exception */ @Test public void testExportNested() throws Exception { log.info("testExportNested"); // Get a temp directory for the test final File tempDirectory = createTempDirectory("testExportNested"); // Get an archive instance final Archive<?> archive = createArchiveWithNestedArchives(); // Export as InputStream final InputStream exportStream = this.exportAsInputStream(archive); // Write out and retrieve as exported file final File exported = new File(tempDirectory, NAME_ARCHIVE + this.getArchiveExtension()); final OutputStream exportedOut = new FileOutputStream(exported); IOUtil.copyWithClose(exportStream, exportedOut); // Validate entries were written out this.ensureAssetInExportedFile(exported, PATH_ONE, ASSET_ONE); this.ensureAssetInExportedFile(exported, PATH_TWO, ASSET_TWO); // Validate nested archive entries were written out final ArchivePath nestedArchivePath = ArchivePaths.create(NAME_NESTED_ARCHIVE + this.getArchiveExtension()); // Get inputstream for entry final InputStream nestedArchiveStream = this.getContentsFromExportedFile(exported, nestedArchivePath); // Write out and retrieve nested contents final File nestedFile = new File(tempDirectory, NAME_NESTED_ARCHIVE + this.getArchiveExtension()); final OutputStream nestedOut = new FileOutputStream(nestedFile); IOUtil.copyWithClose(nestedArchiveStream, nestedOut); // Ensure contents are in the nested this.ensureAssetInExportedFile(nestedFile, PATH_ONE, ASSET_ONE); this.ensureAssetInExportedFile(nestedFile, PATH_TWO, ASSET_TWO); // Validate nested archive entries were written out final ArchivePath nestedArchiveTwoPath = ArchivePaths.create(NESTED_PATH, NAME_NESTED_ARCHIVE_2 + this.getArchiveExtension()); this.getContentsFromExportedFile(exported, nestedArchiveTwoPath); final InputStream nestedArchiveTwoStream = this.getContentsFromExportedFile(exported, nestedArchiveTwoPath); // Write out and retrieve secondnested contents final File nestedTwoFile = new File(tempDirectory, NAME_NESTED_ARCHIVE_2 + this.getArchiveExtension()); final OutputStream nestedTwoOut = new FileOutputStream(nestedTwoFile); IOUtil.copyWithClose(nestedArchiveTwoStream, nestedTwoOut); // Ensure contents are in the second nested this.ensureAssetInExportedFile(nestedTwoFile, PATH_ONE, ASSET_ONE); this.ensureAssetInExportedFile(nestedTwoFile, PATH_TWO, ASSET_TWO); }
@Deployment public static JavaArchive archive() { return ShrinkWrap.create( JavaArchive.class, EnvEntriesArquillianStandaloneTest.class.getSimpleName().concat(".jar")) .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("ejb-jar.xml")) .addAsManifestResource( new StringAsset("foo=bar"), ArchivePaths.create("env-entries.properties")); }
public static void addFiles(ResourceContainer<?> archive, File dir, ArchivePath dest) { for (String name : dir.list()) { File file = new File(dir, name); if (file.isDirectory()) { addFiles(archive, file, ArchivePaths.create(dest, name)); } else { archive.addAsResource(file, ArchivePaths.create(dest, name)); } } }
private JavaArchive getLoopyArchive() { JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "loopy.jar") .addClasses(SampleExecutionFactory.class) .addAsManifestResource( new ByteArrayAsset(SampleExecutionFactory.class.getName().getBytes()), ArchivePaths.create("services/org.teiid.translator.ExecutionFactory")); jar.addAsManifestResource( new ByteArrayAsset("Dependencies: org.jboss.teiid.translator.loopback\n".getBytes()), ArchivePaths.create("MANIFEST.MF")); return jar; }
/** * Create a basic deployment containing API classes, the Extension class and test persistence / * beans descriptor. * * @return Basic web archive. */ public static WebArchive initDeployment() { Logging.reconfigure(); return ShrinkWrap.create(WebArchive.class, "test.war") .addClasses(QueryExtension.class) .addPackage(DaoComponents.class.getPackage()) .addPackage(QueryBuilder.class.getPackage()) .addAsWebInfResource( "test-persistence.xml", ArchivePaths.create("classes/META-INF/persistence.xml")) .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")) .addAsWebInfResource("glassfish-resources.xml"); // TODO: Adding the datasource was somehow refusing to work with arquillian.xml. // Switched to web deployment for the time being. }
protected File buildOverridenPar() { String fileName = "overridenpar.jar"; JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName); archive.addClasses(org.hibernate.jpa.test.pack.overridenpar.Bug.class); ArchivePath path = ArchivePaths.create("META-INF/persistence.xml"); archive.addAsResource("overridenpar/META-INF/persistence.xml", path); path = ArchivePaths.create("overridenpar.properties"); archive.addAsResource("overridenpar/overridenpar.properties", path); File testPackage = new File(packageTargetDir, fileName); archive.as(ZipExporter.class).exportTo(testPackage, true); return testPackage; }
protected File buildCfgXmlPar() { String fileName = "cfgxmlpar.par"; JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName); archive.addClasses(Morito.class, Item.class); ArchivePath path = ArchivePaths.create("META-INF/persistence.xml"); archive.addAsResource("cfgxmlpar/META-INF/persistence.xml", path); path = ArchivePaths.create("org/hibernate/jpa/test/pack/cfgxmlpar/hibernate.cfg.xml"); archive.addAsResource( "cfgxmlpar/org/hibernate/jpa/test/pack/cfgxmlpar/hibernate.cfg.xml", path); File testPackage = new File(packageTargetDir, fileName); archive.as(ZipExporter.class).exportTo(testPackage, true); return testPackage; }
@Deployment public static JavaArchive createTestArchive() { return ShrinkWrap.create(JavaArchive.class, "test.jar") .addPackage(JMSOperations.class.getPackage()) .addClass(CreateTopicSetupTask.class) .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); }
@Deployment public static JavaArchive createTestArchive() { return ShrinkWrap.create(JavaArchive.class, "test.jar") .addClasses(HelloWorldService.class) .addAsManifestResource( new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml")); }
@Deployment public static WebArchive createDeployment() { // The servlet protocol relies on the war being called test.war WebArchive war = ShrinkWrapUtils.createWebArchive("jsf-example.war", JSFTestCase.class); war.addWebResource(EmptyAsset.INSTANCE, "beans.xml") .addManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")) .add( new Asset() { @Override public InputStream openStream() { try { return new ByteArrayInputStream( "org.jboss.arquillian.junit.JUnitTestRunner".getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } }, "META-INF/services/" + TestRunner.class.getName()) .addManifestResource(jsfunitFacesConfigXml(), "faces-config.xml") .addManifestResource("arquillian/web-fragment.xml", "web-fragment.xml"); // System.out.println(war.toString(true)); // for debugging return war; }
@Deployment public static WebArchive createDeployment() { return ShrinkWrap.create(WebArchive.class, "tika-extractor-test.war") .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")) .addAsResource(new File("src/test/resources/text-extractor")) .setManifest(new File("src/main/webapp/META-INF/MANIFEST.MF")); }
/** Webapp with beans.xml and no classes */ @Deployment public static WebArchive createWebArchive() { WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war"); war.addAsLibrary(createJavaArchive()); war.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); return war; }
@Deployment public static JavaArchive createTestArchive() { return ShrinkWrap.create(JavaArchive.class, "test.jar") .addClasses(DefaultLocaleProducer.class) .addManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); // .addManifestResource("org/jboss/seam/international/test/locale/override-lang-country-variant.xml", // ArchivePaths.create("beans.xml")); }
/** * {@inheritDoc} * * @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Archive, java.lang.String, * java.lang.Class) */ @Override public T add( final Archive<?> archive, final String path, final Class<? extends StreamExporter> exporter) { Validate.notNull(archive, "Archive must be specified"); Validate.notNullOrEmpty(path, "Archive Path must be specified"); Validate.notNull(exporter, "exporter must be specified"); return this.add(archive, ArchivePaths.create(path), exporter); }
@Test public void shouldGenerateDependencies() throws Exception { Archive<?> archive = new TestNGDeploymentAppender().createAuxiliaryArchive(); Assert.assertTrue( "Should have added TestRunner SPI", archive.contains( ArchivePaths.create( "/META-INF/services/org.jboss.arquillian.container.test.spi.TestRunner"))); Assert.assertTrue( "Should have added TestRunner Impl", archive.contains( ArchivePaths.create("/org/jboss/arquillian/testng/container/TestNGTestRunner.class"))); System.out.println(archive.toString(true)); }
/** * {@inheritDoc} * * @see * org.jboss.shrinkwrap.api.container.WebContainer#addAsWebInfResource(org.jboss.shrinkwrap.api.asset.Asset, * java.lang.String) */ @Override public T addAsWebInfResource(final Asset resource, final String target) throws IllegalArgumentException { Validate.notNull(resource, "Resource should be specified"); Validate.notNullOrEmpty(target, "Target should be specified"); return addAsWebInfResource(resource, ArchivePaths.create(target)); }
@Deployment public static JavaArchive createArchive() { return ShrinkWrap.create(JavaArchive.class) .addPackage(JcrCDIEventListener.class.getPackage()) .addClass(EventCounterListener.class) .addPackage(RepositoryResolverImpl.class.getPackage()) .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); }
/** Java library with beans.xml The Foo class is vetoed so that it is not loaded as a CDI Bean. */ public static JavaArchive createJavaArchive() { JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "test.jar"); jar.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); jar.addClasses(SimpleExtension.class, Foo.class, Bar.class); jar.addAsManifestResource( "org/jboss/weld/tests/inheritance/weld824/veto/SimpleExtension", "services/javax.enterprise.inject.spi.Extension"); return jar; }
/** * Create the deployment archive to be deployed by Arquillian. * * @return a WebArchive representing the required deployment */ @Deployment public static WebArchive createTestArchive() { return ShrinkWrap.create(WebArchive.class, "wsat-simple.war") .addPackages(true, RestaurantServiceATImpl.class.getPackage()) .addAsResource("context-handlers.xml") .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")) .setManifest(new StringAsset(ManifestMF)); }
/* (non-Javadoc) * @see org.jboss.shrinkwrap.api.container.WebContainer#addWebResource(java.lang.Package, java.lang.String, java.lang.String) */ @Override public T addAsWebResource(Package resourcePackage, String resourceName, String target) throws IllegalArgumentException { Validate.notNull(resourcePackage, "ResourcePackage must be specified"); Validate.notNull(resourceName, "ResourceName must be specified"); Validate.notNull(target, "Target must be specified"); return addAsWebResource(resourcePackage, resourceName, ArchivePaths.create(target)); }
protected File buildExcludeHbmPar() { String fileName = "excludehbmpar.par"; JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName); archive.addClasses(Caipirinha.class); ArchivePath path = ArchivePaths.create("META-INF/orm2.xml"); archive.addAsResource("excludehbmpar/META-INF/orm2.xml", path); path = ArchivePaths.create("META-INF/persistence.xml"); archive.addAsResource("excludehbmpar/META-INF/persistence.xml", path); path = ArchivePaths.create("org/hibernate/jpa/test/pack/excludehbmpar/Mouse.hbm.xml"); archive.addAsResource( "excludehbmpar/org/hibernate/jpa/test/pack/excludehbmpar/Mouse.hbm.xml", path); File testPackage = new File(packageTargetDir, fileName); archive.as(ZipExporter.class).exportTo(testPackage, true); return testPackage; }
protected File buildExplodedPar() { String fileName = "explodedpar"; JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName); archive.addClasses(Elephant.class, Carpet.class); ArchivePath path = ArchivePaths.create("META-INF/persistence.xml"); archive.addAsResource("explodedpar/META-INF/persistence.xml", path); path = ArchivePaths.create("org/hibernate/jpa/test/pack/explodedpar/Elephant.hbm.xml"); archive.addAsResource( "explodedpar/org/hibernate/jpa/test/pack/explodedpar/Elephant.hbm.xml", path); path = ArchivePaths.create("org/hibernate/jpa/test/pack/explodedpar/package-info.class"); archive.addAsResource("org/hibernate/jpa/test/pack/explodedpar/package-info.class", path); File testPackage = new File(packageTargetDir, fileName); archive.as(ExplodedExporter.class).exportExploded(packageTargetDir); return testPackage; }
@Deployment() public static Archive<?> createDeployment() { return ShrinkWrap.create(JavaArchive.class, "droolsjbpm-knowledge-services.jar") .addPackage("org.jboss.seam.persistence") // seam-persistence .addPackage("org.jboss.seam.transaction") // seam-persistence .addPackage("org.jbpm.task") .addPackage("org.jbpm.task.wih") // work items org.jbpm.task.wih .addPackage("org.jbpm.task.annotations") .addPackage("org.jbpm.task.api") .addPackage("org.jbpm.task.impl") .addPackage("org.jbpm.task.events") .addPackage("org.jbpm.task.exception") .addPackage("org.jbpm.task.identity") .addPackage("org.jbpm.task.factories") .addPackage("org.jbpm.task.internals") .addPackage("org.jbpm.task.internals.lifecycle") .addPackage("org.jbpm.task.lifecycle.listeners") .addPackage("org.jbpm.task.query") .addPackage("org.jbpm.task.util") .addPackage("org.jbpm.task.commands") // This should not be required here .addPackage("org.jbpm.task.deadlines") // deadlines .addPackage("org.jbpm.task.deadlines.notifications.impl") .addPackage("org.jbpm.task.subtask") .addPackage("org.droolsjbpm.services.api") .addPackage("org.droolsjbpm.services.api.bpmn2") .addPackage("org.droolsjbpm.services.impl") .addPackage("org.droolsjbpm.services.impl.bpmn2") .addPackage("org.droolsjbpm.services.impl.vfs") .addPackage("org.jbpm.shared.services.api") .addPackage("org.jbpm.shared.services.impl") .addPackage("org.kie.commons.java.nio.fs.jgit") .addPackage("org.droolsjbpm.services.test") .addPackage("org.droolsjbpm.services.impl.event.listeners") .addPackage("org.droolsjbpm.services.impl.example") .addPackage("org.droolsjbpm.services.impl.util") .addAsManifestResource("META-INF/persistence.xml", ArchivePaths.create("persistence.xml")) .addAsManifestResource("META-INF/Taskorm.xml", ArchivePaths.create("Taskorm.xml")) .addAsManifestResource("META-INF/beans.xml", ArchivePaths.create("beans.xml")) .addAsManifestResource( "META-INF/services/org.kie.commons.java.nio.file.spi.FileSystemProvider", ArchivePaths.create("org.kie.commons.java.nio.file.spi.FileSystemProvider")); }
protected File buildExplicitPar() { // explicitpar/persistence.xml references externaljar.jar so build that from here. // this is the reason for tests failing after clean at least on my (Steve) local system buildExternalJar(); String fileName = "explicitpar.par"; JavaArchive archive = ShrinkWrap.create(JavaArchive.class, fileName); archive.addClasses( Airplane.class, Seat.class, Cat.class, Kitten.class, Distributor.class, Item.class); ArchivePath path = ArchivePaths.create("META-INF/orm.xml"); archive.addAsResource("explicitpar/META-INF/orm.xml", path); path = ArchivePaths.create("META-INF/persistence.xml"); archive.addAsResource("explicitpar/META-INF/persistence.xml", path); File testPackage = new File(packageTargetDir, fileName); archive.as(ZipExporter.class).exportTo(testPackage, true); return testPackage; }