You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ba...@apache.org on 2008/12/18 03:55:19 UTC

svn commit: r727621 - /maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/ide/IdeUtilsTest.java

Author: baerrach
Date: Wed Dec 17 18:55:18 2008
New Revision: 727621

URL: http://svn.apache.org/viewvc?rev=727621&view=rev
Log:
[MECLIPSE-502] test failures for drive D being CD rom
- test is skipped if the fileToAdd can't be canonicalized.

Modified:
    maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/ide/IdeUtilsTest.java

Modified: maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/ide/IdeUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/ide/IdeUtilsTest.java?rev=727621&r1=727620&r2=727621&view=diff
==============================================================================
--- maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/ide/IdeUtilsTest.java (original)
+++ maven/plugins/trunk/maven-eclipse-plugin/src/test/java/org/apache/maven/plugin/ide/IdeUtilsTest.java Wed Dec 17 18:55:18 2008
@@ -19,6 +19,7 @@
 package org.apache.maven.plugin.ide;
 
 import java.io.File;
+import java.io.IOException;
 
 import junit.framework.TestCase;
 
@@ -32,8 +33,8 @@
  */
 public class IdeUtilsTest
     extends TestCase
-{  
-    
+{
+
     public void testGetProjectNameStringIdeDependency()
     {
         IdeDependency dependency = new IdeDependency();
@@ -69,7 +70,17 @@
         }
         File basedir = new File( "C:\\TEMP\\EclipsePlugin.unitTest.1165557188766\\" );
         File fileToAdd = new File( "D:\\ide\\workspace\\maven\\maven-eclipse-plugin\\target\\main-output" );
-
+        try
+        {
+            fileToAdd.getCanonicalPath();
+        }
+        catch ( IOException e )
+        {
+            // skip the test if the fileToAdd can't be canonicalized.
+            // Likely it is because D refers to a CD drive that is not ready.
+            return;
+        }
+        
         String actual = IdeUtils.toRelativeAndFixSeparator( basedir, fileToAdd, false );
         String expected = "D:/ide/workspace/maven/maven-eclipse-plugin/target/main-output";
 
@@ -88,7 +99,7 @@
         if (!Os.isFamily( Os.FAMILY_WINDOWS ) ) {
             return;
         }
-        
+
         File basedir = new File( "C:\\TEMP\\EclipsePlugin.unitTest.1165557188766\\" );
         File fileToAdd = new File( "target/main-output" );
 
@@ -115,7 +126,7 @@
         if (!Os.isFamily( Os.FAMILY_WINDOWS ) ) {
             return;
         }
-        
+
         File basedir = new File( "Z:" );
         File fileToAdd = new File( "target/main-output" );