From nmaven-commits-return-588-apmail-incubator-nmaven-commits-archive=incubator.apache.org@incubator.apache.org Thu Nov 29 21:12:57 2007 Return-Path: Delivered-To: apmail-incubator-nmaven-commits-archive@locus.apache.org Received: (qmail 49729 invoked from network); 29 Nov 2007 21:12:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Nov 2007 21:12:57 -0000 Received: (qmail 50920 invoked by uid 500); 29 Nov 2007 21:12:45 -0000 Delivered-To: apmail-incubator-nmaven-commits-archive@incubator.apache.org Received: (qmail 50896 invoked by uid 500); 29 Nov 2007 21:12:45 -0000 Mailing-List: contact nmaven-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: nmaven-dev@incubator.apache.org Delivered-To: mailing list nmaven-commits@incubator.apache.org Received: (qmail 50887 invoked by uid 99); 29 Nov 2007 21:12:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2007 13:12:45 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2007 21:12:55 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4E7701A983A; Thu, 29 Nov 2007 13:12:33 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r599580 - in /incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components: ./ dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/ dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/ dotnet-compiler/src/tes... Date: Thu, 29 Nov 2007 21:12:31 -0000 To: nmaven-commits@incubator.apache.org From: sisbell@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071129211233.4E7701A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sisbell Date: Thu Nov 29 13:12:29 2007 New Revision: 599580 URL: http://svn.apache.org/viewvc?rev=599580&view=rev Log: Added Junit/surefire plugins and included some unit tests. Added: incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/NetCompilerConfigTest.java (with props) incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java (with props) Modified: incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/DotnetCompilerConfig.java incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/pom.xml Modified: incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/DotnetCompilerConfig.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/DotnetCompilerConfig.java?rev=599580&r1=599579&r2=599580&view=diff ============================================================================== --- incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/DotnetCompilerConfig.java (original) +++ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/DotnetCompilerConfig.java Thu Nov 29 13:12:29 2007 @@ -187,11 +187,6 @@ { throw new IllegalArgumentException("vendor"); } - - if(artifactType == null) - { - throw new IllegalArgumentException("artifactType"); - } } public boolean equals( Object o ) Modified: incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java?rev=599580&r1=599579&r2=599580&view=diff ============================================================================== --- incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java (original) +++ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/main/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImpl.java Thu Nov 29 13:12:29 2007 @@ -108,12 +108,12 @@ { if(project == null) { - throw new IllegalArgumentException("mavenProject"); + throw new IllegalArgumentException("NMAVEN-061-000: mavenProject"); } if(compilerConfig == null) { - throw new IllegalArgumentException("compilerConfig"); + throw new IllegalArgumentException("NMAVEN-061-001: compilerConfig"); } this.project = project; @@ -226,7 +226,7 @@ if ( icons.length > 1 ) { throw new PlatformUnsupportedException( - "NMAVEN-061-007: There is more than one win32icon in resource directory: Number = " + icons + "NMAVEN-061-002: There is more than one win32icon in resource directory: Number = " + icons .length ); } if ( icons.length == 1 ) @@ -269,7 +269,7 @@ else { throw new PlatformUnsupportedException( - "NMAVEN-061-008: Could not locate Global Assembly Cache for Mono. Try setting the MONO_ROOT environmental variable." ); + "NMAVEN-061-003: Could not locate Global Assembly Cache for Mono. Try setting the MONO_ROOT environmental variable." ); } } @@ -281,7 +281,7 @@ if ( !gacFile.exists() ) { throw new PlatformUnsupportedException( - "NMAVEN-000-000: Could not find GAC dependency: File = " + gacFile.getAbsolutePath() ); + "NMAVEN-061-004: Could not find GAC dependency: File = " + gacFile.getAbsolutePath() ); } artifact.setFile( gacFile ); } Added: incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/NetCompilerConfigTest.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/NetCompilerConfigTest.java?rev=599580&view=auto ============================================================================== --- incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/NetCompilerConfigTest.java (added) +++ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/NetCompilerConfigTest.java Thu Nov 29 13:12:29 2007 @@ -0,0 +1,120 @@ +package org.apache.maven.dotnet.compiler; + +import org.junit.Test; + +import java.io.File; + +public class NetCompilerConfigTest +{ + @Test + public void verifyCompilerConfig() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.verifyCompilerConfig(); + } + + @Test(expected = IllegalArgumentException.class) + public void verifyCompilerConfig_WithNullArtifactType() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.setArtifactType( null ); + config.verifyCompilerConfig(); + } + + @Test(expected = IllegalArgumentException.class) + public void verifyCompilerConfig_WithNullCompilerPlatformVersion() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.setCompilerPlatformVersion( null); + + config.verifyCompilerConfig(); + } + + @Test(expected = IllegalArgumentException.class) + public void verifyCompilerConfig_WithNullLocalRepository() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.setLocalRepository( null); + + config.verifyCompilerConfig(); + } + + @Test(expected = IllegalArgumentException.class) + public void verifyCompilerConfig_WithNullProgrammingLanguage() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.setProgrammingLanguage( null); + + config.verifyCompilerConfig(); + } + + @Test(expected = IllegalArgumentException.class) + public void verifyCompilerConfig_WithNullSourceDirectory() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.setSourceDirectory( null); + + config.verifyCompilerConfig(); + } + + @Test(expected = IllegalArgumentException.class) + public void verifyCompilerConfig_WithMissingSourceDirectory() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.setSourceDirectory( new File("/" + Math.random())); + + config.verifyCompilerConfig(); + } + + @Test(expected = IllegalArgumentException.class) + public void verifyCompilerConfig_WithNullTargetDirectory() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.setTargetDirectory( null); + + config.verifyCompilerConfig(); + } + + @Test(expected = IllegalArgumentException.class) + public void verifyCompilerConfig_WithMissingTargetDirectory() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.setTargetDirectory( new File("/" + Math.random())); + + config.verifyCompilerConfig(); + } + + @Test(expected = IllegalArgumentException.class) + public void verifyCompilerConfig_WithNullVendor() + throws IllegalArgumentException + { + DotnetCompilerConfig config = getDefaultDotnetCompilerConfig(); + config.setVendor( null); + + config.verifyCompilerConfig(); + } + + private static DotnetCompilerConfig getDefaultDotnetCompilerConfig() + { + DotnetCompilerConfig config = DotnetCompilerConfig.Factory.createDefaultExecutableConfig(); + config.setArtifactType( ArtifactType.LIBRARY ); + config.setCompilerPlatformVersion( DotnetCompilerPlatformVersion.VERSION_2_0_50727 ); + config.setLocalRepository( new File( "." ) ); + config.setProgrammingLanguage( ProgrammingLanguage.C_SHARP ); + config.setSourceDirectory( new File( "." ) ); + config.setTargetDirectory( new File( "." ) ); + config.setTestCompile( false ); + config.setVendor( Vendor.MICROSOFT ); + + return config; + } +} Propchange: incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/NetCompilerConfigTest.java ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java?rev=599580&view=auto ============================================================================== --- incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java (added) +++ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java Thu Nov 29 13:12:29 2007 @@ -0,0 +1,57 @@ +package org.apache.maven.dotnet.compiler.impl; + +import org.apache.maven.project.MavenProject; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.Build; +import org.apache.maven.dotnet.compiler.DotnetCompilerConfig; +import org.apache.maven.dotnet.compiler.PlatformUnsupportedException; +import org.junit.Test; + +import java.util.HashSet; +import java.util.Set; + +public class DotnetCompilerContextImplTest +{ + @Test(expected = IllegalArgumentException.class) + public void init_WithNullProject() + throws PlatformUnsupportedException + { + DotnetCompilerContextImpl ctx = new DotnetCompilerContextImpl(); + DotnetCompilerConfig compilerConfig = DotnetCompilerConfig.Factory.createDefaultExecutableConfig(); + + ctx.init( null, compilerConfig ); + + } + + @Test(expected = IllegalArgumentException.class) + public void init_WithNullCompilerConfig() + throws PlatformUnsupportedException + { + DotnetCompilerContextImpl ctx = new DotnetCompilerContextImpl(); + ctx.init( new MavenProject(), null ); + + } + + public void testInit() + { + DotnetCompilerContextImpl ctx = new DotnetCompilerContextImpl(); + MavenProject project = new MavenProject(); + Set dependencyArtifacts = new HashSet(); + project.setDependencyArtifacts( dependencyArtifacts ); + + Build build = new Build(); + build.setDirectory( "" ); + project.setBuild( build ); + + DotnetCompilerConfig compilerConfig = DotnetCompilerConfig.Factory.createDefaultExecutableConfig(); + + try + { + ctx.init( project, compilerConfig ); + } + catch ( PlatformUnsupportedException e ) + { + e.printStackTrace(); + } + } +} Propchange: incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/dotnet-compiler/src/test/java/org/apache/maven/dotnet/compiler/impl/DotnetCompilerContextImplTest.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/pom.xml URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/pom.xml?rev=599580&r1=599579&r2=599580&view=diff ============================================================================== --- incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/pom.xml (original) +++ incubator/nmaven/branches/SI_MAVEN_INTEGRATION/sandbox/components/pom.xml Thu Nov 29 13:12:29 2007 @@ -33,5 +33,20 @@ NMaven provides Maven 2.x plugins to support building of .NET applications dotnet-compiler - + + + + junit + junit + 4.4 + + + + + + maven-surefire-plugin + 2.3 + + +