maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r602568 - /maven/shared/trunk/maven-archiver/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java
Date Sat, 08 Dec 2007 22:06:48 GMT
Author: olamy
Date: Sat Dec  8 14:06:48 2007
New Revision: 602568

URL: http://svn.apache.org/viewvc?rev=602568&view=rev
Log:
apply maven style no code change

Modified:
    maven/shared/trunk/maven-archiver/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java

Modified: maven/shared/trunk/maven-archiver/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-archiver/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java?rev=602568&r1=602567&r2=602568&view=diff
==============================================================================
--- maven/shared/trunk/maven-archiver/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java
(original)
+++ maven/shared/trunk/maven-archiver/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java
Sat Dec  8 14:06:48 2007
@@ -40,15 +40,22 @@
 public class MavenArchiverTest
     extends TestCase
 {
-    static class ArtifactComparator implements Comparator {
+    static class ArtifactComparator
+        implements Comparator
+    {
         public int compare( Object o1, Object o2 )
         {
-          return ((Artifact) o1).getArtifactId().compareTo(((Artifact) o2).getArtifactId());
+            return ( (Artifact) o1 ).getArtifactId().compareTo( ( (Artifact) o2 ).getArtifactId()
);
+        }
+
+        public boolean equals( Object o )
+        {
+            return false;
         }
-        public boolean equals(Object o) { return false; }
     }
 
-    public void testGetManifestExtensionList() throws Exception
+    public void testGetManifestExtensionList()
+        throws Exception
     {
         MavenArchiver archiver = new MavenArchiver();
 
@@ -76,13 +83,13 @@
         assertNotNull( manifest.getMainSection() );
 
         java.util.Enumeration enume = manifest.getSectionNames();
-        while (enume.hasMoreElements()) {  
-           Manifest.Section section = manifest.getSection(enume.nextElement().toString());
-           System.out.println( section + " " + section.getAttributeValue( "Extension-List"
) );
+        while ( enume.hasMoreElements() )
+        {
+            Manifest.Section section = manifest.getSection( enume.nextElement().toString()
);
+            System.out.println( section + " " + section.getAttributeValue( "Extension-List"
) );
         }
 
-        assertEquals( null,
-                      manifest.getMainSection().getAttributeValue( "Extension-List" ) );
+        assertEquals( null, manifest.getMainSection().getAttributeValue( "Extension-List"
) );
 
         MockArtifact artifact1 = new MockArtifact();
         artifact1.setGroupId( "org.apache.dummy" );
@@ -95,8 +102,7 @@
 
         manifest = archiver.getManifest( project, config );
 
-        assertEquals( null,
-                      manifest.getMainSection().getAttributeValue( "Extension-List" ) );
+        assertEquals( null, manifest.getMainSection().getAttributeValue( "Extension-List"
) );
 
         MockArtifact artifact2 = new MockArtifact();
         artifact2.setGroupId( "org.apache.dummy" );
@@ -109,8 +115,7 @@
 
         manifest = archiver.getManifest( project, config );
 
-        assertEquals( "dummy2",
-                      manifest.getMainSection().getAttributeValue( "Extension-List" ) );
+        assertEquals( "dummy2", manifest.getMainSection().getAttributeValue( "Extension-List"
) );
 
         MockArtifact artifact3 = new MockArtifact();
         artifact3.setGroupId( "org.apache.dummy" );
@@ -123,9 +128,7 @@
 
         manifest = archiver.getManifest( project, config );
 
-        assertEquals( "dummy2",
-                      manifest.getMainSection().getAttributeValue( "Extension-List" ) );
-
+        assertEquals( "dummy2", manifest.getMainSection().getAttributeValue( "Extension-List"
) );
 
         MockArtifact artifact4 = new MockArtifact();
         artifact4.setGroupId( "org.apache.dummy" );
@@ -138,22 +141,25 @@
 
         manifest = archiver.getManifest( project, config );
 
-        assertEquals( "dummy2 dummy4",
-                      manifest.getMainSection().getAttributeValue( "Extension-List" ) );
+        assertEquals( "dummy2 dummy4", manifest.getMainSection().getAttributeValue( "Extension-List"
) );
     }
 
-    public void testMultiClassPath() throws Exception {
+    public void testMultiClassPath()
+        throws Exception
+    {
         final File tempFile = File.createTempFile( "maven-archiver-test-", ".jar" );
 
-        try {
-            MavenArchiver archiver = new MavenArchiver();    	
+        try
+        {
+            MavenArchiver archiver = new MavenArchiver();
 
             Model model = new Model();
             model.setArtifactId( "dummy" );
 
-
-            MavenProject project = new MavenProject( model ) {
-                public List getRuntimeClasspathElements() {
+            MavenProject project = new MavenProject( model )
+            {
+                public List getRuntimeClasspathElements()
+                {
                     return Collections.singletonList( tempFile.getAbsolutePath() );
                 }
             };
@@ -174,15 +180,18 @@
             Manifest manifest = archiver.getManifest( project, archiveConfiguration );
             String classPath = manifest.getMainSection().getAttribute( "Class-Path" ).getValue();
             assertTrue( "User specified Class-Path entry was not added to manifest", classPath.indexOf(
"help/" ) != -1 );
-            assertTrue( "Class-Path generated by addClasspath was not added to manifest",
classPath.indexOf( tempFile.getName() ) != -1 );
-        } finally {
+            assertTrue( "Class-Path generated by addClasspath was not added to manifest",
classPath.indexOf( tempFile
+                .getName() ) != -1 );
+        }
+        finally
+        {
             tempFile.delete();
         }
 
     }
 
     public void testRecreation()
-            throws Exception
+        throws Exception
     {
         File jarFile = new File( "target/test/dummy.jar" );
         jarFile.delete();
@@ -199,7 +208,7 @@
         model.setArtifactId( "dummy" );
         model.setVersion( "0.1" );
         MavenProject project = new MavenProject( model );
- 
+
         project.setArtifacts( Collections.EMPTY_SET );
         project.setPluginArtifacts( Collections.EMPTY_SET );
         project.setReportArtifacts( Collections.EMPTY_SET );
@@ -220,7 +229,7 @@
 
         MavenArchiveConfiguration config = new MavenArchiveConfiguration();
         config.setForced( false );
-        
+
         FileUtils.deleteDirectory( "target/maven-archiver" );
         archiver.createArchive( project, config );
         assertTrue( jarFile.exists() );
@@ -229,12 +238,12 @@
 
         List files = FileUtils.getFiles( new File( "target/maven-archiver" ), "**/**", null,
true );
         for ( Iterator i = files.iterator(); i.hasNext(); )
-	{
-	    File f = (File) i.next();
-	    f.setLastModified( time );
+        {
+            File f = (File) i.next();
+            f.setLastModified( time );
         }
 
-        archiver.createArchive( project,config );
+        archiver.createArchive( project, config );
         assertEquals( jarFile.lastModified(), time );
 
         config.setForced( true );



Mime
View raw message