Author: pete.muir(a)jboss.org
Date: 2009-03-12 13:18:50 -0400 (Thu, 12 Mar 2009)
New Revision: 1946
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactDescriptor.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/Files.java
Log:
Improved error reporting
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactDescriptor.java
===================================================================
---
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactDescriptor.java 2009-03-12
16:53:48 UTC (rev 1945)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactDescriptor.java 2009-03-12
17:18:50 UTC (rev 1946)
@@ -365,6 +365,10 @@
classFile.createNewFile();
classFile.deleteOnExit();
clazzStream = loadResourceAsStream(classFilePathName);
+ if (clazzStream == null)
+ {
+ throw new IllegalStateException("Eror loading " + className +
" (" + classFilePathName + ")");
+ }
Files.copy(clazzStream, classFile);
}
finally
Modified:
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/Files.java
===================================================================
---
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/Files.java 2009-03-12
16:53:48 UTC (rev 1945)
+++
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/Files.java 2009-03-12
17:18:50 UTC (rev 1946)
@@ -11,6 +11,14 @@
public static void copy(InputStream source, OutputStream destination) throws
IOException
{
+ if (source == null)
+ {
+ throw new IllegalArgumentException("source cannot be null");
+ }
+ if (destination == null)
+ {
+ throw new IllegalArgumentException("destination cannot be null");
+ }
byte[] readBuffer = new byte[2156];
int bytesIn = 0;
while((bytesIn = source.read(readBuffer)) != -1)
Show replies by date