[
https://issues.jboss.org/browse/ARQGRA-374?page=com.atlassian.jira.plugin...
]
Lukáš Fryč edited comment on ARQGRA-374 at 11/8/13 8:04 AM:
------------------------------------------------------------
As a workaround, you can use custom URLResourceProvider that you will override original
URLResourceProvider in Arquillian extension builder, e.g.:
{code:java}
public class CustomURLResourceProvider extends URLResourceProvider {
@Override
public boolean canProvide(Class<?> type) {
return super.canProvide(type);
}
@Override
public Object lookup(ArquillianResource resource, Annotation... qualifiers) {
URL url = (URL) super.lookup(resource, qualifiers);
try {
return new URL(url.getProtocol(), "another_host", url.getPort(),
url.getFile());
} catch (MalformedURLException e) {
throw new IllegalStateException(e);
}
}
}
{code}
{code:java}
public class CustomURLResourceProviderExtension implements LoadableExtension {
@Override
public void register(ExtensionBuilder builder) {
builder.override(ResourceProvider.class, URLResourceProvider.class,
CustomURLResourceProvider.class);
}
}
{code}
Don't forget to register this {{LoadableExtension}} in {{META-INF/services}}.
was (Author: lfryc):
As a workaround, you can use custom URLResourceProvider that you will override
original URLResourceProvider in Arquillian extension builder, e.g.:
{code:java}
public class BackChannel extends URLResourceProvider {
@Override
public boolean canProvide(Class<?> type) {
return super.canProvide(type);
}
@Override
public Object lookup(ArquillianResource resource, Annotation... qualifiers) {
URL url = (URL) super.lookup(resource, qualifiers);
try {
return new URL(url.getProtocol(), "192.168.15.104", url.getPort(),
url.getFile());
} catch (MalformedURLException e) {
throw new IllegalStateException(e);
}
}
}
{code}
{code:java}
public class BackChannelExtension implements LoadableExtension {
@Override
public void register(ExtensionBuilder builder) {
builder.override(ResourceProvider.class, URLResourceProvider.class,
BackChannel.class);
}
}
{code}
Don't forget to register this {{LoadableExtension}} in {{META-INF/services}}.
Allow to setup custom URL via arquillian.xml configuration with
CustmizableURLResourceProvider
----------------------------------------------------------------------------------------------
Key: ARQGRA-374
URL:
https://issues.jboss.org/browse/ARQGRA-374
Project: Arquillian Graphene
Issue Type: Feature Request
Reporter: Lukáš Fryč
Fix For: 2.1-Tracking
{code:xml}
<arquillian>
<extension name="graphene">
<property name="url">http://localhost:8080/app/</property>
</extension>
</arquillian>
{code}
The provider will obtain URL from {{URLResourceProvider}} and use it if no other URL is
provided.
Configuring this provider should also block deploying application, since its unnecessary.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira