Maven Probleme beim Arquillian Deployen

Ethernut

Mitglied
Hallo liebes Forum,

ich befasse mich seit kurzem mit Arquillian und komme da bei einem Problem nicht weiter. Ich habe das Tutorial von http://arquillian.org/guides/getting_started/ durchgemacht und das Geeter Beispiel ausgeführt.

Bei mir ist es so, dass dieselbe Form des Testens nicht auf mein eigentliches Projekt läuft. Die Klasse die getestet werden soll ist folgende:

  1. @Path("/AUTHENTICATION")
  2. public class AuthEndpoint
  3. {
  4. /**
  5. * the local database that stores the token
  6. */
  7. @Inject
  8. private DatabaseInterface database;
  9. /**
  10. * based on the given uuid this service will return a hashed value that might be used as password
  11. * @param info the information about the device as {@link DeviceInfo}
  12. * @Return the complete device login info as {@link LoginInfo}
  13. */
  14. @POST
  15. @Produces({ "application/json" })
  16. @Consumes({ "application/json" })
  17. @Path("CREATEMOBILELOGIN")
  18. public LoginInfo createMobileLogin(DeviceInfo info)
  19. {
  20. System.err.println();
  21. LoginInfo response = null;
  22. if (info != null && info.getUuid() != null)
  23. {
  24. String password = this.database.registerDevice(info.getUuid());
  25. if (password != null)
  26. {
  27. response = new LoginInfo();
  28. response.setPw(password);
  29. response.setUuid(info.getUuid());
  30. }
  31. }
  32. return response;
  33. }
  34. }
Die Test Klasse:


  1. @RunWith(Arquillian.class)
  2. @RunAsClient
  3. public class AuthTestMyself
  4. {
  5. @Deployment
  6. public static JavaArchive createDeployment()
  7. {
  8. return ShrinkWrap.create(JavaArchive.class)
  9. .addClass(AuthEndpoint.class)
  10. .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
  11. }
  12. @Inject
  13. AuthEndpoint authEndpoint;
  14. @test
  15. public void registerUUIDTest()
  16. {
  17. String sResponse = null;
  18. final ObjectMapper mapper = new ObjectMapper();
  19. DeviceInfo info = new DeviceInfo();
  20. info.setUuid("myself");
  21. info.setDate("2014-12-12");
  22. LoginInfo resp = null;
  23. final String input = mapper.writeValueAsString(info);
  24. resp = this.authEndpoint.createMobileLogin(info);
  25. Assert.assertEquals("myself", resp.getUuid());
  26. }
  27. }
Mein arquillian.xml ist folgendes:

<?xml version="1.0"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<engine>
<property name="deploymentExportPath">target/deployments</property>
</engine>
<container qualifier="jboss" default="true">
<configuration>
<property name="adminHost">localhost</property>
<property name="adminPort">4848</property>
</configuration>
</container>
</arquillian>

Wenn ich es testen will kommt diese Fehlermeldung:

java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor

Caused by: java.lang.reflect.InvocationTargetException

Caused by: org.jboss.arquillian.container.impl.ContainerCreationException: Could not create Container gf4_managed

Caused by: java.lang.IllegalStateException: Multiple service implementations found for interface org.jboss.arquillian.container.spi.client.container.DeployableContainer. org.jboss.arquillian.container.glassfish.managed_3_1.GlassFishManagedDeployableContainer, org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEEMockContainer

Warum passiert das? Ich glaube, dass iwas im arquillian.xml mit dem pom nicht zusammenpasst...

Ich wäre für jede Hilfe sehr dankbar...ich hab mein pom auch angehängt...

lg Ethernut
 

Anhänge

  • pom.png
    pom.png
    100,8 KB · Aufrufe: 24

Zurück
Oben