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:
<?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
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:
- @Path("/AUTHENTICATION")
- public class AuthEndpoint
- {
- /**
- * the local database that stores the token
- */
- @Inject
- private DatabaseInterface database;
- /**
- * based on the given uuid this service will return a hashed value that might be used as password
- * @param info the information about the device as {@link DeviceInfo}
- * @Return the complete device login info as {@link LoginInfo}
- */
- @POST
- @Produces({ "application/json" })
- @Consumes({ "application/json" })
- @Path("CREATEMOBILELOGIN")
- public LoginInfo createMobileLogin(DeviceInfo info)
- {
- System.err.println();
- LoginInfo response = null;
- if (info != null && info.getUuid() != null)
- {
- String password = this.database.registerDevice(info.getUuid());
- if (password != null)
- {
- response = new LoginInfo();
- response.setPw(password);
- response.setUuid(info.getUuid());
- }
- }
- return response;
- }
- }
- @RunWith(Arquillian.class)
- @RunAsClient
- public class AuthTestMyself
- {
- @Deployment
- public static JavaArchive createDeployment()
- {
- return ShrinkWrap.create(JavaArchive.class)
- .addClass(AuthEndpoint.class)
- .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
- }
- @Inject
- AuthEndpoint authEndpoint;
- @test
- public void registerUUIDTest()
- {
- String sResponse = null;
- final ObjectMapper mapper = new ObjectMapper();
- DeviceInfo info = new DeviceInfo();
- info.setUuid("myself");
- info.setDate("2014-12-12");
- LoginInfo resp = null;
- final String input = mapper.writeValueAsString(info);
- resp = this.authEndpoint.createMobileLogin(info);
- Assert.assertEquals("myself", resp.getUuid());
- }
- }
<?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