Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- package org.jboss.arquillian.api;
- import org.jboss.shrinkwrap.api.ShrinkWrap;
- import org.jboss.shrinkwrap.api.spec.JavaArchive;
- import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive;
- /**
- * APITestCase
- *
- * @author <a href="mailto:[email protected]">Aslak Knutsen</a>
- * @version $Revision: $
- */
- @RunWith(Arquillian.class)
- public class APITestCase
- {
- // Deploy on startup a Resource Adaptor
- @Target("frontend-container")
- @Deployment(order = 1) // optional deployment order if multiple startup = true deployments defined
- public static ResourceAdapterArchive createFront()
- {
- return ShrinkWrap.create(ResourceAdapterArchive.class);
- }
- // Deploy on startup a Resource Adaptor Configuration
- @Target("frontend-container")
- @Deployment(order = 2) // optional deployment order if multiple startup = true deployments defined
- public static Descriptor createFrontDescriptor()
- {
- return Descriptors.create(ResourceAdaptorDescriptor.class);
- }
- @Protocol("EJB") // will override default defined protocol and prepare this with the EJB protocol
- @Target("backend-container") // required if multiple active containers, specifies which container to deploy to
- @Deployment(
- name = "backend", // identify the deployment, used to manually deploy using the Deployer API
- startup = false) // do not automatically deploy
- public static JavaArchive createBackend()
- {
- return ShrinkWrap.create(JavaArchive.class);
- }
- @ArquillianResource
- private Deployer deployer;
- @Test // will target the default container
- public void shouldBeExecutedOnTheDefaultContainer()
- {
- deployer.deploy("backend"); // will do a callback to the client and ask it to deploy a named deployment to the deployments target container
- }
- @Target("backend-container") // method will be executed on the backend-container, using the backend-container defined protocol
- @Test
- public void shouldBeExecutedOnTheBackendContainer()
- {
- }
- }
Add Comment
Please, Sign In to add comment