maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r583939 - /maven/shared/trunk/maven-dependency-analyzer/src/test/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzerTest.java
Date Thu, 11 Oct 2007 19:58:57 GMT
Author: markh
Date: Thu Oct 11 12:58:56 2007
New Revision: 583939

URL: http://svn.apache.org/viewvc?rev=583939&view=rev
Log:
Correct header and format source

Modified:
    maven/shared/trunk/maven-dependency-analyzer/src/test/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzerTest.java

Modified: maven/shared/trunk/maven-dependency-analyzer/src/test/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzerTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-analyzer/src/test/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzerTest.java?rev=583939&r1=583938&r2=583939&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-analyzer/src/test/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzerTest.java
(original)
+++ maven/shared/trunk/maven-dependency-analyzer/src/test/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzerTest.java
Thu Oct 11 12:58:56 2007
@@ -1,9 +1,23 @@
-/**
- * $HeadURL$
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * (c) 2007 IIZUKA Software Technologies Ltd.  All rights reserved.
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
-package org.apache.maven.shared.dependency.analyzer;
 
 import java.io.File;
 import java.util.Arrays;
@@ -26,123 +40,136 @@
 
 /**
  * Tests <code>DefaultProjectDependencyAnalyzer</code>.
- *
- * @author	Mark Hobson
- * @version	$Id$
- * @see     DefaultProjectDependencyAnalyzer
+ * 
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ * @see DefaultProjectDependencyAnalyzer
  */
-public class DefaultProjectDependencyAnalyzerTest extends PlexusTestCase
+public class DefaultProjectDependencyAnalyzerTest
+    extends PlexusTestCase
 {
     // fields -----------------------------------------------------------------
-    
+
     private BuildTool buildTool;
-    
+
     private ProjectTool projectTool;
 
     private ProjectDependencyAnalyzer analyzer;
 
     // TestCase methods -------------------------------------------------------
-    
+
     /*
      * @see org.codehaus.plexus.PlexusTestCase#setUp()
      */
-    protected void setUp() throws Exception
+    protected void setUp()
+        throws Exception
     {
         super.setUp();
-        
+
         buildTool = (BuildTool) lookup( BuildTool.ROLE );
-        
+
         projectTool = (ProjectTool) lookup( ProjectTool.ROLE );
 
         analyzer = (ProjectDependencyAnalyzer) lookup( ProjectDependencyAnalyzer.ROLE );
     }
 
     // tests ------------------------------------------------------------------
-    
-    public void testPom() throws TestToolsException, ProjectDependencyAnalyzerException
+
+    public void testPom()
+        throws TestToolsException, ProjectDependencyAnalyzerException
     {
         compileProject( "pom/pom.xml" );
-        
+
         MavenProject project = getProject( "pom/pom.xml" );
-        
+
         ProjectDependencyAnalysis actualAnalysis = analyzer.analyze( project );
-        
+
         ProjectDependencyAnalysis expectedAnalysis = new ProjectDependencyAnalysis();
-        
+
         assertEquals( expectedAnalysis, actualAnalysis );
     }
-    
-    public void testJarWithNoDependencies() throws TestToolsException, ProjectDependencyAnalyzerException
+
+    public void testJarWithNoDependencies()
+        throws TestToolsException, ProjectDependencyAnalyzerException
     {
         compileProject( "jarWithNoDependencies/pom.xml" );
-        
+
         MavenProject project = getProject( "jarWithNoDependencies/pom.xml" );
-        
+
         ProjectDependencyAnalysis actualAnalysis = analyzer.analyze( project );
-        
+
         ProjectDependencyAnalysis expectedAnalysis = new ProjectDependencyAnalysis();
-        
+
         assertEquals( expectedAnalysis, actualAnalysis );
     }
-    
-    public void testJarWithCompileDependency() throws TestToolsException, ProjectDependencyAnalyzerException
+
+    public void testJarWithCompileDependency()
+        throws TestToolsException, ProjectDependencyAnalyzerException
     {
         compileProject( "jarWithCompileDependency/pom.xml" );
-        
+
         MavenProject project2 = getProject( "jarWithCompileDependency/project2/pom.xml" );
-        
+
         ProjectDependencyAnalysis actualAnalysis = analyzer.analyze( project2 );
-        
-        Artifact project1 = createArtifact( "org.apache.maven.shared.dependency-analyzer.tests",
"jarWithCompileDependency1", "jar", "1.0", "compile");
+
+        Artifact project1 =
+            createArtifact( "org.apache.maven.shared.dependency-analyzer.tests", "jarWithCompileDependency1",
"jar",
+                            "1.0", "compile" );
         Set usedDeclaredArtifacts = Collections.singleton( project1 );
         ProjectDependencyAnalysis expectedAnalysis = new ProjectDependencyAnalysis( usedDeclaredArtifacts,
null, null );
-        
+
         assertEquals( expectedAnalysis, actualAnalysis );
     }
-    
-    public void testJarWithTestDependency() throws TestToolsException, ProjectDependencyAnalyzerException
+
+    public void testJarWithTestDependency()
+        throws TestToolsException, ProjectDependencyAnalyzerException
     {
         compileProject( "jarWithTestDependency/pom.xml" );
-        
+
         MavenProject project2 = getProject( "jarWithTestDependency/project2/pom.xml" );
-        
+
         ProjectDependencyAnalysis actualAnalysis = analyzer.analyze( project2 );
-        
-        Artifact project1 = createArtifact( "org.apache.maven.shared.dependency-analyzer.tests",
"jarWithTestDependency1", "jar", "1.0", "test");
+
+        Artifact project1 =
+            createArtifact( "org.apache.maven.shared.dependency-analyzer.tests", "jarWithTestDependency1",
"jar",
+                            "1.0", "test" );
         Set usedDeclaredArtifacts = Collections.singleton( project1 );
-        
+
         // TODO: remove workaround for SUREFIRE-300 when 2.3.1 released
-        Artifact junit = createArtifact( "junit", "junit", "jar", "3.8.1", "test");
+        Artifact junit = createArtifact( "junit", "junit", "jar", "3.8.1", "test" );
         Set unusedDeclaredArtifacts = Collections.singleton( junit );
-        
-        ProjectDependencyAnalysis expectedAnalysis = new ProjectDependencyAnalysis( usedDeclaredArtifacts,
null, unusedDeclaredArtifacts );
-        
+
+        ProjectDependencyAnalysis expectedAnalysis =
+            new ProjectDependencyAnalysis( usedDeclaredArtifacts, null, unusedDeclaredArtifacts
);
+
         assertEquals( expectedAnalysis, actualAnalysis );
     }
-    
+
     // private methods --------------------------------------------------------
-    
-    private void compileProject( String pomPath ) throws TestToolsException
+
+    private void compileProject( String pomPath )
+        throws TestToolsException
     {
         File pom = getTestFile( "target/test-classes/", pomPath );
         Properties properties = new Properties();
         List goals = Arrays.asList( new String[] { "clean", "install" } );
-        File log = new File(pom.getParentFile(), "build.log");
+        File log = new File( pom.getParentFile(), "build.log" );
 
         // TODO: don't install test artifacts to local repository
         InvocationResult result = buildTool.executeMaven( pom, properties, goals, log );
-        
+
         assertNull( "Error compiling test project", result.getExecutionException() );
         assertEquals( "Error compiling test project", 0, result.getExitCode() );
     }
-    
-    private MavenProject getProject( String pomPath ) throws TestToolsException
+
+    private MavenProject getProject( String pomPath )
+        throws TestToolsException
     {
         File pom = getTestFile( "target/test-classes/", pomPath );
-        
+
         return projectTool.readProjectWithDependencies( pom );
     }
-    
+
     private Artifact createArtifact( String groupId, String artifactId, String type, String
version, String scope )
     {
         VersionRange versionRange = VersionRange.createFromVersion( version );



Mime
View raw message