Author: ltheussl Date: Wed Jan 12 11:24:39 2011 New Revision: 1058082 URL: http://svn.apache.org/viewvc?rev=1058082&view=rev Log: tests for DOXIASITETOOLS-47
Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java?rev=1058082&r1=1058081&r2=1058082&view=diff ============================================================================== --- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java (original) +++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathDescriptorTest.java Wed Jan 12 11:24:39 2011 @@ -446,6 +446,27 @@ public class PathDescriptorTest assertEquals( "wrong location", base, desc.getLocation() ); } +/* + // FIXME! same as testUrlBaseAbsPath with scp, this fails!? DOXIASITETOOLS-47 + public void testUriBaseAbsPath() + throws Exception + { + String base = "scp://people.apache.org/"; + String path = "absolutePath"; + + PathDescriptor desc = new PathDescriptor( base, "/" + path ); + + assertFalse( desc.isFile() ); + assertFalse( desc.isRelative() ); + assertNotNull( desc.getBaseUrl() ); + assertNotNull( desc.getPathUrl() ); + assertNotNull( desc.getPath() ); + assertNotNull( desc.getLocation() ); + assertEquals( "wrong path", "/" + path, desc.getPath() ); + assertEquals( "wrong location", base + path, desc.getLocation() ); + } +*/ + /** @throws Exception */ public void testPathBaseAbsPath() throws Exception Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java?rev=1058082&r1=1058081&r2=1058082&view=diff ============================================================================== --- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java (original) +++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/PathUtilsTest.java Wed Jan 12 11:24:39 2011 @@ -60,4 +60,18 @@ public class PathUtilsTest assertEquals( ".." + SLASH + "target", PathUtils.getRelativePath( oldPath, newPath ) ); assertEquals( ".." + SLASH + "foo", PathUtils.getRelativePath( newPath, oldPath ) ); } + + /** @throws Exception */ + public void testRelativePathScpBase() + throws Exception + { + PathDescriptor oldPath = new PathDescriptor( "http://maven.apache.org/", "source" ); + PathDescriptor newPath = new PathDescriptor( "http://maven.apache.org/", "target" ); + assertEquals( ".." + SLASH + "source", PathUtils.getRelativePath( oldPath, newPath ) ); + + oldPath = new PathDescriptor( "scp://people.apache.org/", "source" ); + newPath = new PathDescriptor( "scp://people.apache.org/", "target" ); + // FIXME! same with scp URLs fails?! DOXIASITETOOLS-47 + //assertEquals( ".." + SLASH + "source", PathUtils.getRelativePath( oldPath, newPath ) ); + } }