[JBoss JIRA] Created: (ARQ-431) ClassNotFoundException on Websphere
by Yves Langisch (JIRA)
ClassNotFoundException on Websphere
-----------------------------------
Key: ARQ-431
URL: https://issues.jboss.org/browse/ARQ-431
Project: Arquillian
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Test Protocol SPIs and Implementation
Affects Versions: 1.0.0.Alpha5
Reporter: Yves Langisch
I'm trying to make the TemperatureConverterTest running as an EAR on my WAS but I always get a ClassNotFoundException for the test class on the server side (test class is not missing in the jar). Relevant snippet from the test class:
...
@Inject
private TemperatureConverter converter;
@Deployment
public static EnterpriseArchive createTestArchive() {
return ShrinkWrap.create(EnterpriseArchive.class, "testConverter.ear")
.addAsModule(
ShrinkWrap.create(JavaArchive.class, "test.jar").
addClass(TemperatureConverterTest.class).
addClass(TemperatureConverter.class));
}
...
ServletTestRunner fails on loading the class:
Class<?> testClass = SecurityActions.getThreadContextClassLoader().loadClass(className);
Looking into the deployed ear I cannot see any reason for this behavior. The strange is that after adding a @EJB (and the relevant ejb classes) to my test the classloader is able to resolve the test class:
...
@EJB
private MyEjbLocal instanceVariable;
...
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 2 months
[JBoss JIRA] Created: (ARQAJO-27) Reduce overusage of static imports
by Karel Piwko (JIRA)
Reduce overusage of static imports
----------------------------------
Key: ARQAJO-27
URL: https://issues.jboss.org/browse/ARQAJO-27
Project: Arquillian Ajocado
Issue Type: Bug
Affects Versions: 1.0.0.Alpha1
Reporter: Karel Piwko
Assignee: Lukas Fryc
It is extremely difficult to follow and read the code overfilled with static imports especially when reading the code without an IDE.
The main reason why static imports exist is to make code more readable not the opposite.
See guideline at http://download.oracle.com/javase/1.5.0/docs/guide/language/static-import...
For instance, see SystemPropertiesConfiguration:
import static org.jboss.arquillian.ajocado.utils.URLUtils.buildUrl; (used twice)
import static java.lang.System.getProperty; (used a lot of time, but I don't consider statically importing System as a good practice either)
import static org.jboss.arquillian.ajocado.utils.PrimitiveUtils.*; (I have no idea what is imported from there, I guess methods like asBoolean(String))
Suggestion:
a getPropertyAs(Class<?> clazz, String value, String default) method can easily encapsulate calls to System.getProperty() and asType wrappers.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 2 months
[JBoss JIRA] Created: (ARQ-428) EOFException on Websphere
by Yves Langisch (JIRA)
EOFException on Websphere
-------------------------
Key: ARQ-428
URL: https://issues.jboss.org/browse/ARQ-428
Project: Arquillian
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Base Implementation
Affects Versions: 1.0.0.Alpha5
Reporter: Yves Langisch
When running tests on a Websphere container (with the WAS module) I often get EOFExceptions on the client side (especially when the test fails). After some debugging on both sides I noticed that whenever I get the EOFException the ObjectInputStream seems to be empty. That's why it fails to read the magic number which is the first unmarshalling action for the TestResult on the client side. So the problem seems to be on the server side.
I think that the issue is in the writeObject method of the ServletTestRunner class. According to the API doc (http://download.oracle.com/javaee/5/api/javax/servlet/http/HttpServletRes...) HttpServletRespone#setStatus may clear the buffer. The marshalling action (writeObject) is done before setting the http status code so (depending on the state of the container buffer) the buffer with the marshalled TestResult may be cleared. That leads to an empty response.
Setting the status code before marshalling the object resolved the issue for me.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 2 months