harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r631925 - /harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java
Date Thu, 28 Feb 2008 10:42:44 GMT
Author: smishura
Date: Thu Feb 28 02:42:42 2008
New Revision: 631925

URL: http://svn.apache.org/viewvc?rev=631925&view=rev
Log:
Fix JUnit style

Modified:
    harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java?rev=631925&r1=631924&r2=631925&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/ManifestTest.java
Thu Feb 28 02:42:42 2008
@@ -20,7 +20,6 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Map;
 import java.util.jar.Attributes;
@@ -95,15 +94,9 @@
 		 * assertTrue("Manifests should be equal", myManifest.equals(m2));
 		 */
 
-		Manifest manifest = null;
-		try {
-			manifest = new Manifest(new URL(Support_Resources
-					.getURL(MANIFEST_NAME)).openStream());
-		} catch (MalformedURLException e) {
-			fail("Malformed URL");
-		} catch (IOException e) {
-			fail("IOException");
-		}
+        Manifest manifest = new Manifest(new URL(Support_Resources
+                .getURL(MANIFEST_NAME)).openStream());
+
 		Attributes main = manifest.getMainAttributes();
 		assertEquals("Bundle-Name not correct", "ClientSupport", main.getValue("Bundle-Name")
 				);
@@ -148,14 +141,15 @@
                 .getBytes());
         Manifest mf = new Manifest(bis);
 
-        assertTrue("Wrong number of main attributes", mf.getMainAttributes().size() == 4);
+        assertEquals("Wrong number of main attributes", 4, mf
+                .getMainAttributes().size());
 
         Map<String, Attributes> entries = mf.getEntries();
-        assertTrue("Wrong number of named entries", entries.size() == 1);
+        assertEquals("Wrong number of named entries", 1, entries.size());
 
         Attributes namedEntryAttributes = (Attributes) (entries.get(""));
-        assertTrue("Wrong number of named entry attributes",
-                namedEntryAttributes.size() == 6);
+        assertEquals("Wrong number of named entry attributes", 6,
+                namedEntryAttributes.size());
 	}
 
 	/**



Mime
View raw message