incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r606318 - in /incubator/nmaven/trunk/components/maven-dotnet-compiler/src: main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java
Date Fri, 21 Dec 2007 21:12:40 GMT
Author: sisbell
Date: Fri Dec 21 13:12:39 2007
New Revision: 606318

URL: http://svn.apache.org/viewvc?rev=606318&view=rev
Log:
Added back in another unit test. It is now platform aware.

Modified:
    incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java
    incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java

Modified: incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java?rev=606318&r1=606317&r2=606318&view=diff
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java
(original)
+++ incubator/nmaven/trunk/components/maven-dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java
Fri Dec 21 13:12:39 2007
@@ -345,7 +345,7 @@
             for ( String token : tokens )
             {
                 File gacRoot = new File( new File( token ).getParentFile(), "lib/mono/gac/"
);
-                if ( ( !assemblyExistsCheck && !gacRoot.exists() ) || gacRoot.exists()
)
+                if ( !assemblyExistsCheck || gacRoot.exists() )
                 {
                     return gacRoot.getAbsolutePath();
                 }

Modified: incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java?rev=606318&r1=606317&r2=606318&view=diff
==============================================================================
--- incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java
(original)
+++ incubator/nmaven/trunk/components/maven-dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java
Fri Dec 21 13:12:39 2007
@@ -165,11 +165,13 @@
                     } ) );
     }
 
-   // @Test
+    @Test
     public void testInit_WithGacGenericAndNovellAndPath()
         throws InitializationException, IOException
     {
-        System.setProperty( "PATH", "/Mono/bin" );
+        String monoRoot =  Vendor.getDefaultVendorForOS().equals( Vendor.NOVELL ) ? "/Mono"
: "C:\\Program Files\\Mono";
+
+        System.setProperty( "PATH", monoRoot + File.separator + "bin");
         DotnetCompilerContextImpl ctx = new DotnetCompilerContextImpl();
         MavenProject project = new MavenProject();
 
@@ -194,14 +196,14 @@
         Set<Artifact> libraries = ctx.getLibraryDependencies();
         assertThat( libraries.size(), equalTo( 1 ) );
         assertThat( ( (Artifact) libraries.toArray()[0] ).getFile().getAbsolutePath(), equalTo(
-            "C:\\Program Files\\Mono\\lib\\mono\\gac\\artifactId\\1.0__dsfajkdsfajdfs\\artifactId.dll"
) );
+            monoRoot + replaceFileSeparator("\\lib\\mono\\gac\\artifactId\\1.0__dsfajkdsfajdfs\\artifactId.dll"
)) );
     }
 
-  //  @Test
+    //  @Test
     public void testInit_WithGacGenericAndNovellAndMonoRoot()
         throws InitializationException, IOException
     {
-        System.setProperty( "MONO_ROOT", "C:\\Program Files\\Mono\\bin" );
+        System.setProperty( "MONO_ROOT", "/Program Files/Mono/bin" );
         DotnetCompilerContextImpl ctx = new DotnetCompilerContextImpl();
         MavenProject project = new MavenProject();
 
@@ -262,5 +264,10 @@
         config.setVendor( Vendor.MICROSOFT );
 
         return config;
+    }
+
+        private static String replaceFileSeparator(String value)
+    {
+        return value.replaceAll( "[/\\\\]+", "\\" + File.separator);
     }
 }



Mime
View raw message