Skip to content

Commit

Permalink
ARQ-1658 Wrong isInstance check prevents usage of custom container
Browse files Browse the repository at this point in the history
  • Loading branch information
sebplorenz authored and Stefan Miklosovic committed Feb 25, 2014
1 parent f96c6e7 commit 5a51e61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Expand Up @@ -151,7 +151,7 @@ public static boolean hasAdapterImplClassProperty(ContainerDef containerDef) {
}

public static String getAdapterImplClassValue(ContainerDef containerDef) {
return containerDef.getContainerProperties().get(ADAPTER_IMPL_CONFIG_STRING);
return containerDef.getContainerProperties().get(ADAPTER_IMPL_CONFIG_STRING).trim();
}

}
Expand Up @@ -138,8 +138,8 @@ private boolean isCreatingContainer(ContainerDef containerDef, Collection<Deploy
// and we check that the class is an instance of DeployableContainer
if (ContainerGuesser.hasAdapterImplClassProperty(containerDef)) {
if (SecurityActions.isClassPresent(ContainerGuesser.getAdapterImplClassValue(containerDef))) {
return SecurityActions.loadClass(ContainerGuesser.getAdapterImplClassValue(containerDef)).isInstance(
DeployableContainer.class);
return DeployableContainer.class.isAssignableFrom(
SecurityActions.loadClass(ContainerGuesser.getAdapterImplClassValue(containerDef)));
}
}

Expand All @@ -150,10 +150,10 @@ private boolean isCreatingContainer(ContainerDef containerDef, Collection<Deploy
+ "It is expected that when you name your container like that, you put Arquillian container adapter for that "
+ "container on classpath in order to start it afterwards.",
new Object[] {
containerDef.getContainerName(),
ContainerGuesser.ADAPTER_IMPL_CONFIG_STRING,
ContainerType.getAll()
});
containerDef.getContainerName(),
ContainerGuesser.ADAPTER_IMPL_CONFIG_STRING,
ContainerType.getAll()
});

return false;
}
Expand Down

0 comments on commit 5a51e61

Please sign in to comment.