You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2011/03/30 12:07:35 UTC

svn commit: r1086889 - /maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java

Author: cstamas
Date: Wed Mar 30 10:07:35 2011
New Revision: 1086889

URL: http://svn.apache.org/viewvc?rev=1086889&view=rev
Log:
NEXUS-4152: added UT covering the same issue

Modified:
    maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java

Modified: maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java?rev=1086889&r1=1086888&r2=1086889&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java (original)
+++ maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java Wed Mar 30 10:07:35 2011
@@ -4,6 +4,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.List;
 
 import junit.framework.Assert;
 
@@ -15,6 +16,7 @@ import org.apache.maven.index.context.In
 import org.apache.maven.index.context.MergedIndexingContext;
 import org.apache.maven.index.packer.IndexPackingRequest.IndexFormat;
 import org.apache.maven.index.updater.IndexDataReader;
+import org.codehaus.plexus.util.StringUtils;
 
 public class NEXUS4149TransferFormatTest
     extends AbstractNexusIndexerTest
@@ -49,9 +51,14 @@ public class NEXUS4149TransferFormatTest
                 "repo3" ), null, null, MIN_CREATORS );
         nexusIndexer.scan( ctx3 );
 
+        IndexingContext ctx4 =
+            nexusIndexer.addIndexingContext( "repo4", "repo4", new File( reposBase, "repo4" ), new File( idxsBase,
+                "repo4" ), null, null, MIN_CREATORS );
+        nexusIndexer.scan( ctx4 );
+
         context =
             nexusIndexer.addMergedIndexingContext( "ctx", "ctx", new File( reposBase, "merged" ), new File( idxsBase,
-                "merged" ), false, Arrays.asList( ctx1, ctx2, ctx3 ) );
+                "merged" ), false, Arrays.asList( ctx1, ctx2, ctx3, ctx4 ) );
 
         context.getIndexDirectoryFile().mkdirs();
     }
@@ -118,6 +125,8 @@ public class NEXUS4149TransferFormatTest
             int totalDocs = 0;
             int specialDocs = 0;
             int artifactDocs = 0;
+            String allGroups = null;
+            String rootGroups = null;
             Document doc;
             while ( ( doc = reader.readDocument() ) != null )
             {
@@ -126,6 +135,15 @@ public class NEXUS4149TransferFormatTest
                     || doc.getField( ArtifactInfo.ROOT_GROUPS ) != null )
                 {
                     specialDocs++;
+
+                    if ( doc.get( ArtifactInfo.ALL_GROUPS ) != null )
+                    {
+                        allGroups = doc.get( ArtifactInfo.ALL_GROUPS_LIST );
+                    }
+                    if ( doc.get( ArtifactInfo.ROOT_GROUPS ) != null )
+                    {
+                        rootGroups = doc.get( ArtifactInfo.ROOT_GROUPS_LIST );
+                    }
                 }
                 else
                 {
@@ -133,15 +151,35 @@ public class NEXUS4149TransferFormatTest
                 }
             }
 
+            Assert.assertNotNull( "Group transport file should contain allGroups!", allGroups );
+            Assert.assertNotNull( "Group transport file should contain rootGroups!", rootGroups );
+            checkListOfStringDoesNotContainEmptyString( ArtifactInfo.str2lst( allGroups ) );
+            checkListOfStringDoesNotContainEmptyString( ArtifactInfo.str2lst( rootGroups ) );
+
             Assert.assertEquals( 15, totalDocs );
             // 1 descriptor + 1 allGroups + 1 rootGroups
             Assert.assertEquals( 3, specialDocs );
             // repo1 has 1 artifact, repo2 has 1 artifact and repo3 has 10 artifact
             Assert.assertEquals( 12, artifactDocs );
+
         }
         finally
         {
             fis.close();
         }
     }
+
+    protected void checkListOfStringDoesNotContainEmptyString( List<String> lst )
+    {
+        if ( lst != null )
+        {
+            for ( String str : lst )
+            {
+                if ( StringUtils.isBlank( str ) )
+                {
+                    throw new IllegalArgumentException( "List " + lst + " contains empty string!" );
+                }
+            }
+        }
+    }
 }



Re: svn commit: r1086889 - /maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java

Posted by Tamás Cservenák <ta...@cservenak.net>.
All gitters (like me) having forks would need just a re-fetch again
(reinit the git-svn and refetch the svn history). But not sure what
will happen with ASF Git mirror? (the git.apache.org/maven-indexer.git
one)

If you can change svn logs, and you do know the ASF Git mirror will be
okay (I dunno), then i'd say go for it.

And again, sorry for messing this up :(


Thanks,
~t~

On Thu, Mar 31, 2011 at 2:35 AM, Brett Porter <br...@apache.org> wrote:
> Would it affect the git history if the svn logs were modified with the updated issue numbers now that it has already been pushed?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1086889 - /maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java

Posted by Brett Porter <br...@apache.org>.
Would it affect the git history if the svn logs were modified with the updated issue numbers now that it has already been pushed?

On 30/03/2011, at 10:06 PM, Tamás Cservenák wrote:

> Hi,
> 
> completely agreed, but let me explain -- not that it matters:
> 
> I had a lot of accumulated changes in my github fork of maven-indexer,
> and initially did not wanted to disturb other forks of my repository.
> 
> Hence, I started pushing changes _without_ changing commit messages
> first -- thinking "it would change history, hence screw other forks".
> 
> I was distracted with ASF SVN mirroring pain (dcommiting multiple
> commits from EU, --no-rebase was not helping, there was a lot of
> interlaving changes for same file), but solved luckily:
> 
> http://twitter.com/#!/cstamas/status/53021178750701568
> 
> And then I realized: git-svn _also modifies_ history, but it was late
> then :( I already started pushing (and had to recover few times until
> I found out the dnsmasq fix), since there was a LOT of commits to be
> dcommited back to ASF SVN.
> 
> To at least make it better, I linked the MINDEXER jira issues to the
> SVN revisions, so at least we have the JIRA->SVN direction, but SVN
> commit logs does not point back.
> 
> http://jira.codehaus.org/browse/MINDEXER-15
> http://jira.codehaus.org/browse/MINDEXER-16
> http://jira.codehaus.org/browse/MINDEXER-17
> http://jira.codehaus.org/browse/MINDEXER-18
> 
> 
> 
> Thanks,
> ~t~
> 
> On Wed, Mar 30, 2011 at 12:20 PM, Benjamin Bentmann
> <be...@udo.edu> wrote:
>> I think it would be more appropriate if those commits were mentioning the
>> corresponding MINDEXER issue.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1086889 - /maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java

Posted by Tamás Cservenák <ta...@cservenak.net>.
Hi,

completely agreed, but let me explain -- not that it matters:

I had a lot of accumulated changes in my github fork of maven-indexer,
and initially did not wanted to disturb other forks of my repository.

Hence, I started pushing changes _without_ changing commit messages
first -- thinking "it would change history, hence screw other forks".

I was distracted with ASF SVN mirroring pain (dcommiting multiple
commits from EU, --no-rebase was not helping, there was a lot of
interlaving changes for same file), but solved luckily:

http://twitter.com/#!/cstamas/status/53021178750701568

And then I realized: git-svn _also modifies_ history, but it was late
then :( I already started pushing (and had to recover few times until
I found out the dnsmasq fix), since there was a LOT of commits to be
dcommited back to ASF SVN.

To at least make it better, I linked the MINDEXER jira issues to the
SVN revisions, so at least we have the JIRA->SVN direction, but SVN
commit logs does not point back.

http://jira.codehaus.org/browse/MINDEXER-15
http://jira.codehaus.org/browse/MINDEXER-16
http://jira.codehaus.org/browse/MINDEXER-17
http://jira.codehaus.org/browse/MINDEXER-18



Thanks,
~t~

On Wed, Mar 30, 2011 at 12:20 PM, Benjamin Bentmann
<be...@udo.edu> wrote:
> I think it would be more appropriate if those commits were mentioning the
> corresponding MINDEXER issue.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1086889 - /maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/packer/NEXUS4149TransferFormatTest.java

Posted by Benjamin Bentmann <be...@udo.edu>.
Hi Tamas,

> Author: cstamas
> Date: Wed Mar 30 10:07:35 2011
> New Revision: 1086889
>
> URL: http://svn.apache.org/viewvc?rev=1086889&view=rev
> Log:
> NEXUS-4152: added UT covering the same issue

I think it would be more appropriate if those commits were mentioning 
the corresponding MINDEXER issue.


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org