[Arakhnę-Dev] [368] * Bug fix in unit tests of Resources: avoid NullPointException on flows.

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 368
Author:   galland
Date:     2012-08-14 23:18:29 +0200 (Tue, 14 Aug 2012)
Log Message:
-----------
* Bug fix in unit tests of Resources: avoid NullPointException on flows.

Modified Paths:
--------------
    trunk/arakhneVmutils/arakhneVmutils-java/src/test/java/org/arakhne/vmutil/ResourcesTest.java

Modified: trunk/arakhneVmutils/arakhneVmutils-java/src/test/java/org/arakhne/vmutil/ResourcesTest.java
===================================================================
--- trunk/arakhneVmutils/arakhneVmutils-java/src/test/java/org/arakhne/vmutil/ResourcesTest.java	2012-08-14 21:11:16 UTC (rev 367)
+++ trunk/arakhneVmutils/arakhneVmutils-java/src/test/java/org/arakhne/vmutil/ResourcesTest.java	2012-08-14 21:18:29 UTC (rev 368)
@@ -139,7 +139,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream("org/arakhne/vmutil/test.txt"); //$NON-NLS-1$
@@ -147,7 +147,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 	}
 
@@ -162,7 +162,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream(ResourcesTest.class, "org/arakhne/vmutil/test.txt"); //$NON-NLS-1$
@@ -170,7 +170,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream(ResourcesTest.class, "/test.txt"); //$NON-NLS-1$
@@ -178,7 +178,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream(ResourcesTest.class, "test.txt"); //$NON-NLS-1$
@@ -186,7 +186,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		assertNull(Resources.getResourceAsStream((Class<?>)null, null));
@@ -196,7 +196,7 @@
 			assertNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream((Class<?>)null, "org/arakhne/vmutil/test.txt"); //$NON-NLS-1$
@@ -204,7 +204,7 @@
 			assertNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream((Class<?>)null, "test.txt"); //$NON-NLS-1$
@@ -212,7 +212,7 @@
 			assertNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 	}
 
@@ -229,7 +229,7 @@
 			assertNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream(l, p, "org/arakhne/vmutil/test.txt"); //$NON-NLS-1$
@@ -237,7 +237,7 @@
 			assertNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream(l, p, "/test.txt"); //$NON-NLS-1$
@@ -245,7 +245,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream(l, p, "test.txt"); //$NON-NLS-1$
@@ -253,7 +253,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		assertNull(Resources.getResourceAsStream(l, (Package)null, null));
@@ -263,7 +263,7 @@
 			assertNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream(l, (Package)null, "org/arakhne/vmutil/test.txt"); //$NON-NLS-1$
@@ -271,7 +271,7 @@
 			assertNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream(l, (Package)null, "test.txt"); //$NON-NLS-1$
@@ -279,7 +279,7 @@
 			assertNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 	}
 
@@ -294,7 +294,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream(ResourcesTest.class.getClassLoader(), "org/arakhne/vmutil/test.txt"); //$NON-NLS-1$
@@ -302,7 +302,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		assertNull(Resources.getResourceAsStream((ClassLoader)null, null));
@@ -312,7 +312,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 
 		is = Resources.getResourceAsStream((ClassLoader)null, "org/arakhne/vmutil/test.txt"); //$NON-NLS-1$
@@ -320,7 +320,7 @@
 			assertNotNull(is);
 		}
 		finally {
-			is.close();
+			if (is!=null) is.close();
 		}
 	}
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/