Hello guys,
I am trying to develop a JIRA Gadget, but I am receiving a test error when I try to compile it (atlas-package).
Here follows the error:
------------------------------------------------------- T E S T S ------------------------------------------------------- Running it.com.mlv.atlassian.MyComponentWiredTest SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further detail s. Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.513 sec <<< FA ILURE! it.com.mlv.atlassian.MyComponentWiredTest Time elapsed: 0.512 sec <<< ERROR! org.apache.wink.client.ClientRuntimeException: java.lang.RuntimeException: java. lang.IllegalArgumentException: URI is not absolute at org.apache.wink.client.internal.ResourceImpl.invoke(ResourceImpl.java :240) at org.apache.wink.client.internal.ResourceImpl.invoke(ResourceImpl.java :189) at org.apache.wink.client.internal.ResourceImpl.invokeNoException(Resour ceImpl.java:181) at org.apache.wink.client.internal.ResourceImpl.get(ResourceImpl.java:31 0) at com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner.runViaRest Call(AtlassianPluginsTestRunner.java:103) at com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner.run(Atlass ianPluginsTestRunner.java:75) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provide r.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4 Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider .java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray( ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke (ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(Provi derFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(Fork edBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java: 75) Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: URI i s not absolute at org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.han dle(HttpURLConnectionHandler.java:57) at org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(H andlerContextImpl.java:52) at org.apache.wink.client.internal.handlers.AcceptHeaderHandler.handle(A cceptHeaderHandler.java:79) at org.apache.wink.client.internal.handlers.HandlerContextImpl.doChain(H andlerContextImpl.java:52) at org.apache.wink.client.internal.ResourceImpl.invoke(ResourceImpl.java :227) ... 17 more Caused by: java.lang.IllegalArgumentException: URI is not absolute at java.net.URI.toURL(URI.java:1095) at org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.ope nConnection(HttpURLConnectionHandler.java:112) at org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.pro cessRequest(HttpURLConnectionHandler.java:88) at org.apache.wink.client.internal.handlers.HttpURLConnectionHandler.han dle(HttpURLConnectionHandler.java:54) ... 21 more Running ut.com.mlv.atlassian.MyComponentUnitTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec Results : Tests in error: it.com.mlv.atlassian.MyComponentWiredTest: java.lang.RuntimeException: java.la ng.IllegalArgumentException: URI is not absolute Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
The MyComponentWiresTest class is the one created automatically by the SDK.
Any insights would be greatly apreciated. Ty in advance. :)
Community moderators have prevented the ability to post new answers.
Hi,
I faced the same problem! My solution is to set the system property: baseurl to your jira URL (http://yourjira:port/jira). I just pass it with -D in my run configuration.
In my case I also needed to add a dependency to the UPM-API in order to get the test working:
<dependency> <groupId>com.atlassian.upm</groupId> <artifactId>upm-api</artifactId> <version>2.15.2</version> <scope>test</scope> </dependency>
I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.