Java Code Examples for org.jboss.shrinkwrap.api.asset.EmptyAsset

The following examples show how to use org.jboss.shrinkwrap.api.asset.EmptyAsset. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Deployment
public static WebArchive deployAnotherApp() {
    JavaArchive testJar = ShrinkWrap
        .create(JavaArchive.class, "ftConfig.jar")
        .addClasses(BeanWithRetry.class)
        .addAsManifestResource(new StringAsset(
                                   "org.eclipse.microprofile.fault.tolerance.tck.config.BeanWithRetry/Retry/maxRetries=5" +
                                       "\norg.eclipse.microprofile.fault.tolerance.tck.config.BeanWithRetry/triggerException/Retry/maxRetries=6"),
                               "microprofile-config.properties")
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
        .as(JavaArchive.class);

    WebArchive war = ShrinkWrap
        .create(WebArchive.class, "ftConfigTest.war")
        .addAsLibrary(testJar);
    return war;
}
 
Example 2
@Deployment
public static WebArchive createDeployment() {
    String urlProperty1 = SimpleGetApi.class.getName() + "/mp-rest/uri=" + getStringURL();
    String urlProperty2 = "myConfigKey/mp-rest/uri=" + getStringURL();
    String redirectProperty = "myConfigKey/mp-rest/followRedirects=true";
    String simpleName = CDIFollowRedirectsTest.class.getSimpleName();
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, simpleName + ".jar")
        .addClasses(SimpleGetApi.class, SimpleGetApiWithConfigKey.class, 
                    FollowRedirectsTest.class, WiremockArquillianTest.class)
        .addAsManifestResource(new StringAsset(String.format(redirectProperty + "%n" + urlProperty1 + "%n" + urlProperty2)),
                                               "microprofile-config.properties")
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    return ShrinkWrap.create(WebArchive.class, simpleName + ".war")
        .addAsLibrary(jar)
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
Example 3
Source Project: datawave   Source File: WiredQueryExecutorBeanTest.java    License: Apache License 2.0 6 votes vote down vote up
@Deployment
public static JavaArchive createDeployment() throws Exception {
    System.setProperty("cdi.bean.context", "springFrameworkBeanRefContext.xml");
    // Set system properties that are normally set by the Wildfly container, and needed for test deployment
    try (InputStream is = WiredQueryExecutorBeanTest.class.getResourceAsStream("/test-system-properties.properties")) {
        Properties systemProperties = System.getProperties();
        systemProperties.load(is);
        System.setProperties(systemProperties);
    }
    
    return ShrinkWrap
                    .create(JavaArchive.class)
                    .addPackages(true, "org.apache.deltaspike", "io.astefanutti.metrics.cdi", "datawave.data.type", "datawave.query.language.parser.jexl",
                                    "datawave.query.language.functions.jexl", "datawave.webservice.query.configuration", "datawave.configuration")
                    .addClasses(DefaultResponseObjectFactory.class, QueryExpirationConfiguration.class, FacetedQueryPlanner.class, FacetedQueryLogic.class,
                                    DefaultQueryPlanner.class, BooleanChunkingQueryPlanner.class, ShardQueryLogic.class, CountingShardQueryLogic.class,
                                    EventQueryDataDecoratorTransformer.class, FieldIndexCountQueryLogic.class, CompositeQueryLogic.class,
                                    QueryMetricQueryLogic.class, TLDQueryLogic.class, ParentQueryLogic.class, DiscoveryLogic.class, IndexQueryLogic.class,
                                    QueryLogicFactoryImpl.class, NoOpQueryMetricHandler.class, DatawaveRoleManager.class, EasyRoleManager.class,
                                    CachedResultsConfiguration.class, DateIndexHelperFactory.class, EdgeDictionaryResponseTypeProducer.class,
                                    RemoteEdgeDictionary.class, DefaultMapperDecorator.class).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
Example 4
Source Project: ConfigJSR   Source File: ConverterTest.java    License: Apache License 2.0 6 votes vote down vote up
@Deployment
public static WebArchive deploy() {
    JavaArchive testJar = ShrinkWrap
            .create(JavaArchive.class, "converterTest.jar")
            .addClass(ConverterTest.class)
            .addPackage(CustomDbConfigSource.class.getPackage())
            .addClasses(DuckConverter.class, Duck.class, Donald.class, SomeEnumToConvert.class)
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsServiceProvider(ConfigSource.class, CustomDbConfigSource.class)
            .addAsServiceProvider(ConfigSourceProvider.class, CustomConfigSourceProvider.class)
            .addAsServiceProvider(Converter.class, DuckConverter.class)
            .as(JavaArchive.class);

    AbstractTest.addFile(testJar, "META-INF/javaconfig.properties");
    AbstractTest.addFile(testJar, "sampleconfig.yaml");

    WebArchive war = ShrinkWrap
            .create(WebArchive.class, "converterTest.war")
            .addAsLibrary(testJar);
    return war;
}
 
Example 5
@Deployment
public static WebArchive deployment() {
    ConfigAnnotationAsset timeoutConfig = new ConfigAnnotationAsset()
            .autoscaleMethod(UninterruptableTimeoutClient.class, "serviceTimeout")
            .autoscaleMethod(UninterruptableTimeoutClient.class, "serviceTimeoutAsync")
            .autoscaleMethod(UninterruptableTimeoutClient.class, "serviceTimeoutAsyncCS")
            .autoscaleMethod(UninterruptableTimeoutClient.class, "serviceTimeoutAsyncBulkhead")
            .autoscaleMethod(UninterruptableTimeoutClient.class, "serviceTimeoutAsyncBulkheadQueueTimed")
            .autoscaleMethod(UninterruptableTimeoutClient.class, "serviceTimeoutAsyncRetry")
            .autoscaleMethod(UninterruptableTimeoutClient.class, "serviceTimeoutAsyncFallback");
            
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "ftTimeoutUninterruptable.jar")
                                    .addClass(UninterruptableTimeoutClient.class)
                                    .addPackage(Packages.UTILS)
                                    .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
                                    .addAsManifestResource(timeoutConfig, "microprofile-config.properties");

    WebArchive testWar = ShrinkWrap.create(WebArchive.class, "ftTimeoutUninterruptable.war")
                                   .addAsLibrary(testJar);

    return testWar;
}
 
Example 6
@Deployment
public static WebArchive deploy() {
    ConfigAnnotationAsset config = new ConfigAnnotationAsset()
            .autoscaleMethod(CircuitBreakerClientWithTimeout.class, "serviceWithTimeout")
            .autoscaleMethod(CircuitBreakerClientWithTimeout.class, "serviceWithTimeoutWithoutFailOn");
    
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "ftCircuitBreakerTimeout.jar")
                                    .addClasses(CircuitBreakerClientWithTimeout.class)
                                    .addPackage(Packages.UTILS)
                                    .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
                                    .addAsManifestResource(config, "microprofile-config.properties");

    WebArchive war = ShrinkWrap.create(WebArchive.class, "ftCircuitBreakerTimeout.war")
                               .addAsLibrary(testJar);
    return war;
}
 
Example 7
@Deployment
public static WebArchive deploy() {
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "ftRetryCondition.jar")
                    .addClasses(RetryClientAbortOn.class, RetryClientRetryOn.class,
                                    RetryClassLevelClientRetryOn.class,
                                    RetryClassLevelClientAbortOn.class,
                                    AsyncCallerExecutor.class,
                                    AsyncCaller.class,
                                    AsyncRetryClient.class,
                                    CompletableFutureHelper.class,
                                    RetryChildException.class,
                                    RetryParentException.class)
                    .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
                    .as(JavaArchive.class);

    WebArchive war = ShrinkWrap
            .create(WebArchive.class, "ftRetryCondition.war")
            .addAsLibrary(testJar);
    return war;
}
 
Example 8
@Deployment
public static WebArchive deploy() {
   Asset config = new DisableConfigAsset()
           .enable(Retry.class)
           .enable(CircuitBreaker.class)
           .enable(Timeout.class)
           .enable(Asynchronous.class)
           .enable(Fallback.class)
           .enable(Bulkhead.class)
           .disableGlobally();

    JavaArchive testJar = ShrinkWrap
        .create(JavaArchive.class, "ftDisableGlobalEnableClass.jar")
        .addClasses(DisableAnnotationClient.class)
        .addPackage(Packages.UTILS)
        .addAsManifestResource(config, "microprofile-config.properties")
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
        .as(JavaArchive.class);

    WebArchive war = ShrinkWrap
        .create(WebArchive.class, "ftDisableGlobalEnableClass.war")
        .addAsLibrary(testJar);
    return war;
}
 
Example 9
@Deployment
public static WebArchive createDeployment() {
    // build a JAR that provides three fake context types: 'Buffer', 'Label', and 'ThreadPriority'
    JavaArchive fakeContextProviders = ShrinkWrap.create(JavaArchive.class, "fakeContextTypes.jar")
            .addPackages(true, "org.eclipse.microprofile.context.tck.contexts.buffer")
            .addPackages(true, "org.eclipse.microprofile.context.tck.contexts.label")
            .addPackage("org.eclipse.microprofile.context.tck.contexts.priority.spi")
            .addAsServiceProvider(ThreadContextProvider.class,
                    BufferContextProvider.class, LabelContextProvider.class, ThreadPriorityContextProvider.class);

    return ShrinkWrap.create(WebArchive.class, MPConfigTest.class.getSimpleName() + ".war")
            .addClass(MPConfigBean.class)
            .addClass(MPConfigTest.class)
            .addClass(ProducerBean.class)
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(new StringAsset(
                            "mp.context.ManagedExecutor.maxAsync=1\n" +
                                    "mp.context.ManagedExecutor.maxQueued=4\n" +
                                    "mp.context.ManagedExecutor.propagated=Label,ThreadPriority\n" +
                                    "mp.context.ManagedExecutor.cleared=Remaining\n" +
                                    "mp.context.ThreadContext.cleared=Buffer\n" +
                                    "mp.context.ThreadContext.propagated=\n" +
                                    "mp.context.ThreadContext.unchanged=Remaining"),
                    "classes/META-INF/microprofile-config.properties")
            .addAsLibraries(fakeContextProviders);
}
 
Example 10
@Deployment
public static WebArchive create() {
    ConfigAnnotationAsset config = new ConfigAnnotationAsset()
        .set(TimeoutConfigBean.class, "serviceValue", Timeout.class, "value",
            TCKConfig.getConfig().getTimeoutInStr(1000))
        // only changing value here to scale the original, not for the purpose of this test
        .set(TimeoutConfigBean.class, "serviceUnit", Timeout.class, "value",
            TCKConfig.getConfig().getTimeoutInStr(1000))
        .set(TimeoutConfigBean.class, "serviceUnit", Timeout.class, "unit", "MILLIS")
        .set(TimeoutConfigBean.class, "serviceBoth", Timeout.class, "value",
            TCKConfig.getConfig().getTimeoutInStr(1000))
        .set(TimeoutConfigBean.class, "serviceBoth", Timeout.class, "unit", "MILLIS");

    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "ftTimeoutConfig.jar")
        .addClasses(TimeoutConfigBean.class, CompletableFutureHelper.class)
        .addPackage(Packages.UTILS)
        .addAsManifestResource(config, "microprofile-config.properties")
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

    return ShrinkWrap.create(WebArchive.class, "ftTimeoutConfig.war")
        .addAsLibrary(jar);
}
 
Example 11
@Deployment
public static WebArchive createDeployment() {
    String urlProperty = "queryParamStyle/mp-rest/uri=http://localhost:8080/stub";
    String filterProperty = "queryParamStyle/mp-rest/providers=" + ReturnWithURLRequestFilter.class.getName();
    String multiPairsProperty = MultiPairsStringClient.class.getName()
        + "/mp-rest/queryParamStyle=MULTI_PAIRS";
    String commaSeparatedProperty = CommaSeparatedStringClient.class.getName()
        + "/mp-rest/queryParamStyle=COMMA_SEPARATED";
    String arrayPairsProperty = ArrayPairsStringClient.class.getName()
        + "/mp-rest/queryParamStyle=ARRAY_PAIRS";
    String simpleName = CDIQueryParamStyleTest.class.getSimpleName();
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, simpleName + ".jar")
        .addClasses(StringClient.class, ReturnWithURLRequestFilter.class, QueryParamStyleTest.class)
        .addAsManifestResource(new StringAsset(String.format(filterProperty + "%n" 
                                                           + urlProperty + "%n"
                                                           + multiPairsProperty + "%n"
                                                           + commaSeparatedProperty + "%n"
                                                           + arrayPairsProperty + "%n")),
                                               "microprofile-config.properties")
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    return ShrinkWrap.create(WebArchive.class, simpleName + ".war")
        .addAsLibrary(jar)
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
Example 12
Source Project: ConfigJSR   Source File: CustomConfigSourceTest.java    License: Apache License 2.0 6 votes vote down vote up
@Deployment
public static WebArchive deploy() {
    JavaArchive testJar = ShrinkWrap
            .create(JavaArchive.class, "customConfigSourceTest.jar")
            .addClasses(CustomConfigSourceTest.class, CustomDbConfigSource.class, CustomConfigSourceProvider.class)
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsServiceProvider(ConfigSource.class, CustomDbConfigSource.class)
            .addAsServiceProvider(ConfigSourceProvider.class, CustomConfigSourceProvider.class)
            .as(JavaArchive.class);

    addFile(testJar, "META-INF/javaconfig.properties");

    WebArchive war = ShrinkWrap
            .create(WebArchive.class, "customConfigSourceTest.war")
            .addAsLibrary(testJar);
    return war;
}
 
Example 13
@Deployment
public static WebArchive createDeployment() {
    WebArchive webArchive = ShrinkWrap.create(WebArchive.class, 
                                              BasicReactiveStreamsTest.class.getSimpleName() + ".war")
            .addClasses(AbstractSseTest.class,
                        BasicReactiveStreamsTest.class,
                        HttpSseServer.class,
                        MyEventSource.class,
                        MyEventSourceServlet.class,
                        RsSseClient.class,
                        RsWeatherEventClient.class,
                        WeatherEvent.class,
                        WeatherEventProvider.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");

    return webArchive;
}
 
Example 14
@Deployment
public static WebArchive create() {
    ConfigAnnotationAsset config = new ConfigAnnotationAsset();
    config.setGlobally(Fallback.class, "applyOn", TestConfigExceptionA.class.getCanonicalName());
    
    JavaArchive jar = ShrinkWrap
            .create(JavaArchive.class, "ftFallbackApplyOnConfigTest.jar")
            .addPackage(FallbackConfigTest.class.getPackage())
            .addPackage(Packages.UTILS)
            .addAsManifestResource(config, "microprofile-config.properties")
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    
    WebArchive war = ShrinkWrap
            .create(WebArchive.class, "ftFallbackApplyOnConfigTest.war")
            .addAsLibraries(jar);
    return war;
}
 
Example 15
Source Project: microprofile-jwt-auth   Source File: ServletTest.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Create a CDI aware base web application archive
 * @return the base base web application archive
 * @throws IOException - on resource failure
 */
@Deployment(testable=true)
public static WebArchive createDeployment() throws IOException {
    URL publicKey = ServletTest.class.getResource("/publicKey.pem");
    WebArchive webArchive = ShrinkWrap
        .create(WebArchive.class, "ServletTest.war")
        .addAsManifestResource(new StringAsset(MpJwtTestVersion.MPJWT_V_1_0.name()), MpJwtTestVersion.MANIFEST_NAME)
        .addAsResource(publicKey, "/publicKey.pem")
        .addClass(EjbEndpoint.class)
        .addClass(ServiceServlet.class)
        .addClass(IService.class)
        .addClass(ServiceEJB.class)
        .addClass(TCKApplication.class)
        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
        ;
    System.out.printf("WebArchive: %s\n", webArchive.toString(true));
    return webArchive;
}
 
Example 16
@Deployment
public static WebArchive deployAnotherApp() {
    JavaArchive testJar = ShrinkWrap
        .create(JavaArchive.class, "ftConfig.jar")
        .addClasses(BeanWithRetry.class)
        .addAsManifestResource(new StringAsset(
            "org.eclipse.microprofile.fault.tolerance.tck.config.BeanWithRetry/Retry/maxRetries=5" +
                "\nRetry/maxRetries=7"), "microprofile-config.properties")
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
        .as(JavaArchive.class);

    WebArchive war = ShrinkWrap
        .create(WebArchive.class, "ftConfigTest.war")
        .addAsLibrary(testJar);
    return war;
}
 
Example 17
Source Project: microprofile-jwt-auth   Source File: EjbTest.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Create a CDI aware base web application archive
 * @return the base base web application archive
 * @throws IOException - on resource failure
 */
@Deployment(testable=true)
public static WebArchive createDeployment() throws IOException {
    URL publicKey = EjbTest.class.getResource("/publicKey.pem");
    WebArchive webArchive = ShrinkWrap
        .create(WebArchive.class, "EjbTest.war")
        .addAsManifestResource(new StringAsset(MpJwtTestVersion.MPJWT_V_1_0.name()), MpJwtTestVersion.MANIFEST_NAME)
        .addAsResource(publicKey, "/publicKey.pem")
        .addClass(EjbEndpoint.class)
        .addClass(IService.class)
        .addClass(ServiceEJB.class)
        .addClass(TCKApplication.class)
        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
        ;
    System.out.printf("WebArchive: %s\n", webArchive.toString(true));
    return webArchive;
}
 
Example 18
@Deployment
public static WebArchive deployAnotherApp() {
    JavaArchive testJar = ShrinkWrap
        .create(JavaArchive.class, "ftConfig.jar")
        .addClasses(BeanWithRetry.class)
        .addAsManifestResource(new StringAsset(
            "org.eclipse.microprofile.fault.tolerance.tck.config.BeanWithRetry/Retry/maxRetries=5" +
                "\norg.eclipse.microprofile.fault.tolerance.tck.config.BeanWithRetry/triggerException/Retry/maxRetries=6" +
                "\nRetry/maxRetries=7"), "microprofile-config.properties")
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
        .as(JavaArchive.class);

    WebArchive war = ShrinkWrap
        .create(WebArchive.class, "ftConfigTest.war")
        .addAsLibrary(testJar);
    return war;
}
 
Example 19
Source Project: microprofile-graphql   Source File: DeployableUnit.java    License: Apache License 2.0 5 votes vote down vote up
public static Archive<?> getDeployment(String unitName) throws Exception {
    return ShrinkWrap.create(WebArchive.class, unitName + ".war")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsManifestResource(
                    new StringAsset(getPropertyAsString()),
                    "microprofile-config.properties")
            .addPackage(HeroFinder.class.getPackage())
            .addPackage(HeroDatabase.class.getPackage())
            .addPackage(SuperHero.class.getPackage())
            .addPackage(ScalarTestApi.class.getPackage());
}
 
Example 20
@Deployment
public static WebArchive deploy() {
    JavaArchive testJar = ShrinkWrap
            .create(JavaArchive.class, "ftBulkheadLifecycle.jar")
            .addPackage(BulkheadLifecycleService1.class.getPackage())
            .addPackage(AsyncCaller.class.getPackage())
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
            .as(JavaArchive.class);

    return ShrinkWrap
            .create(WebArchive.class, "ftBulkheadLifecycle.war")
            .addAsLibrary(testJar);
}
 
Example 21
@Deployment
static Archive<?> createTestArchive() {
    return ShrinkWrap.create(WebArchive.class)
        // Test bean
        .addClasses(ConcreteTimedBean.class, AbstractGenericBean.class)
        // Bean archive deployment descriptor
        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
Example 22
@Deployment
static Archive<?> createTestArchive() {
    return ShrinkWrap.create(WebArchive.class)
            // Test bean
            .addClasses(OverloadedTimedMethodBean.class, MetricsUtil.class)
            // Bean archive deployment descriptor
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
Example 23
@Deployment
public static JavaArchive tckDeployment() {
    return ShrinkWrap.create(JavaArchive.class)
        // Add everything from the TCK
        .addPackages(true, ReactiveStreamsTck.class.getPackage())
        // And add the reactive streams TCK
        .addPackages(true, TestEnvironment.class.getPackage())
        .addPackages(true, AsyncIterablePublisher.class.getPackage())
        // And we need a CDI descriptor
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

}
 
Example 24
@Deployment
public static WebArchive create() {
    ConfigAnnotationAsset config = new ConfigAnnotationAsset()
        .set(CircuitBreakerConfigBean.class, "skipOnMethod", CircuitBreaker.class,
            "skipOn", TestConfigExceptionA.class.getName())
        .set(CircuitBreakerConfigBean.class, "failOnMethod", CircuitBreaker.class,
            "failOn", TestConfigExceptionA.class.getName())
        .set(CircuitBreakerConfigBean.class, "delayMethod", CircuitBreaker.class,
            "delay", TCKConfig.getConfig().getTimeoutInStr(1000))
        .set(CircuitBreakerConfigBean.class, "delayMethod", CircuitBreaker.class,
            "delayUnit", "MILLIS")
        .set(CircuitBreakerConfigBean.class, "requestVolumeThresholdMethod", CircuitBreaker.class,
            "requestVolumeThreshold", "4")
        .set(CircuitBreakerConfigBean.class, "failureRatioMethod", CircuitBreaker.class,
            "failureRatio","0.8")
        .set(CircuitBreakerConfigBean.class, "successThresholdMethod", CircuitBreaker.class,
            "successThreshold", "2")
        // only changing value here to scale the original, not for the purpose of this test
        .set(CircuitBreakerConfigBean.class, "successThresholdMethod", CircuitBreaker.class,
            "delay", TCKConfig.getConfig().getTimeoutInStr(1000));

    JavaArchive jar = ShrinkWrap
            .create(JavaArchive.class, "ftCircuitBreakerConfig.jar")
            .addClasses(CircuitBreakerConfigBean.class, TestConfigExceptionA.class, TestConfigExceptionB.class)
            .addPackage(Packages.UTILS)
            .addAsManifestResource(config, "microprofile-config.properties")
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

    return ShrinkWrap
            .create(WebArchive.class, "ftCircuitBreakerConfig.war")
            .addAsLibraries(jar);
}
 
Example 25
@Deployment
static Archive<?> createTestArchive() {
    return ShrinkWrap.create(WebArchive.class)
        // Test bean
        .addClass(TimedMethodBean1.class)
        .addClass(TestUtils.class)
        // Bean archive deployment descriptor
        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
Example 26
@Deployment
@ShouldThrowException(value = FaultToleranceDefinitionException.class)
public static WebArchive deploy() {
    JavaArchive testJar = ShrinkWrap
        .create(JavaArchive.class, "ftInvalid.jar")
        .addClasses(FallbackClient.class, IncompatibleFallbackHandler.class)
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
        .as(JavaArchive.class);

    return ShrinkWrap
        .create(WebArchive.class, "ftInvalidFallbackHandler.war")
        .addAsLibrary(testJar);
}
 
Example 27
private static WebArchive createArchive(Class<?> resourceClass) {
    String archiveName = resourceClass.getSimpleName();
    return ShrinkWrap
        .create(WebArchive.class, archiveName + ".war")
        .addClasses(resourceClass, JaxRsActivator.class)
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
Example 28
@Deployment
public static WebArchive deploy() {
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "ftFallbackMethodGenericComplex.jar")
            .addClasses(FallbackMethodGenericComplexBeanA.class, FallbackMethodGenericComplexBeanB.class)
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    
    WebArchive war = ShrinkWrap
            .create(WebArchive.class, "ftFallbackMethodGenericComplex.war")
            .addAsLibrary(testJar);
    return war;
}
 
Example 29
@Deployment
static Archive<?> createTestArchive() {
    return ShrinkWrap.create(WebArchive.class)
        // Test bean
        .addClasses(SimpleTimerTagFieldBean.class, MetricsUtil.class)
        // Bean archive deployment descriptor
        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
Example 30
@Deployment
@ShouldThrowException(value = FaultToleranceDefinitionException.class)
public static WebArchive deploy() {
    JavaArchive testJar = ShrinkWrap
        .create(JavaArchive.class, "ftInvalidCB3.jar")
        .addClasses(CircuitBreakerClientForValidationFailureRatioNeg.class)
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
        .as(JavaArchive.class);

    return ShrinkWrap
        .create(WebArchive.class, "ftInvalidCB3.war")
        .addAsLibrary(testJar);
}