aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwr...@apache.org
Subject svn commit: r1397361 - /aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/LocationTest.java
Date Thu, 11 Oct 2012 23:10:39 GMT
Author: jwross
Date: Thu Oct 11 23:10:39 2012
New Revision: 1397361

URL: http://svn.apache.org/viewvc?rev=1397361&view=rev
Log:
Fixed testAnyLocationString so that assertion errors won't be mistaken for location creation
errors.

Modified:
    aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/LocationTest.java

Modified: aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/LocationTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/LocationTest.java?rev=1397361&r1=1397360&r2=1397361&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/LocationTest.java
(original)
+++ aries/trunk/subsystem/subsystem-core/src/test/java/org/apache/aries/subsystem/core/internal/LocationTest.java
Thu Oct 11 23:10:39 2012
@@ -12,26 +12,27 @@ public class LocationTest {
 	@Test
 	public void testAnyLocationString() {
 		String locationStr = "anyLocation";
+		Location location = null;
 		try {
-			Location location = new Location(locationStr);
-			assertNull("Wrong symbolic name", location.getSymbolicName());
-			assertEquals("Wrong value", locationStr, location.getValue());
-			assertNull("Wrong version", location.getVersion());
-			try {
-				location.open();
-				fail("Opening a location that does not represent a URL should fail");
-			}
-			catch (MalformedURLException e) {
-				// Okay
-			}
-			catch (Throwable t) {
-				t.printStackTrace();
-				fail("Wrong exception");
-			}
+			location = new Location(locationStr);
 		}
 		catch (Throwable t) {
 			t.printStackTrace();
 			fail("Any location string must be supported");
 		}
+		assertNull("Wrong symbolic name", location.getSymbolicName());
+		assertEquals("Wrong value", locationStr, location.getValue());
+		assertNull("Wrong version", location.getVersion());
+		try {
+			location.open();
+			fail("Opening a location that does not represent a URL should fail");
+		}
+		catch (MalformedURLException e) {
+			// Okay
+		}
+		catch (Throwable t) {
+			t.printStackTrace();
+			fail("Wrong exception");
+		}
 	}
 }



Mime
View raw message