Java Code Examples for org.jboss.arquillian.api.Deployment

The following are top voted examples for showing how to use org.jboss.arquillian.api.Deployment. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to product more good examples.

Example 1
Project: arquillian-showcase   File: SimpleOSGiServiceTestCase.java View source code 6 votes vote down vote up
@Deployment
public static JavaArchive createdeployment()
{
   final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test.jar");
   archive.setManifest(new Asset()
   {
      public InputStream openStream()
      {
         OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
         builder.addBundleSymbolicName(archive.getName());
         builder.addBundleManifestVersion(2);
         builder.addBundleActivator(SimpleActivator.class.getName());
         // [TODO] generate a separate bundle the contains the test case
         builder.addExportPackages(SimpleOSGiServiceTestCase.class);
         builder.addImportPackages("org.jboss.arquillian.junit");
         builder.addImportPackages("org.jboss.shrinkwrap.api", "org.jboss.shrinkwrap.api.asset", "org.jboss.shrinkwrap.api.spec");
         builder.addImportPackages("javax.inject", "org.junit", "org.junit.runner");
         return builder.openStream();
      }
   });
   archive.addClasses(SimpleActivator.class, SimpleService.class);
   archive.addClasses(SimpleOSGiServiceTestCase.class);
   return archive;
}
 
Example 2
Project: compatibility   File: VisibilityOfBeanRegisteredByExtensionFromNonBeanLibraryTest.java View source code 6 votes vote down vote up
@Deployment
public static Archive<?> createTestArchive() {
    // Our non-bean archive
    JavaArchive jar1 = ShrinkWrap.create(JavaArchive.class, "a.jar").addClasses(BeanClassToRegister.class);

    // Our non-bean archive with an extension that programmatically registers two beans
    JavaArchive jar2 = ShrinkWrap
            .create(JavaArchive.class, "b.jar")
            .addClasses(AnotherBeanClassToRegister.class, ManualBeanRegistrationExtension.class,
                    AnotherManualBeanRegistrationExtension.class)
            .addAsServiceProvider(Extension.class, ManualBeanRegistrationExtension.class,
                    AnotherManualBeanRegistrationExtension.class);

    // Web archive is necessary so that Arquillian can find the BeanManager
    return ShrinkWrap.create(WebArchive.class, "test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsLibraries(jar1, jar2);
}
 
Example 3
Project: seam-mvc   File: MVCTest.java View source code 6 votes vote down vote up
@Deployment
public static WebArchive createTestArchive()
{
   WebArchive deployment = ShrinkWrap.create(WebArchive.class, "test.jar")
            .addAsLibraries(resolveDependencies("org.jboss.seam.solder:seam-solder:3.0.0.Final"))
            .addPackages(true, Root.class.getPackage())
            .addPackages(true, org.jboss.seam.render.Root.class.getPackage())
            .addAsManifestResource(new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml"))
            .addAsManifestResource("META-INF/services/org.jboss.seam.solder.beanManager.BeanManagerProvider");

   return deployment;
}
 
Example 4
Project: arquillian_deprecated   File: JBossASIntegrationTestCase.java View source code 6 votes vote down vote up
@Deployment
public static JavaArchive createDeployment() throws Exception 
{
   return ShrinkWrap.create(JavaArchive.class, "test.jar")
            .addClasses(
                  JBossASIntegrationTestCase.class,
                  MyEjb.class, MyEjbBean.class);
}
 
Example 5
Project: goodstuff-example   File: AppTest.java View source code 6 votes vote down vote up
@Deployment
public static JavaArchive createDeployment()
{
   return ShrinkWrap.create(JavaArchive.class, "test.jar").addClasses(
         GoodStuff.class, Good.class, EntityManagerProducer.class,
         EntityManagerWrapper.class).
         addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
Example 6
Project: arquillian-weld-embedded-1.1   File: WeldEmbeddedIntegrationConversationScopeTestCase.java View source code 6 votes vote down vote up
@Deployment
public static JavaArchive createdeployment() 
{
   return ShrinkWrap.create(JavaArchive.class, "test.jar")
               .addClasses(
                     WeldEmbeddedIntegrationConversationScopeTestCase.class,
                     TalkingChicken.class)
               .addManifestResource(
                     new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml"));
}
 
Example 7
Project: oreilly-ejb-6thedition-book-examples   File: StatusUpdateIntegrationTest.java View source code 6 votes vote down vote up
/**
 * Creates the EJB JAR to be deployed into the server via Arquillian
 * @return
 */
@Deployment
public static JavaArchive getDeployment()
{
   final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, NAME_MDB_ARCHIVE).addClasses(StatusUpdate.class,
         StatusUpdateConstants.class, LoggingStatusUpdateMdb.class, StatusUpdateBeanBase.class,
         TwitterUpdateBlockingTestMdb.class, SecurityActions.class, TwitterUpdateMdb.class,
         EnvironmentSpecificTwitterClientUtil.class).addResource(NAME_RESOURCE_TOPIC_DEPLOYMENT);
   log.info(archive.toString(true));
   return archive;
}
 
Example 8
Project: jbosgi-container   File: SimpleArquillianTestCase.java View source code 6 votes vote down vote up
@Deployment
public static JavaArchive createdeployment()
{
   final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test.jar");
   archive.setManifest(new Asset()
   {
      public InputStream openStream()
      {
         OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
         builder.addBundleSymbolicName(archive.getName());
         builder.addBundleManifestVersion(2);
         builder.addBundleActivator(SimpleActivator.class.getName());
         builder.addExportPackages(SimpleArquillianTestCase.class);
         builder.addImportPackages("org.jboss.arquillian.junit");
         builder.addImportPackages("org.jboss.shrinkwrap.api", "org.jboss.shrinkwrap.api.asset", "org.jboss.shrinkwrap.api.spec");
         builder.addImportPackages("javax.inject", "org.junit", "org.junit.runner");
         builder.addImportPackages("org.osgi.framework");
         return builder.openStream();
      }
   });
   archive.addClasses(SimpleActivator.class, SimpleService.class);
   archive.addClasses(SimpleArquillianTestCase.class);
   return archive;
}
 
Example 9
Project: managed-bean   File: ManagedBeanWarDeploymentJNDIAccessTestCase.java View source code 6 votes vote down vote up
@Deployment
public static WebArchive createDeployment() throws Exception
{
   WebArchive war = ShrinkWrap.create(WebArchive.class, MODULE_NAME + ".war").addPackage(ManagedBeanWarDeploymentJNDIAccessTestCase.class.getPackage());
   // for the sake of debugging (if necessary) after the tests complete
   writeToFileSystem(war);
   return war;
}
 
Example 10
Project: jsfunit   File: FormAuthenticationTest.java View source code 6 votes vote down vote up
@Deployment
public static WebArchive createDeployment() {
   WebArchive webArchive = Deployments.createCDIDeployment();
   webArchive.setWebXML(new File("src/main/webapp/WEB-INF/formauth-web.xml"))
             .addAsWebResource(new File("src/main/webapp", "form-secured-page.xhtml"))
             .addAsWebResource(new File("src/main/webapp", "login.xhtml"))
             .addAsWebResource(new File("src/main/webapp", "error.xhtml"));
   return webArchive;
}
 
Example 11
Project: jms   File: ActiveMQConnectionFactoryProducerTest.java View source code 6 votes vote down vote up
@Deployment
public static Archive<?> createDeployment() {
    return ShrinkWrap.create(JavaArchive.class, "test.jar")
    		.addAsManifestResource(EmptyAsset.INSTANCE,"beans.xml")
    		.addPackage(JmsConnectionFactoryProducer.class.getPackage())
    		.addPackage(EventRouting.class.getPackage())
    		.addClasses(ActiveMQConnectionFactoryProducer.class, 
    				MessageManager.class,MessageManagerImpl.class,
    				ContextProducer.class, DestinationProducer.class,
    				MessagePubSubProducer.class);
    				
}
 
Example 12
Project: jboss-ejb3-async   File: AsyncExecutorServiceDeployerTestCase.java View source code 6 votes vote down vote up
/**
 * The deployment containing the deployer chain under test
 */
@Deployment
public static JavaArchive createDeployment()
{
   final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "async-deployer.jar").addPackage(
         AsyncExecutorServiceDeployer.class.getPackage())
         .addResource("META-INF/ejb3-async-deployer-jboss-beans.xml").addManifestResource(
               "ejb3-async-mock-deployer-jboss-beans.xml").addClasses(MockEjb3MetaData.class,
               MockEjb3MetaDataDeployer.class);
   log.info(archive.toString(true));
   return archive;
}
 
Example 13
Project: solder-old   File: ResourceLoaderTest.java View source code 6 votes vote down vote up
@Deployment
public static Archive<?> deployment()
{
   return baseDeployment().addPackage(ResourceLoaderTest.class.getPackage())
      .addResource("com/acme/foo1")
      .addResource("com/acme/foo2.properties");
}
 
Example 14
Project: seam-forge   File: ResourceProducerExtensionTest.java View source code 6 votes vote down vote up
@Deployment
public static JavaArchive getDeployment()
{
   return AbstractShellTest.getDeployment()
            .addManifestResource("META-INF/services/javax.enterprise.inject.spi.Extension")
            .addClass(ResourceProducerExtension.class)
            .addClass(ResourceProducer.class)
            .addClass(MockResourceInjectionPlugin.class);
}
 
Example 15
Project: ocpsoft-socialpm   File: UserServiceTest.java View source code 6 votes vote down vote up
@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"));
}
 
Example 16
Project: bullsfirst-server-java   File: SecurityTxnServiceTest.java View source code 6 votes vote down vote up
@Deployment
public static WebArchive createTestArchive() {
    WebArchive archive = ShrinkWrap
        .create(WebArchive.class, "test.war")
        .addPackage(SecurityTxnService.class.getPackage())
        .addPackage(SecurityService.class.getPackage())
        .addPackage(DomainEntity.class.getPackage())
        .addPackage(Mapper.class.getPackage())
        .addManifestResource("test-persistence.xml", "persistence.xml")
        .addWebResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
    return archive;
}
 
Example 17
Project: methodvalidation-integration   File: CdiMethodValidationTest.java View source code 6 votes vote down vote up
@Deployment
public static JavaArchive createTestArchive() throws Exception {
	return ShrinkWrap
		.create(JavaArchive.class, "test.jar")
		.addManifestResource("beans.xml", ArchivePaths.create("beans.xml"))
		.addPackage(MovieRepository.class.getPackage())
		.addPackage(ValidationInterceptor.class.getPackage())
		.addPackage(Movie.class.getPackage());
}
 
Example 18
Project: arquillian-container-glassfish   File: GlassFishJSR88RemoteContainerEARTestCase.java View source code 6 votes vote down vote up
/**
 * Deployment for the test
 * @return
 */
@Deployment
public static Archive<?> getTestArchive()
{
   final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
         .addClasses(GreeterServlet.class);
   final JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, "test.jar")
         .addClass(Greeter.class);
   final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
         .setApplicationXML("application.xml")
         .addModule(war)
         .addModule(ejb);
   log.info(ear.toString(true));
   return ear;
}
 
Example 19
Project: Magazzino   File: CustomerAgentTest.java View source code 6 votes vote down vote up
@Deployment
public static WebArchive createDeployment() {
	WebArchive war = ShrinkWrap
			.create(WebArchive.class, "test.war")
			.addClass(CustomerAgentTest.class)
			.addClasses(Data.class, ListDataMock.class,
					ListDataOperation.class)
			.addClasses(ImageMock.class, ImageOperation.class)
			.addClasses(DataContainer.class, FileUpload.class)
			.addClasses(AddressMock.class, AddressOperation.class,
					Address.class)
			.addClasses(CustomerMock.class, CustomerOperation.class,
					Customer.class)
			.addClasses(CustomerRegister.class, CustomerUpdater.class,
					CustomerDeleter.class, CustomerSelection.class)
			.addClasses(CustomerLog.class, CustomerLog_$logger.class, Customer_.class)
			.addClasses(CustomerSearch.class, CustomerAllSearch.class,
					SearchCriteria.class)
			.addClasses(DataContainer.class, FileUpload.class)
			.addClasses(DefaultBundleKey.class)
			.addClasses(Magazzino.class)
			.addClasses(Receipt.class)
			.addAsLibraries(SOLDER)
			.addAsLibraries(INTERNATIONAL)
			.addAsLibraries(FACES)
			.addAsLibraries(RICHFACES)
			.addAsResource("logo.gif")
			.addAsWebInfResource("test-web.xml", "web.xml")
			.addAsWebInfResource("test-persistence.xml",
					"classes/META-INF/persistence.xml")
			.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
	System.out.println(war.toString(true));
	return war;
}
 
Example 20
Project: scripting-extension   File: ScriptingExtensionTest.java View source code 6 votes vote down vote up
@Deployment
public static JavaArchive createTestArchive() throws Exception {
	return 
		ShrinkWrap.create("test.jar", JavaArchive.class)
			.addManifestResource(new File("src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension"))
			.addPackage(ScriptingExtension.class.getPackage())
			.addPackage(Language.class.getPackage());
}