Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RunWith(Arquillian.class)
- public class UserResourceTest {
- @ArquillianResource
- private URL deploymentURL;
- private UserResource userResource;
- @Deployment
- public static WebArchive create() {
- WebArchive war = ShrinkWrap.create(WebArchive.class, "Test.war")
- .addPackage(UserResource.class.getPackage())
- .addClasses(UserResource.class)
- .addAsResource("test-persistance.xml", "META-INF/persistence.xml")
- .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
- return war;
- }
- /**
- * Sets up the test environment.
- */
- @BeforeClass
- public static void setUpClass() {
- // initializes the rest easy client framework
- RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
- }
- /**
- * Sets up class.
- */
- @Before
- public void setUp() {
- System.err.println("Insde setUp");
- userResource = ProxyFactory.create(UserResource.class, deploymentURL + "user");
- System.err.println("userResource "+userResource);
- }
- @Test
- @RunAsClient
- public final void testLoginUser(@ArquillianResteasyResource UserResource userResource1) throws ApplicationException {
- System.err.println("Login Got userResource ["
- + userResource1 + "] and this ["+this.userResource+"]");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement