Refine search
@Deployment(order = 1, name="pa2") public static WebArchive processArchive2() { return initWebArchiveDeployment("pa2.war", "org/camunda/bpm/integrationtest/jobexecutor/IndependentJobExecutionTest.pa2.xml") .addAsResource("org/camunda/bpm/integrationtest/jobexecutor/IndependentJobExecutionTest.process2.bpmn20.xml") .setWebXML(new StringAsset(Descriptors.create(WebAppDescriptor.class).version("3.0").exportAsString())); }
@Override public DescriptorImporter<T> call() throws Exception { return org.jboss.shrinkwrap.descriptor.api.Descriptors.importAs(type, descriptorName); } });
private ArquillianDescriptor resolveDescriptor(final InputStream input) { final ArquillianDescriptor descriptor; if (input != null) { descriptor = Descriptors.importAs(ArquillianDescriptor.class) .fromStream(input); } else { descriptor = Descriptors.create(ArquillianDescriptor.class); } return descriptor; }
@Deployment(name = "EJB", order = 1, testable = false) public static JavaArchive createEjbtArchive() { return ShrinkWrap .create(JavaArchive.class, "test-ejb.jar") .addClasses(FooRemote.class, FooBean.class, Bar.class, ProcessBeanObserver.class) .addAsServiceProvider(Extension.class, ProcessBeanObserver.class) .addAsManifestResource(new StringAsset(Descriptors.create(BeansDescriptor.class).beanDiscoveryMode(BeanDiscoveryMode._ALL.toString()).version( Versions.v1_1).exportAsString()), "beans.xml"); }
@CubeDockerFile public static Archive<?> createDockerfile() { String dockerDescriptor = Descriptors.create(DockerDescriptor.class) .from(BASE_IMAGE) .exportAsString(); return ShrinkWrap.create(GenericArchive.class) .add(new StringAsset(dockerDescriptor), "Dockerfile"); }
private static DeploymentContext createDeploymentContext( GatewayConfig config, String archivePath, Topology topology, Map<String,List<ProviderDeploymentContributor>> providers ) { archivePath = Urls.encode( archivePath ); WebArchive webArchive = ShrinkWrap.create( WebArchive.class, archivePath ); WebAppDescriptor webAppDesc = Descriptors.create( WebAppDescriptor.class ); GatewayDescriptor gateway = GatewayDescriptorFactory.create(); return new DeploymentContextImpl( config, topology, gateway, webArchive, webAppDesc, providers ); }
@Deployment public static WebArchive createTestArchive() { return new WebArchiveBuilder() .withTestClassPackage(InterceptorBindingTypeWithMemberTest.class) .withBeansXml( Descriptors .create(BeansDescriptor.class) .getOrCreateInterceptors() .clazz(IncreasingInterceptor.class.getName(), DecreasingInterceptor.class.getName(), VehicleCountInterceptor.class.getName(), PlantInterceptor.class.getName()).up()) .build(); }
private static Asset warManifest() { String manifest = Descriptors.create( ManifestDescriptor.class ) .addToClassPath( EJB_ARCHIVE_NAME ) .exportAsString(); return new StringAsset( manifest ); }
private Archive<?> handleWar(WebArchive war, WebArchive protocol, Processor processor) { if (war.contains(WEB_XML_PATH)) { WebAppDescriptor applicationWebXml = Descriptors.importAs(WebAppDescriptor.class).fromStream(war.get(WEB_XML_PATH).getAsset().openStream()); // SHRINKWRAP-187, to eager on not allowing overrides, delete it first war.delete(WEB_XML_PATH); war.setWebXML(new StringAsset(mergeWithDescriptor(applicationWebXml).exportAsString())); war.merge(protocol, Filters.exclude(".*web\\.xml.*")); } else { war.merge(protocol); } processor.process(war); return war; }
@Test public void shouldNotForceRestartIfMaxDeploymentsNotSet() throws Exception { ArquillianDescriptor desc = Descriptors.create(ArquillianDescriptor.class) .engine(); bind(ApplicationScoped.class, ArquillianDescriptor.class, desc); for (int i = 0; i < 10; i++) { fire(new BeforeClass(getClass())); } assertEventFired(StartSuiteContainers.class, 0); assertEventFired(StopSuiteContainers.class, 0); } }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionOnDefinedLaunchQualifierMissing() throws IllegalArgumentException { System.setProperty(ContainerRegistryCreator.ARQUILLIAN_LAUNCH_PROPERTY, CONTAINER_1); try { fire(Descriptors.create(ArquillianDescriptor.class) .container(CONTAINER_2)); } catch (IllegalArgumentException e) { Assert.assertTrue(e.getMessage().startsWith("No container or group found that match given qualifier")); throw e; } finally { System.setProperty(ContainerRegistryCreator.ARQUILLIAN_LAUNCH_PROPERTY, ""); } }
private static PersistenceDescriptor persistenceXml() { final PersistenceDescriptor pd = Descriptors.create( PersistenceDescriptor.class ) .version( "2.1" ) .createPersistenceUnit().name( PERSISTENCE_UNIT_NAME ) .transactionType( PersistenceUnitTransactionType._JTA ) .jtaDataSource( "java:jboss/datasources/ExampleDS" ) .clazz( WildFlyDdlEntity.class.getName() ) .excludeUnlistedClasses( true ) .getOrCreateProperties().createProperty().name( "jboss.as.jpa.providerModule" ).value( "org.hibernate:5.3" ).up().up() .getOrCreateProperties().createProperty().name( "hibernate.hbm2ddl.auto" ).value( "create-drop" ).up().up() // this should not be needed, but... .getOrCreateProperties().createProperty().name( AvailableSettings.JTA_PLATFORM ).value( JBossAppServerJtaPlatform.class.getName() ).up().up() .up(); System.out.println( "persistence.xml: " ); pd.exportTo( System.out ); return pd; }
@Test(expected = IllegalStateException.class) public void shouldThrowExceptionIfMultipleGroupsSetAsDefault() throws IllegalStateException { try { fire( Descriptors.create(ArquillianDescriptor.class) .group(GROUP_1) .setGroupDefault() .group(GROUP_2) .setGroupDefault()); } catch (IllegalStateException e) { Assert.assertTrue(e.getMessage().startsWith("Multiple Groups defined as default")); throw e; } }
private ArquillianDescriptor createDescriptor(String defaultProtocol) { ArquillianDescriptor desc = Descriptors.create(ArquillianDescriptor.class); if (defaultProtocol != null) { desc.defaultProtocol(defaultProtocol); } return desc; } }
public ArquillianDescriptor resolve(ArquillianDescriptor descriptor) { final String descriptorAsString = descriptor.exportAsString(); return Descriptors.importAs(ArquillianDescriptor.class) .fromString(StringPropertyReplacer.replaceClasspath(descriptorAsString)); }
@Deployment public static WebArchive deploy() { BeansDescriptor beans = Descriptors.create(BeansDescriptor.class) .getOrCreateInterceptors() .clazz("org.eclipse.microprofile.fault.tolerance.tck.interceptor.xmlInterceptorEnabling.EarlyFtInterceptor").up() .getOrCreateInterceptors() .clazz("org.eclipse.microprofile.fault.tolerance.tck.interceptor.xmlInterceptorEnabling.LateFtInterceptor").up(); JavaArchive testJar = ShrinkWrap .create(JavaArchive.class, "interceptorFtXml.jar") .addClasses(InterceptorComponent.class, EarlyFtInterceptor.class, LateFtInterceptor.class, OrderQueueProducer.class) .addAsManifestResource(new StringAsset(beans.exportAsString()), "beans.xml") .as(JavaArchive.class); return ShrinkWrap.create(WebArchive.class, "interceptorFtXml.war") .addAsLibrary(testJar); }
@CubeDockerFile public static Archive<?> createDockerfile() { String dockerDescriptor = Descriptors.create(DockerDescriptor.class).from("tomee").exportAsString(); return ShrinkWrap.create(GenericArchive.class) .add(new StringAsset(dockerDescriptor), "Dockerfile"); }
private static DeploymentContext createDeploymentContext( GatewayConfig config, String archivePath, Topology topology, Map<String,List<ProviderDeploymentContributor>> providers ) { archivePath = Urls.encode( archivePath ); WebArchive webArchive = ShrinkWrap.create( WebArchive.class, archivePath ); WebAppDescriptor webAppDesc = Descriptors.create( WebAppDescriptor.class ); GatewayDescriptor gateway = GatewayDescriptorFactory.create(); DeploymentContext context = new DeploymentContextImpl( config, topology, gateway, webArchive, webAppDesc, providers ); return context; }
@ShouldThrowException(DeploymentException.class) @Deployment public static WebArchive createTestArchive() { return new WebArchiveBuilder() .withTestClassPackage(SameTypeListedTwiceTest.class) .withBeansXml( Descriptors.create(BeansDescriptor.class).getOrCreateAlternatives() .clazz(Dog.class.getName(), Cat.class.getName(), Cat.class.getName()).up()).build(); }
private Asset createApplicationDescriptor() { return new StringAsset( Descriptors.create(ApplicationDescriptor.class) .version("6") .ejbModule("test.jar") .exportAsString()); }