Author: heiko.braun(a)jboss.com
Date: 2008-02-26 05:29:53 -0500 (Tue, 26 Feb 2008)
New Revision: 5805
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/TestEndpointImpl.java
Log:
Remove NPE from test case. It hides the actual assertion
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/TestEndpointImpl.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/TestEndpointImpl.java 2008-02-25
20:32:13 UTC (rev 5804)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/jbws1124/TestEndpointImpl.java 2008-02-26
10:29:53 UTC (rev 5805)
@@ -36,23 +36,32 @@
public class TestEndpointImpl implements TestEndpoint
{
private Logger log = Logger.getLogger(TestEndpointImpl.class);
+ private static final String WEB_INF_TEST_RESOURCE_TXT =
"WEB-INF/test-resource.txt";
-
public String getResourceString() throws RemoteException
{
- try
- {
- InputStream ins =
getClass().getClassLoader().getResourceAsStream("WEB-INF/test-resource.txt");
- String line = new BufferedReader(new InputStreamReader(ins)).readLine();
-
- log.info(line);
-
- return line;
- }
- catch (IOException ex)
- {
- throw new WSException(ex);
- }
+
+ ClassLoader loader = getClass().getClassLoader();
+ InputStream ins = loader.getResourceAsStream(WEB_INF_TEST_RESOURCE_TXT);
+
+ if(ins!=null)
+ {
+ try
+ {
+ String line = new BufferedReader(new InputStreamReader(ins)).readLine();
+ log.info(line);
+ return line;
+ }
+ catch (IOException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+ else
+ {
+ throw new WSException("Failed to load
'"+WEB_INF_TEST_RESOURCE_TXT+"' with loader " + loader);
+ }
+
}
}