[Arakhnę-Dev] [386] * Add unit tests for the Jar URL that are refecencing resources in Jar files that are already inside a Jar file , eg.

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


Revision: 386
Author:   galland
Date:     2013-01-14 15:36:57 +0100 (Mon, 14 Jan 2013)
Log Message:
-----------
* Add unit tests for the Jar URL that are refecencing resources in Jar files that are already inside a Jar file, eg. jar:jar:file:file1.jar!/inner.jar!/innerfile.txt.

Modified Paths:
--------------
    trunk/arakhneVmutils/arakhneVmutils-java/src/test/java/org/arakhne/vmutil/FileSystemTest.java
    trunk/pom.xml

Modified: trunk/arakhneVmutils/arakhneVmutils-java/src/test/java/org/arakhne/vmutil/FileSystemTest.java
===================================================================
--- trunk/arakhneVmutils/arakhneVmutils-java/src/test/java/org/arakhne/vmutil/FileSystemTest.java	2012-08-24 16:02:33 UTC (rev 385)
+++ trunk/arakhneVmutils/arakhneVmutils-java/src/test/java/org/arakhne/vmutil/FileSystemTest.java	2013-01-14 14:36:57 UTC (rev 386)
@@ -64,6 +64,9 @@
 	private static final String PARENT_TEST_URL3 = "jar:jar:http://www.arakhne.org/j.jar!/inner/myjar.jar!/org/arakhne/vmutil/";; //$NON-NLS-1$
 	private static final String JARPART_TEST_URL3 = "jar:http://www.arakhne.org/j.jar!/inner/myjar.jar";; //$NON-NLS-1$
 	private static final String JOIN_TEST_URL3 = "jar:jar:http://www.arakhne.org/j.jar!/inner/myjar.jar!/org/arakhne/vmutil/file.x.z.z/home/test.x.z.z";; //$NON-NLS-1$
+	private static final String JARJAR_TEST_URL1 = "jar:file:/home/test/j.jar!/inner/myjar.jar"; //$NON-NLS-1$
+	private static final String JARJAR_TEST_URL2 = "/org/arakhne/vmutil/file.x.z.z/home/test.x.z.z"; //$NON-NLS-1$
+	private static final String JARJAR_TEST_URL3 = "jar:jar:file:/home/test/j.jar!/inner/myjar.jar!/org/arakhne/vmutil/file.x.z.z/home/test.x.z.z"; //$NON-NLS-1$
 
 	private static final String STRING_WITH_SPACE = "/the path/to/file with space.toto"; //$NON-NLS-1$
 	private static final URL URL_WITH_SPACE;
@@ -253,6 +256,9 @@
 		assertEquals(new URL("file:"+STRING_WITH_SPACE),  //$NON-NLS-1$
 				FileSystem.getJarURL(new URL("jar:file:"+STRING_WITH_SPACE+"!/titi")));  //$NON-NLS-1$//$NON-NLS-2$
 		assertNull(FileSystem.getJarFile(URL_WITH_SPACE));
+
+		assertEquals(new URL(JARJAR_TEST_URL1), FileSystem.getJarURL(
+				new URL(JARJAR_TEST_URL3)));
 	}
 
 	/**
@@ -268,6 +274,9 @@
 		assertEquals(new File("/titi"),  //$NON-NLS-1$
 				FileSystem.getJarFile(new URL("jar:file:"+STRING_WITH_SPACE+"!/titi")));  //$NON-NLS-1$//$NON-NLS-2$
 		assertNull(FileSystem.getJarFile(URL_WITH_SPACE));
+
+		assertEquals(new File(JARJAR_TEST_URL2), FileSystem.getJarFile(
+				new URL(JARJAR_TEST_URL3)));
 	}
 
 	/**
@@ -289,6 +298,7 @@
 	 */
 	public static void testToJarURLURLFile() throws MalformedURLException {
 		assertEquals(u7, FileSystem.toJarURL(u11, f4));
+		assertEquals(new URL(JARJAR_TEST_URL3), FileSystem.toJarURL(new URL(JARJAR_TEST_URL1), new File(JARJAR_TEST_URL2)));
 	}
 
 	/**
@@ -296,6 +306,7 @@
 	 */
 	public static void testToJarURLURLString() throws MalformedURLException {
 		assertEquals(u7, FileSystem.toJarURL(u11, f4.getPath()));
+		assertEquals(new URL(JARJAR_TEST_URL3), FileSystem.toJarURL(new URL(JARJAR_TEST_URL1), JARJAR_TEST_URL2));
 	}
 
 	/**

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2012-08-24 16:02:33 UTC (rev 385)
+++ trunk/pom.xml	2013-01-14 14:36:57 UTC (rev 386)
@@ -12,7 +12,7 @@
 	<description>Java library that provides additional tools.</description>
 
 	<properties>
-		<year>2012</year>
+		<year>2013</year>
 		<sourceEncoding>UTF-8</sourceEncoding>
 	</properties>
 
@@ -242,12 +242,12 @@
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-source-plugin</artifactId>
-					<version>2.1.2</version>
+					<version>2.2.1</version>
 				</plugin>
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-compiler-plugin</artifactId>
-					<version>2.5.1</version>
+					<version>3.0</version>
 				</plugin>
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
@@ -263,37 +263,37 @@
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-plugin-plugin</artifactId>
-					<version>3.1</version>
+					<version>3.2</version>
 				</plugin>
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-assembly-plugin</artifactId>
-					<version>2.3</version>
+					<version>2.4</version>
 				</plugin>
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-resources-plugin</artifactId>
-					<version>2.5</version>
+					<version>2.6</version>
 				</plugin>
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-surefire-plugin</artifactId>
-					<version>2.12</version>
+					<version>2.13</version>
 				</plugin>
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-enforcer-plugin</artifactId>
-					<version>1.0.1</version>
+					<version>1.2</version>
 				</plugin>
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-site-plugin</artifactId>
-					<version>3.1</version>
+					<version>3.2</version>
 				</plugin>
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-javadoc-plugin</artifactId>
-					<version>2.8.1</version>
+					<version>2.9</version>
 				</plugin>
 				<plugin>
 					<groupId>org.apache.felix</groupId>


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