svn commit: r1158569 - in /maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index: SearchWithAnEmptyIndexTest.java creator/OSGIArtifactIndexCreatorTest.java

2011-08-17 Thread olamy
Author: olamy
Date: Wed Aug 17 08:22:11 2011
New Revision: 1158569

URL: http://svn.apache.org/viewvc?rev=1158569view=rev
Log:
add missing license header, add unit test for search with empty index

Added:

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java
   (with props)
Modified:

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/creator/OSGIArtifactIndexCreatorTest.java

Added: 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java?rev=1158569view=auto
==
--- 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java
 (added)
+++ 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java
 Wed Aug 17 08:22:11 2011
@@ -0,0 +1,192 @@
+package org.apache.maven.index;
+
+/*
+ * 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
+ *
+ *   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.
+ */
+
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
+import org.apache.maven.index.context.IndexCreator;
+import org.apache.maven.index.context.IndexingContext;
+import org.apache.maven.index.expr.StringSearchExpression;
+import org.apache.maven.index.packer.IndexPacker;
+import org.apache.maven.index.packer.IndexPackingRequest;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.FileUtils;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ */
+public class SearchWithAnEmptyIndexTest
+extends PlexusTestCase
+{
+protected ListIndexCreator indexCreators;
+
+private NexusIndexer nexusIndexer;
+
+static final String INDEX_ID1 = osgi-test1;
+
+static final String INDEX_ID2 = empty-repo;
+
+private IndexPacker indexPacker;
+
+@Override
+public void setUp()
+throws Exception
+{
+super.setUp();
+
+indexCreators = this.getContainer().lookupList( IndexCreator.class );
+
+nexusIndexer = this.lookup( NexusIndexer.class );
+
+indexPacker = this.lookup( IndexPacker.class );
+
+if ( !nexusIndexer.getIndexingContexts().isEmpty() )
+{
+for ( IndexingContext context : 
nexusIndexer.getIndexingContexts().values() )
+{
+nexusIndexer.removeIndexingContext( context, true );
+}
+}
+}
+
+public void testWithTwoContextWithOneEmpty()
+throws Exception
+{
+createIndex( src/test/repo-with-osgi, target/test/repo-with-osgi/, 
INDEX_ID1 );
+
+String repoPath = target/test/empty-repo-for-searchtest;
+
+File emptyRepo = new File( getBasedir(), repoPath );
+
+if ( emptyRepo.exists() )
+{
+FileUtils.deleteDirectory( emptyRepo );
+}
+
+emptyRepo.mkdirs();
+
+//createIndex( /src/test/repo, repoPath + /.index, INDEX_ID2 );
+createIndex( repoPath, repoPath, INDEX_ID2 );
+
+try
+{
+BooleanQuery q = new BooleanQuery();
+
+q.add( nexusIndexer.constructQuery( OSGI.SYMBOLIC_NAME,
+new StringSearchExpression( 
org.apache.karaf.features.command ) ),
+   BooleanClause.Occur.MUST );
+
+FlatSearchRequest request = new FlatSearchRequest( q );
+assertEquals( 2, 
nexusIndexer.getIndexingContexts().values().size() );
+request.setContexts( new ArrayList( 
nexusIndexer.getIndexingContexts().values() ) );
+FlatSearchResponse response = nexusIndexer.searchFlat( request );
+
+assertEquals( 1, response.getResults().size() );
+
+q = new BooleanQuery();
+
+q.add( nexusIndexer.constructQuery( OSGI.SYMBOLIC_NAME,
+new StringSearchExpression( 
org.apache.karaf.features.core ) ),
+   BooleanClause.Occur.MUST );
+
+request = new 

svn commit: r1158584 - in /maven/indexer/trunk/indexer-core: pom.xml src/test/java/org/apache/maven/index/ConcurrentUseTest.java

2011-08-17 Thread olamy
Author: olamy
Date: Wed Aug 17 08:53:10 2011
New Revision: 1158584

URL: http://svn.apache.org/viewvc?rev=1158584view=rev
Log:
printStack trace in case of issue in ConcurrentTest : sometimes 
ConcurrentUseWithMergedContextTest failed, sometimes not

Modified:
maven/indexer/trunk/indexer-core/pom.xml

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java

Modified: maven/indexer/trunk/indexer-core/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/pom.xml?rev=1158584r1=1158583r2=1158584view=diff
==
--- maven/indexer/trunk/indexer-core/pom.xml (original)
+++ maven/indexer/trunk/indexer-core/pom.xml Wed Aug 17 08:53:10 2011
@@ -278,8 +278,9 @@ under the License.
 /executions
   /plugin
   plugin
+groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-failsafe-plugin/artifactId
-version2.5/version
+version2.9/version
 executions
   execution
 goals

Modified: 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java?rev=1158584r1=1158583r2=1158584view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java
 (original)
+++ 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseTest.java
 Wed Aug 17 08:53:10 2011
@@ -229,6 +229,8 @@ public class ConcurrentUseTest
 {
 t = e;
 
+e.printStackTrace();
+
 throw new IllegalStateException( error, e );
 }
 }




svn commit: r1158600 - /maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

2011-08-17 Thread olamy
Author: olamy
Date: Wed Aug 17 09:47:45 2011
New Revision: 1158600

URL: http://svn.apache.org/viewvc?rev=1158600view=rev
Log:
it looks we never add a template on how to produce a test jar

Modified:
maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

Modified: maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm?rev=1158600r1=1158599r2=1158600view=diff
==
--- maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm Wed Aug 17 
09:47:45 2011
@@ -3,8 +3,9 @@
  --
  Jerome Lacoste
  Dennis Lundberg
+ Olivier Lamy
  --
- 12 July 2006
+ 2011-08-17
  --
 
  ~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -129,4 +130,33 @@ mvn package
 /project
 +-+
 
+* How to create a jat containing test classes
+
++-+
+project
+  ...
+  build
+plugins
+  ...
+  plugin
+groupIdorg.apache.maven.plugins/groupId
+artifactIdmaven-jar-plugin/artifactId
+version${project.version}/version
+executions
+  execution
+goals
+  goaltest-jar/goal
+/goals
+  /execution
+/executions
+  /plugin
+  ...
+/plugins
+  /build
+  ...
+/project
++-+
+
+
+
   For full documentation, click {{{plugin-info.html}here}}.




svn commit: r1158601 - /maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

2011-08-17 Thread olamy
Author: olamy
Date: Wed Aug 17 09:48:20 2011
New Revision: 1158601

URL: http://svn.apache.org/viewvc?rev=1158601view=rev
Log:
fix typo and add sample on how to reuse the produced test jar

Modified:
maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

Modified: maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm?rev=1158601r1=1158600r2=1158601view=diff
==
--- maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm Wed Aug 17 
09:48:20 2011
@@ -130,7 +130,7 @@ mvn package
 /project
 +-+
 
-* How to create a jat containing test classes
+* How to create a jar containing test classes
 
 +-+
 project
@@ -157,6 +157,25 @@ mvn package
 /project
 +-+
 
+  You can produce a jar which will include your test classes and resources.
+  To reuse this artifact in an other project, you must declare this dependency 
with classifier test-jar :
+
++-+
+project
+  ...
+  dependencies
+dependency
+  groupIdgroupId/groupId
+  artifactIdartifactId/artifactId
+  typetest-jar/type
+  versionversion/version
+/dependency
+  /dependencies
+  ...
+/project
++-+
+
+
 
 
   For full documentation, click {{{plugin-info.html}here}}.




svn commit: r1158603 - /maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

2011-08-17 Thread olamy
Author: olamy
Date: Wed Aug 17 09:52:48 2011
New Revision: 1158603

URL: http://svn.apache.org/viewvc?rev=1158603view=rev
Log:
attach sentence to his own pom sample

Modified:
maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

Modified: maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm?rev=1158603r1=1158602r2=1158603view=diff
==
--- maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm Wed Aug 17 
09:52:48 2011
@@ -131,6 +131,8 @@ mvn package
 +-+
 
 * How to create a jar containing test classes
+  
+  You can produce a jar which will include your test classes and resources.
 
 +-+
 project
@@ -157,7 +159,6 @@ mvn package
 /project
 +-+
 
-  You can produce a jar which will include your test classes and resources.
   To reuse this artifact in an other project, you must declare this dependency 
with classifier test-jar :
 
 +-+




svn commit: r1158607 - /maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

2011-08-17 Thread olamy
Author: olamy
Date: Wed Aug 17 10:01:47 2011
New Revision: 1158607

URL: http://svn.apache.org/viewvc?rev=1158607view=rev
Log:
using a test-jar need most of the time to use scope test for this dependency

Modified:
maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

Modified: maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm?rev=1158607r1=1158606r2=1158607view=diff
==
--- maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm Wed Aug 17 
10:01:47 2011
@@ -170,6 +170,7 @@ mvn package
   artifactIdartifactId/artifactId
   typetest-jar/type
   versionversion/version
+  scopetest/scope
 /dependency
   /dependencies
   ...




svn commit: r1158623 - in /maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model: building/DefaultModelBuilder.java validation/DefaultModelValidator.java

2011-08-17 Thread bentmann
Author: bentmann
Date: Wed Aug 17 11:02:03 2011
New Revision: 1158623

URL: http://svn.apache.org/viewvc?rev=1158623view=rev
Log:
[MNG-5157] NPE stemming from DefaultModelBuilder.containsCoordinates

Modified:

maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java

maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java

Modified: 
maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
URL: 
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java?rev=1158623r1=1158622r2=1158623view=diff
==
--- 
maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
 (original)
+++ 
maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
 Wed Aug 17 11:02:03 2011
@@ -909,6 +909,13 @@ public class DefaultModelBuilder
 String artifactId = dependency.getArtifactId();
 String version = dependency.getVersion();
 
+if ( version == null || version.length() = 0 )
+{
+problems.add( Severity.ERROR, 
'dependencyManagement.dependencies.dependency.version' for 
++ dependency.getManagementKey() +  is missing., 
dependency.getLocation(  ), null );
+continue;
+}
+
 String imported = groupId + ':' + artifactId + ':' + version;
 
 if ( importIds.contains( imported ) )
@@ -1045,8 +1052,9 @@ public class DefaultModelBuilder
 
 private boolean containsCoordinates( String message, String groupId, 
String artifactId, String version )
 {
-return message != null  message.contains( groupId )  
message.contains( artifactId )
- message.contains( version );
+return message != null  ( groupId == null || message.contains( 
groupId ) )
+ ( artifactId == null || message.contains( artifactId ) )
+ ( version == null || message.contains( version ) );
 }
 
 }

Modified: 
maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
URL: 
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java?rev=1158623r1=1158622r2=1158623view=diff
==
--- 
maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
 (original)
+++ 
maven/maven-3/trunk/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
 Wed Aug 17 11:02:03 2011
@@ -356,6 +356,12 @@ public class DefaultModelValidator
 {
 String key = dependency.getManagementKey();
 
+validateStringNotEmpty( prefix + .groupId, problems, 
Severity.ERROR, dependency.getGroupId(), key,
+dependency );
+
+validateStringNotEmpty( prefix + .artifactId, problems, 
Severity.ERROR, dependency.getArtifactId(), key,
+dependency );
+
 if ( import.equals( dependency.getScope() ) )
 {
 if ( !pom.equals( dependency.getType() ) )




svn commit: r1158738 - /maven/indexer/trunk/pom.xml

2011-08-17 Thread cstamas
Author: cstamas
Date: Wed Aug 17 14:29:07 2011
New Revision: 1158738

URL: http://svn.apache.org/viewvc?rev=1158738view=rev
Log:
Made Maven Indexer build m2e 1.0 friendly. This pluginManagement section does 
not stir anything in CLI maven build, but stores the needed lifecycle mapping 
for m2e.

More about it here:
http://wiki.eclipse.org/M2E_plugin_execution_not_covered

Modified:
maven/indexer/trunk/pom.xml

Modified: maven/indexer/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/pom.xml?rev=1158738r1=1158737r2=1158738view=diff
==
--- maven/indexer/trunk/pom.xml (original)
+++ maven/indexer/trunk/pom.xml Wed Aug 17 14:29:07 2011
@@ -231,6 +231,31 @@ under the License.
   artifactIdmaven-javadoc-plugin/artifactId
   version2.8/version
 /plugin
+!--This plugin's configuration is used to store Eclipse m2e settings 
only. It has no influence on the Maven build itself.--
+plugin
+  groupIdorg.eclipse.m2e/groupId
+  artifactIdlifecycle-mapping/artifactId
+  version1.0.0/version
+  configuration
+lifecycleMappingMetadata
+  pluginExecutions
+pluginExecution
+  pluginExecutionFilter
+groupIdorg.sonatype.plugins/groupId
+artifactIdport-allocator-maven-plugin/artifactId
+versionRange[1.1,)/versionRange
+goals
+  goalallocate-ports/goal
+/goals
+  /pluginExecutionFilter
+  action
+ignore/ignore
+  /action
+/pluginExecution
+  /pluginExecutions
+/lifecycleMappingMetadata
+  /configuration
+/plugin
   /plugins
 /pluginManagement
   /build




svn commit: r1158739 - in /maven/indexer/trunk/indexer-core/src: main/java/org/apache/maven/index/ main/java/org/apache/maven/index/context/ main/java/org/apache/maven/index/creator/ main/java/org/apa

2011-08-17 Thread cstamas
Author: cstamas
Date: Wed Aug 17 14:29:32 2011
New Revision: 1158739

URL: http://svn.apache.org/viewvc?rev=1158739view=rev
Log:
MINDEXER-34: Order of IndexCreator's passed to 
NexusIndexer.addIndexingContext...() matters and may produce wrong results.

Maven Indexer provides a set of core creators, and while there is 
interdependency between them, it was never handled programatically. As Jesse 
points out in issue, the container returned list (lookupList()) ordering is not 
guaranteed at all.

Now, the IndexCreator interface is extended to be able to topologically sort 
creators before they are added to newly created contexts. A runtime exception 
IllegalArgumentException is newly introduced on 
NexusIndexer.addIndexingContext... methods, to prevent creation of 
IndexingContexts with non-satisfiable list of IndexCreators.

Added:

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/util/IndexCreatorSorter.java
   (with props)
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/util/

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/util/IndexCreatorSorterTest.java
   (with props)

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/util/SpoofIndexCreator.java
   (with props)
Modified:

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/NexusIndexer.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/IndexCreator.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/AbstractIndexCreator.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/JarFileContentsIndexCreator.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/MavenArchetypeArtifactInfoIndexCreator.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/MavenPluginArtifactInfoIndexCreator.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/MinimalArtifactInfoIndexCreator.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java

Modified: 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java?rev=1158739r1=1158738r2=1158739view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java
 (original)
+++ 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java
 Wed Aug 17 14:29:32 2011
@@ -44,6 +44,7 @@ import org.apache.maven.index.context.Me
 import org.apache.maven.index.context.StaticContextMemberProvider;
 import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException;
 import org.apache.maven.index.expr.SearchExpression;
+import org.apache.maven.index.util.IndexCreatorSorter;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -91,7 +92,7 @@ public class DefaultNexusIndexer
 {
 IndexingContext context =
 new DefaultIndexingContext( id, repositoryId, repository, 
indexDirectory, repositoryUrl, indexUpdateUrl,
-indexers, false );
+IndexCreatorSorter.sort( indexers ), false );
 
 indexingContexts.put( context.getId(), context );
 
@@ -109,7 +110,7 @@ public class DefaultNexusIndexer
 {
 context =
 new DefaultIndexingContext( id, repositoryId, repository, 
indexDirectory, repositoryUrl,
-indexUpdateUrl, indexers, true );
+indexUpdateUrl, IndexCreatorSorter.sort( indexers ), true 
);
 
 indexingContexts.put( context.getId(), context );
 }
@@ -128,7 +129,7 @@ public class DefaultNexusIndexer
 {
 IndexingContext context =
 new DefaultIndexingContext( id, repositoryId, repository, 
directory, repositoryUrl, indexUpdateUrl,
-indexers, false );
+IndexCreatorSorter.sort( indexers ), false );
 
 indexingContexts.put( context.getId(), context );
 
@@ -146,7 +147,7 @@ public class DefaultNexusIndexer
 {
 context =
 new DefaultIndexingContext( id, repositoryId, repository, 
directory, repositoryUrl, indexUpdateUrl,
-indexers, true );
+IndexCreatorSorter.sort( indexers ), true );
 
 indexingContexts.put( context.getId(), context );
 }

Modified: 

svn commit: r1158747 - /maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/PathToolTest.java

2011-08-17 Thread struberg
Author: struberg
Date: Wed Aug 17 14:42:02 2011
New Revision: 1158747

URL: http://svn.apache.org/viewvc?rev=1158747view=rev
Log:
MSANDBOX-51 PathTool tests finished

Modified:

maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/PathToolTest.java

Modified: 
maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/PathToolTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/PathToolTest.java?rev=1158747r1=1158746r2=1158747view=diff
==
--- 
maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/PathToolTest.java
 (original)
+++ 
maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/PathToolTest.java
 Wed Aug 17 14:42:02 2011
@@ -20,11 +20,15 @@ package org.codehaus.plexus.util;
  */
 
 import org.apache.maven.tck.FixPlexusBugs;
+import org.hamcrest.CoreMatchers;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.Assert;
+import org.junit.rules.TemporaryFolder;
 
 
+import java.io.File;
+
 import static org.hamcrest.CoreMatchers.is;
 
 
@@ -40,6 +44,9 @@ public class PathToolTest extends Assert
 @Rule
 public FixPlexusBugs fixPlexusBugs = new FixPlexusBugs();
 
+@Rule
+public TemporaryFolder tempFolder = new TemporaryFolder();
+
 @Test
 public void testCalculateLink()
 {
@@ -137,11 +144,15 @@ public class PathToolTest extends Assert
 assertThat( PathTool.getRelativePath( null )
   , is(  ) );
 
-/*X TODO create temp dir structure and set user.dir to it
-assertThat( PathTool.getRelativePath(/usr/local/java/bin )
-  , is(  ) );
-*/
+File baseFolder = tempFolder.newFolder( pathtooltest );
 
+String folderName = anotherFolders;
+File newDir = new File( baseFolder, folderName );
+newDir.mkdirs();
+
+
+assertThat( PathTool.getRelativePath( folderName )
+  , is( . ) );
 }
 
 @Test
@@ -165,4 +176,20 @@ public class PathToolTest extends Assert
   , is( ../../ ) );
 }
 
+@Test
+public void testUppercaseDrive()
+{
+assertThat( PathTool.uppercaseDrive( null )
+, CoreMatchers.ObjectnullValue() );
+
+assertThat( PathTool.uppercaseDrive( d: )
+, is( D: ) );
+
+assertThat( PathTool.uppercaseDrive( D: )
+, is( D: ) );
+
+assertThat( PathTool.uppercaseDrive( /notadrive )
+, is( /notadrive ) );
+}
+
 }




svn commit: r1158770 - in /maven/indexer/trunk/indexer-core/src: main/java/org/apache/maven/index/creator/ test/java/org/apache/maven/index/ test/java/org/apache/maven/index/creator/ test/mindexer-35/

2011-08-17 Thread cstamas
Author: cstamas
Date: Wed Aug 17 15:35:08 2011
New Revision: 1158770

URL: http://svn.apache.org/viewvc?rev=1158770view=rev
Log:
MINDEXER-35: Extended existing JarFileIndexCreator to index classes in WARs too.

Added:

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/Mindexer35NexusIndexerTest.java
   (with props)
maven/indexer/trunk/indexer-core/src/test/mindexer-35/
maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/
maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/
maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/maven/

maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/maven/indexer/

maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/maven/indexer/test/

maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/maven/indexer/test/sample-war/

maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/maven/indexer/test/sample-war/1.0-SNAPSHOT/

maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/maven/indexer/test/sample-war/1.0-SNAPSHOT/maven-metadata.xml
   (with props)

maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/maven/indexer/test/sample-war/1.0-SNAPSHOT/sample-war-1.0-SNAPSHOT.pom
   (with props)

maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/maven/indexer/test/sample-war/1.0-SNAPSHOT/sample-war-1.0-SNAPSHOT.war

maven/indexer/trunk/indexer-core/src/test/mindexer-35/org/apache/maven/indexer/test/sample-war/maven-metadata.xml
   (with props)
Modified:

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/JarFileContentsIndexCreator.java

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/creator/JarFileContentsIndexCreatorTest.java

Modified: 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/JarFileContentsIndexCreator.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/JarFileContentsIndexCreator.java?rev=1158770r1=1158769r2=1158770view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/JarFileContentsIndexCreator.java
 (original)
+++ 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/JarFileContentsIndexCreator.java
 Wed Aug 17 15:35:08 2011
@@ -37,10 +37,11 @@ import org.apache.maven.index.context.In
 import org.apache.maven.index.util.zip.ZipFacade;
 import org.apache.maven.index.util.zip.ZipHandle;
 import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.util.StringUtils;
 
 /**
- * An index creator used to index Java class names from a Maven artifact. Will 
open up the JAR and collect all the class
- * names from it.
+ * An index creator used to index Java class names from a Maven artifact (JAR 
or WAR for now). Will open up the file and
+ * collect all the class names from it.
  */
 @Component( role = IndexCreator.class, hint = JarFileContentsIndexCreator.ID )
 public class JarFileContentsIndexCreator
@@ -65,20 +66,21 @@ public class JarFileContentsIndexCreator
 super( ID );
 }
 
-public void populateArtifactInfo( ArtifactContext artifactContext )
+public void populateArtifactInfo( final ArtifactContext artifactContext )
 throws IOException
 {
 ArtifactInfo ai = artifactContext.getArtifactInfo();
 
 File artifactFile = artifactContext.getArtifact();
 
-if ( artifactFile != null  artifactFile.isFile()  
artifactFile.getName().endsWith( .jar ) )
+if ( artifactFile != null  artifactFile.isFile()
+ ( artifactFile.getName().endsWith( .jar ) || 
artifactFile.getName().endsWith( .war ) ) )
 {
 updateArtifactInfo( ai, artifactFile );
 }
 }
 
-public void updateDocument( ArtifactInfo ai, Document doc )
+public void updateDocument( final ArtifactInfo ai, final Document doc )
 {
 if ( ai.classNames != null )
 {
@@ -87,7 +89,7 @@ public class JarFileContentsIndexCreator
 }
 }
 
-public void updateLegacyDocument( ArtifactInfo ai, Document doc )
+public void updateLegacyDocument( final ArtifactInfo ai, final Document 
doc )
 {
 if ( ai.classNames != null )
 {
@@ -111,7 +113,7 @@ public class JarFileContentsIndexCreator
 }
 }
 
-public boolean updateArtifactInfo( Document doc, ArtifactInfo artifactInfo 
)
+public boolean updateArtifactInfo( final Document doc, final ArtifactInfo 
artifactInfo )
 {
 String names = doc.get( FLD_CLASSNAMES_KW.getKey() );
 
@@ -139,7 +141,20 @@ public class JarFileContentsIndexCreator
 return false;
 }
 
-private void updateArtifactInfo( ArtifactInfo ai, File f )
+private void updateArtifactInfo( final ArtifactInfo ai, final File f 

svn commit: r1158797 - /maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java

2011-08-17 Thread olamy
Author: olamy
Date: Wed Aug 17 16:09:33 2011
New Revision: 1158797

URL: http://svn.apache.org/viewvc?rev=1158797view=rev
Log:
[MINDEXER-36] don't use cryptic field names, use osgi manifest name

Modified:

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java

Modified: 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java?rev=1158797r1=1158796r2=1158797view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java
 (original)
+++ 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java
 Wed Aug 17 16:09:33 2011
@@ -48,12 +48,13 @@ import java.util.jar.Manifest;
  * p
  * OSGI metadatas indexed :
  * ul
- *   liBundle-SymbolicName/li
- *   liBundle-Version/li
- *   liExport-Package/li
- *   liExport-Service/li
+ * liBundle-SymbolicName/li
+ * liBundle-Version/li
+ * liExport-Package/li
+ * liExport-Service/li
  * /ul
  * /p
+ *
  * @author Olivier Lamy
  * @since 4.1.2
  */
@@ -66,27 +67,27 @@ public class OSGIArtifactIndexCreator
 private static final String BSN = Bundle-SymbolicName;
 
 public static final IndexerField FLD_BUNDLE_SYMBOLIC_NAME =
-new IndexerField( OSGI.SYMBOLIC_NAME, IndexerFieldVersion.V4, bsn, 
Bundle-SymbolicName (indexed, stored),
+new IndexerField( OSGI.SYMBOLIC_NAME, IndexerFieldVersion.V4, BSN, 
Bundle-SymbolicName (indexed, stored),
   Field.Store.YES, Field.Index.ANALYZED );
 
 
 private static final String BV = Bundle-Version;
 
 public static final IndexerField FLD_BUNDLE_VERSION =
-new IndexerField( OSGI.VERSION, IndexerFieldVersion.V4, bv, 
Bundle-Version (indexed, stored),
-  Field.Store.YES, Field.Index.ANALYZED );
+new IndexerField( OSGI.VERSION, IndexerFieldVersion.V4, BV, 
Bundle-Version (indexed, stored), Field.Store.YES,
+  Field.Index.ANALYZED );
 
 
 private static final String BEP = Export-Package;
 
 public static final IndexerField FLD_BUNDLE_EXPORT_PACKAGE =
-new IndexerField( OSGI.EXPORT_PACKAGE, IndexerFieldVersion.V4, bep, 
Export-Package (indexed, stored),
+new IndexerField( OSGI.EXPORT_PACKAGE, IndexerFieldVersion.V4, BEP, 
Export-Package (indexed, stored),
   Field.Store.YES, Field.Index.ANALYZED );
 
 private static final String BES = Export-Service;
 
 public static final IndexerField FLD_BUNDLE_EXPORT_SERVIVE =
-new IndexerField( OSGI.EXPORT_SERVICE, IndexerFieldVersion.V4, bes, 
Export-Service (indexed, stored),
+new IndexerField( OSGI.EXPORT_SERVICE, IndexerFieldVersion.V4, BES, 
Export-Service (indexed, stored),
   Field.Store.YES, Field.Index.ANALYZED );
 
 public CollectionIndexerField getIndexerFields()
@@ -94,7 +95,7 @@ public class OSGIArtifactIndexCreator
 return Arrays.asList( FLD_BUNDLE_SYMBOLIC_NAME, FLD_BUNDLE_VERSION, 
FLD_BUNDLE_EXPORT_PACKAGE,
   FLD_BUNDLE_EXPORT_SERVIVE );
 }
-
+
 public OSGIArtifactIndexCreator()
 {
 super( ID );




svn commit: r1158825 - /maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseWithMergedContextPublishingTest.java

2011-08-17 Thread cstamas
Author: cstamas
Date: Wed Aug 17 16:52:31 2011
New Revision: 1158825

URL: http://svn.apache.org/viewvc?rev=1158825view=rev
Log:
Fixed flakey UT that was breaking from time time. It was doing illegal stuff 
(publishing index concurrently into SAME directory), but this fact was not 
noticed since the UT was actually testing something else, not the results of 
the publish operation that was rubbish probably (overwritten by multiple 
threads, being inconsistent).

Modified:

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseWithMergedContextPublishingTest.java

Modified: 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseWithMergedContextPublishingTest.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseWithMergedContextPublishingTest.java?rev=1158825r1=1158824r2=1158825view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseWithMergedContextPublishingTest.java
 (original)
+++ 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/ConcurrentUseWithMergedContextPublishingTest.java
 Wed Aug 17 16:52:31 2011
@@ -21,6 +21,7 @@ package org.apache.maven.index;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.maven.index.context.IndexingContext;
 import org.apache.maven.index.packer.IndexPacker;
@@ -39,6 +40,8 @@ public class ConcurrentUseWithMergedCont
 
 protected File repoPublish = new File( getBasedir(), target/repo-publish 
);
 
+protected final AtomicInteger counter = new AtomicInteger();
+
 @Override
 protected void setUp()
 throws Exception
@@ -52,7 +55,13 @@ public class ConcurrentUseWithMergedCont
 protected int readIndex( final NexusIndexer nexusIndexer, final 
IndexingContext indexingContext )
 throws IOException
 {
-final IndexPackingRequest request = new IndexPackingRequest( context, 
repoPublish );
+// note: concurrent Index publishing into SAME directory is not 
supported and should be avoided.
+// This test had multiple threads doing it, and since it was not 
checking actual results of publish (that was
+// not the goal of the test, but simultaneous publishing of merged 
context that has member changes happening),
+// it was probably publish rubbish anyway.
+final File publish = new File( repoPublish, publish- + 
counter.getAndIncrement() );
+
+final IndexPackingRequest request = new IndexPackingRequest( context, 
publish );
 
 request.setCreateIncrementalChunks( false );
 




svn commit: r1158853 - /maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/StringUtilsTest.java

2011-08-17 Thread struberg
Author: struberg
Date: Wed Aug 17 18:11:21 2011
New Revision: 1158853

URL: http://svn.apache.org/viewvc?rev=1158853view=rev
Log:
MSANDBOX-51 StringUtilTest continued

Modified:

maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/StringUtilsTest.java

Modified: 
maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/StringUtilsTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/StringUtilsTest.java?rev=1158853r1=1158852r2=1158853view=diff
==
--- 
maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/StringUtilsTest.java
 (original)
+++ 
maven/sandbox/trunk/plexus-utils-commons-bridge/plexus-utils-tck/src/test/java/org/codehaus/plexus/util/StringUtilsTest.java
 Wed Aug 17 18:11:21 2011
@@ -20,7 +20,7 @@ package org.codehaus.plexus.util;
  */
 
 import org.apache.maven.tck.FixPlexusBugs;
-import org.hamcrest.CoreMatchers;
+import org.apache.maven.tck.ReproducesPlexusBug;
 import org.junit.Assert;
 import org.junit.Rule;
 import org.junit.Test;
@@ -51,7 +51,7 @@ public class StringUtilsTest extends Ass
 public void testAbbreviate_NPE()
 {
 assertThat( StringUtils.abbreviate( null, 10 )
-, CoreMatchers.ObjectnullValue() );
+, nullValue() );
 }
 
 @Test(expected = IllegalArgumentException.class)
@@ -75,7 +75,7 @@ public class StringUtilsTest extends Ass
 public void testAbbreviate_Offset_NPE()
 {
 assertThat( StringUtils.abbreviate( null, 10, 20 )
-, CoreMatchers.ObjectnullValue() );
+, nullValue() );
 }
 
 @Test(expected = IllegalArgumentException.class)
@@ -170,4 +170,271 @@ public class StringUtilsTest extends Ass
 assertThat( StringUtils.center( centerMe, 20 )
 , is(   centerMe   ) );
 }
+
+@Test( expected = NullPointerException.class )
+public void testCenter_Delim_NPE()
+{
+StringUtils.center( null, 20, * );
+}
+
+@Test
+public void testCenter_Delim()
+{
+assertThat( StringUtils.center( centerMe, 20, * )
+, is( **centerMe** ) );
+
+assertThat( StringUtils.center( centerMe, 4, * )
+, is( centerMe ) );
+
+assertThat( StringUtils.center( centerMe, 20, * )
+, is( **centerMe** ) );
+}
+
+@Test( expected = NullPointerException.class )
+public void testChomp_NPE()
+{
+StringUtils.chomp( null );
+}
+
+@Test
+public void testChomp()
+{
+assertThat( StringUtils.chomp( dings )
+, is( dings ) );
+
+assertThat( StringUtils.chomp( dings\n )
+, is( dings ) );
+
+assertThat( StringUtils.chomp( dings\nbums )
+, is( dings ) );
+
+assertThat( StringUtils.chomp( dings\nbums\ndongs )
+, is( dings\nbums ) );
+}
+
+@Test( expected = NullPointerException.class )
+public void testChomp_Delim_NPE()
+{
+StringUtils.chomp( null, + );
+}
+
+@Test
+public void testChomp_Delim()
+{
+assertThat( StringUtils.chomp( dings, + )
+, is( dings ) );
+
+assertThat( StringUtils.chomp( dings+, + )
+, is( dings ) );
+
+assertThat( StringUtils.chomp( dings+bums, + )
+, is( dings ) );
+
+assertThat( StringUtils.chomp( dings+bums+dongs, + )
+, is( dings+bums ) );
+}
+
+
+@Test( expected = NullPointerException.class )
+public void testChompLast_NPE()
+{
+StringUtils.chompLast( null );
+}
+
+@Test
+public void testChompLast()
+{
+assertThat( StringUtils.chompLast( dings )
+, is( dings ) );
+
+assertThat( StringUtils.chompLast( \n )
+, is(  ) );
+
+assertThat( StringUtils.chompLast( dings\n )
+, is( dings ) );
+
+assertThat( StringUtils.chompLast( dings\nbums )
+, is( dings\nbums ) );
+
+assertThat( StringUtils.chompLast( dings\nbums\ndongs\n )
+, is( dings\nbums\ndongs ) );
+}
+
+@Test( expected = NullPointerException.class )
+public void testChompLast_Delim_NPE()
+{
+StringUtils.chompLast( null, + );
+}
+
+@Test
+public void testChompLast_Delim()
+{
+assertThat( StringUtils.chompLast( dings, + )
+, is( dings ) );
+
+assertThat( StringUtils.chompLast( +, + )
+, is(  ) );
+
+assertThat( StringUtils.chompLast( dings+, + )
+, is( dings ) );
+
+assertThat( StringUtils.chompLast( dings+bums, + )
+  

svn commit: r1158862 - /maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

2011-08-17 Thread rfscholte
Author: rfscholte
Date: Wed Aug 17 18:39:16 2011
New Revision: 1158862

URL: http://svn.apache.org/viewvc?rev=1158862view=rev
Log:
Documenting both ways of creating jars with test-classes

Modified:
maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm

Modified: maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm?rev=1158862r1=1158861r2=1158862view=diff
==
--- maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm (original)
+++ maven/plugins/trunk/maven-jar-plugin/src/site/apt/usage.apt.vm Wed Aug 17 
18:39:16 2011
@@ -131,6 +131,17 @@ mvn package
 +-+
 
 * How to create a jar containing test classes
+
+  When you want to create a jar containing test-classes, you would probably 
want to reuse those classes.
+  There are two ways to solve this:
+  
+  * Create an attached jar with the test-classes from the current project and 
loose its transitive test-scoped dependencies.
+  
+  * Create a separate project with the test-classes.
+  
+  []
+  
+** The easy way 
   
   You can produce a jar which will include your test classes and resources.
 
@@ -177,7 +188,44 @@ mvn package
 /project
 +-+
 
+  Note: The downside of this solution is that you don't get the transitive 
test-scoped dependencies automatically. 
+  Maven only resolves the compile-time dependencies, so you'll have to 
add all the other required test-scoped dependencies by hand.
 
+** The preferred way
 
+  In order to let Maven resolve all test-scoped transitive dependencies 
you should create a separate project.
+  
++-+
+project
+   groupIdgroupId/groupId
+artifactIdartifactId-tests/artifactId
+versionversion/version
+  ...
+/project
++-+
+
+   * Move the sources files from src/test/java you want to share from 
the original project to the src/main/java of this project.
+ The same type of movement counts for the resources as well of course.
+   
+   * Move the required test-scoped dependencies and from the original 
project to this project and remove the scope (i.e. changing it to the 
compile-scope).
+ And yes, that means that the junit dependency (or any other testing 
framework dependency) gets the default scope too.
+ You'll probably need to add some project specific dependencies as well to 
let it all compile again.
+  
+  Now you have your reusable test-classes and you can refer to it as you're 
used to:
+   
++-+
+project
+  ...
+  dependencies
+dependency
+  groupIdgroupId/groupId
+  artifactIdartifactId-tests/artifactId
+  versionversion/version
+  scopetest/scope
+/dependency
+  /dependencies
+  ...
+/project
++-+
 
-  For full documentation, click {{{plugin-info.html}here}}.
+  For full documentation, click {{{./plugin-info.html}here}}.




svn commit: r1158871 - in /maven/indexer/trunk/indexer-core/src: main/java/org/apache/maven/index/ main/java/org/apache/maven/index/creator/ test/java/org/apache/maven/index/creator/

2011-08-17 Thread olamy
Author: olamy
Date: Wed Aug 17 19:05:41 2011
New Revision: 1158871

URL: http://svn.apache.org/viewvc?rev=1158871view=rev
Log:
[MINDEXER-36] index osgi metadatas.
Add support for :
* Bundle-Description
* Bundle-Name
* Bundle-License
* Bundle-DocURL
* Import-Package

Modified:

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/OSGI.java

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/creator/OSGIArtifactIndexCreatorTest.java

Modified: 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java?rev=1158871r1=1158870r2=1158871view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java
 (original)
+++ 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java
 Wed Aug 17 19:05:41 2011
@@ -244,6 +244,40 @@ public class ArtifactInfo
  */
 public String bundleExportService;
 
+/**
+ * contains osgi metadata Bundle-Description if available
+ * @since 4.1.2
+ */
+public String bundleDescription;
+
+/**
+ * contains osgi metadata Bundle-Name if available
+ * @since 4.1.2
+ */
+public String bundleName;
+
+/**
+ * contains osgi metadata Bundle-License if available
+ * @since 4.1.2
+ */
+public String bundleLicense;
+
+/**
+ * contains osgi metadata Bundle-DocURL if available
+ * @since 4.1.2
+ */
+public String bundleDocUrl;
+
+/**
+ * contains osgi metadata Import-Package if available
+ * @since 4.1.2
+ */
+public String bundleImportPackage;
+
+
+
+
+
 
 private String uinfo = null;
 

Modified: 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/OSGI.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/OSGI.java?rev=1158871r1=1158870r2=1158871view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/OSGI.java 
(original)
+++ 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/OSGI.java 
Wed Aug 17 19:05:41 2011
@@ -19,7 +19,7 @@ package org.apache.maven.index;
  */
 
 /**
- * Maven ontology.
+ * OSGI ontology.
  *
  * @author Olivier Lamy
  * @since 4.1.1
@@ -40,4 +40,15 @@ public interface OSGI
 
 Field EXPORT_SERVICE = new Field( null, OSGI_NAMESPACE, exportService, 
Bundle Export-Service );
 
+Field DESCRIPTION = new Field( null, OSGI_NAMESPACE, bundleDescription, 
Bundle-Description );
+
+Field NAME = new Field( null, OSGI_NAMESPACE, bundleName, Bundle-Name 
);
+
+Field LICENSE = new Field( null, OSGI_NAMESPACE, bundleLicense, 
Bundle-License );
+
+Field DOCURL = new Field( null, OSGI_NAMESPACE, bundleDocUrl, 
Bundle-DocURL );
+
+Field IMPORT_PACKAGE = new Field( null, OSGI_NAMESPACE, importPackage, 
Import-Package );
+
+
 }

Modified: 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java?rev=1158871r1=1158870r2=1158871view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java
 (original)
+++ 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/creator/OSGIArtifactIndexCreator.java
 Wed Aug 17 19:05:41 2011
@@ -90,10 +90,43 @@ public class OSGIArtifactIndexCreator
 new IndexerField( OSGI.EXPORT_SERVICE, IndexerFieldVersion.V4, BES, 
Export-Service (indexed, stored),
   Field.Store.YES, Field.Index.ANALYZED );
 
+
+private static final String BD = Bundle-Description;
+
+public static final IndexerField FLD_BUNDLE_DESCRIPTION =
+new IndexerField( OSGI.DESCRIPTION, IndexerFieldVersion.V4, BD, 
Bundle-Description (indexed, stored),
+  Field.Store.YES, Field.Index.ANALYZED );
+
+private static final String BN = Bundle-Name;
+
+public static final IndexerField FLD_BUNDLE_NAME =
+new IndexerField( OSGI.NAME, IndexerFieldVersion.V4, BN, Bundle-Name 
(indexed, stored), Field.Store.YES,
+  Field.Index.ANALYZED );
+
+private static final String BL = Bundle-License;
+
+public static final IndexerField FLD_BUNDLE_LICENSE =
+new IndexerField( OSGI.LICENSE, 

svn commit: r1158911 - in /maven/archetype/trunk: archetype-packaging/src/main/resources/META-INF/plexus/components.xml maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/AddArchety

2011-08-17 Thread hboutemy
Author: hboutemy
Date: Wed Aug 17 20:56:38 2011
New Revision: 1158911

URL: http://svn.apache.org/viewvc?rev=1158911view=rev
Log:
[ARCHETYPE-378] removed add-archetype-metadata goal, which seems a copy/paste 
without any real use

Removed:

maven/archetype/trunk/maven-archetype-plugin/src/main/java/org/apache/maven/archetype/mojos/AddArchetypeMetadataMojo.java
Modified:

maven/archetype/trunk/archetype-packaging/src/main/resources/META-INF/plexus/components.xml

Modified: 
maven/archetype/trunk/archetype-packaging/src/main/resources/META-INF/plexus/components.xml
URL: 
http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-packaging/src/main/resources/META-INF/plexus/components.xml?rev=1158911r1=1158910r2=1158911view=diff
==
--- 
maven/archetype/trunk/archetype-packaging/src/main/resources/META-INF/plexus/components.xml
 (original)
+++ 
maven/archetype/trunk/archetype-packaging/src/main/resources/META-INF/plexus/components.xml
 Wed Aug 17 20:56:38 2011
@@ -27,8 +27,7 @@
 phases
 
process-resourcesorg.apache.maven.plugins:maven-resources-plugin:resources/process-resources
 
process-test-resourcesorg.apache.maven.plugins:maven-resources-plugin:testResources/process-test-resources
-
packageorg.apache.maven.plugins:maven-archetype-plugin:jar,
- 
org.apache.maven.plugins:maven-archetype-plugin:add-archetype-metadata/package!--,
 AND METADATA LIKE MAVEN PLUGIN--
+
packageorg.apache.maven.plugins:maven-archetype-plugin:jar/package
 
integration-testorg.apache.maven.plugins:maven-archetype-plugin:integration-test/integration-test
 
installorg.apache.maven.plugins:maven-install-plugin:install,
  
org.apache.maven.plugins:maven-archetype-plugin:update-local-catalog/install!--
 Update the local catalog --




svn commit: r1158917 - in /maven/indexer/trunk/indexer-core/src: main/java/org/apache/maven/index/DefaultSearchEngine.java test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java

2011-08-17 Thread olamy
Author: olamy
Date: Wed Aug 17 21:16:25 2011
New Revision: 1158917

URL: http://svn.apache.org/viewvc?rev=1158917view=rev
Log:
[MINDEXER-38] searchFlat can return empty results with multiple index if the 
first used returns empty result

Modified:

maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultSearchEngine.java

maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java

Modified: 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultSearchEngine.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultSearchEngine.java?rev=1158917r1=1158916r2=1158917view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultSearchEngine.java
 (original)
+++ 
maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultSearchEngine.java
 Wed Aug 17 21:16:25 2011
@@ -164,17 +164,27 @@ public class DefaultSearchEngine
 {
 int hitCount = 0;
 
+SetArtifactInfo nonDuplicateResults = new TreeSetArtifactInfo( 
ArtifactInfo.VERSION_COMPARATOR );
+
+
 for ( IndexingContext context : participatingContexts )
 {
 final TopScoreDocCollector collector = doSearchWithCeiling( req, 
context.getIndexSearcher(), query );
 
+// olamy if the first context used doesn't find the other are not 
used for search
+// so the result can probably returns duplicate as artifactInfo 
doesn't implements hashCode/equals
+// so implements this in nonDuplicateResults
+/*
 if ( collector.getTotalHits() == 0 )
 {
 return 0;
 }
+*/
 
 ScoreDoc[] scoreDocs = collector.topDocs().scoreDocs;
 
+// uhm btw hitCount contains dups
+
 hitCount += collector.getTotalHits();
 
 int start = 0; // from == FlatSearchRequest.UNDEFINED ? 0 : from;
@@ -192,11 +202,14 @@ public class DefaultSearchEngine
 
 artifactInfo.context = context.getId();
 
-result.add( artifactInfo );
+nonDuplicateResults.add( artifactInfo );
+
 }
 }
 }
 
+result.addAll( nonDuplicateResults );
+
 return hitCount;
 }
 

Modified: 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java
URL: 
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java?rev=1158917r1=1158916r2=1158917view=diff
==
--- 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java
 (original)
+++ 
maven/indexer/trunk/indexer-core/src/test/java/org/apache/maven/index/SearchWithAnEmptyIndexTest.java
 Wed Aug 17 21:16:25 2011
@@ -31,6 +31,7 @@ import org.codehaus.plexus.util.FileUtil
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -70,10 +71,9 @@ public class SearchWithAnEmptyIndexTest
 }
 }
 
-public void testWithTwoContextWithOneEmpty()
+public void testWithTwoContextWithOneEmptyFirstInContextsListSearchFlat()
 throws Exception
 {
-createIndex( src/test/repo-with-osgi, target/test/repo-with-osgi/, 
INDEX_ID1 );
 
 String repoPath = target/test/empty-repo-for-searchtest;
 
@@ -89,6 +89,8 @@ public class SearchWithAnEmptyIndexTest
 //createIndex( /src/test/repo, repoPath + /.index, INDEX_ID2 );
 createIndex( repoPath, repoPath, INDEX_ID2 );
 
+createIndex( src/test/repo-with-osgi, target/test/repo-with-osgi/, 
INDEX_ID1 );
+
 try
 {
 BooleanQuery q = new BooleanQuery();
@@ -99,7 +101,9 @@ public class SearchWithAnEmptyIndexTest
 
 FlatSearchRequest request = new FlatSearchRequest( q );
 assertEquals( 2, 
nexusIndexer.getIndexingContexts().values().size() );
-request.setContexts( new ArrayList( 
nexusIndexer.getIndexingContexts().values() ) );
+request.setContexts( Arrays.asList( 
nexusIndexer.getIndexingContexts().get( INDEX_ID2 ),
+
nexusIndexer.getIndexingContexts().get( INDEX_ID1 ) ) );
+
 FlatSearchResponse response = nexusIndexer.searchFlat( request );
 
 assertEquals( 1, response.getResults().size() );
@@ -148,6 +152,58 @@ public class SearchWithAnEmptyIndexTest
 }
 }
 
+/**
+ * both repos contains commons-cli so ensure we don't return duplicates
+ */
+public void testSearchNoDuplicateArtifactInfo()
+throws Exception
+{
+
+String repoPathIndex = 

svn commit: r1158922 - /maven/core-integration-testing/trunk/.gitignore

2011-08-17 Thread brett
Author: brett
Date: Wed Aug 17 21:38:13 2011
New Revision: 1158922

URL: http://svn.apache.org/viewvc?rev=1158922view=rev
Log:
add IWS to the list

Modified:
maven/core-integration-testing/trunk/.gitignore

Modified: maven/core-integration-testing/trunk/.gitignore
URL: 
http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/.gitignore?rev=1158922r1=1158921r2=1158922view=diff
==
--- maven/core-integration-testing/trunk/.gitignore (original)
+++ maven/core-integration-testing/trunk/.gitignore Wed Aug 17 21:38:13 2011
@@ -6,3 +6,4 @@ target
 bin
 *.ipr
 *.iml
+*.iws




svn commit: r1158926 - /maven/sandbox/trunk/mae/mae-boms/mae-app-bom/pom.xml

2011-08-17 Thread jdcasey
Author: jdcasey
Date: Wed Aug 17 21:51:15 2011
New Revision: 1158926

URL: http://svn.apache.org/viewvc?rev=1158926view=rev
Log:
wrong groupId for project-tools dependency

Modified:
maven/sandbox/trunk/mae/mae-boms/mae-app-bom/pom.xml

Modified: maven/sandbox/trunk/mae/mae-boms/mae-app-bom/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-boms/mae-app-bom/pom.xml?rev=1158926r1=1158925r2=1158926view=diff
==
--- maven/sandbox/trunk/mae/mae-boms/mae-app-bom/pom.xml (original)
+++ maven/sandbox/trunk/mae/mae-boms/mae-app-bom/pom.xml Wed Aug 17 21:51:15 
2011
@@ -40,7 +40,7 @@
 version${project.version}/version
   /dependency
   dependency
-groupIdorg.apache.maven.mae/groupId
+groupIdorg.apache.maven.mae.components/groupId
 artifactIdmae-project-tools/artifactId
 version${project.version}/version
   /dependency




svn commit: r1158941 - in /maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar: AbstractJarMojo.java JarMojo.java TestJarMojo.java

2011-08-17 Thread rfscholte
Author: rfscholte
Date: Wed Aug 17 22:22:17 2011
New Revision: 1158941

URL: http://svn.apache.org/viewvc?rev=1158941view=rev
Log:
replace expression with default-value when the latter should be used.

Modified:

maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java

maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java

maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java

Modified: 
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java?rev=1158941r1=1158940r2=1158941view=diff
==
--- 
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java
 Wed Aug 17 22:22:17 2011
@@ -62,7 +62,7 @@ public abstract class AbstractJarMojo
 /**
  * Directory containing the generated JAR.
  *
- * @parameter expression=${project.build.directory}
+ * @parameter default-value=${project.build.directory}
  * @required
  */
 private File outputDirectory;
@@ -85,7 +85,7 @@ public abstract class AbstractJarMojo
 /**
  * The Maven project.
  *
- * @parameter expression=${project}
+ * @parameter default-value=${project}
  * @required
  * @readonly
  */
@@ -103,7 +103,7 @@ public abstract class AbstractJarMojo
  * Path to the default MANIFEST file to use. It will be used if
  * codeuseDefaultManifestFile/code is set to codetrue/code.
  *
- * @parameter 
expression=${project.build.outputDirectory}/META-INF/MANIFEST.MF
+ * @parameter 
default-value=${project.build.outputDirectory}/META-INF/MANIFEST.MF
  * @required
  * @readonly
  * @since 2.2

Modified: 
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java?rev=1158941r1=1158940r2=1158941view=diff
==
--- 
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/JarMojo.java
 Wed Aug 17 22:22:17 2011
@@ -38,7 +38,7 @@ public class JarMojo
 /**
  * Directory containing the classes and resource files that should be 
packaged into the JAR.
  *
- * @parameter expression=${project.build.outputDirectory}
+ * @parameter default-value=${project.build.outputDirectory}
  * @required
  */
 private File classesDirectory;

Modified: 
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java?rev=1158941r1=1158940r2=1158941view=diff
==
--- 
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/TestJarMojo.java
 Wed Aug 17 22:22:17 2011
@@ -48,7 +48,7 @@ public class TestJarMojo
 /**
  * Directory containing the test classes and resource files that should be 
packaged into the JAR.
  *
- * @parameter expression=${project.build.testOutputDirectory}
+ * @parameter default-value=${project.build.testOutputDirectory}
  * @required
  */
 private File testClassesDirectory;




svn commit: r1158978 - /maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo

2011-08-17 Thread hboutemy
Author: hboutemy
Date: Thu Aug 18 00:42:57 2011
New Revision: 1158978

URL: http://svn.apache.org/viewvc?rev=1158978view=rev
Log:
[DOXIASITETOOL-51] added a blank line before custom element to make it more 
visible in generated documentation

Modified:

maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo

Modified: 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo?rev=1158978r1=1158977r2=1158978view=diff
==
--- 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
 (original)
+++ 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/mdo/decoration.mdo
 Thu Aug 18 00:42:57 2011
@@ -124,7 +124,7 @@ under the License.
   /association
   identifiertrue/identifier
 /field
-field
+field xdoc.separator=blank
   namecustom/name
   descriptionCustom configuration for use with customized Velocity 
templates./description
   version1.0.0+/version




svn commit: r1158995 [2/2] - in /maven/sandbox/trunk/mae: ./ mae-api/ mae-api/src/main/java/org/apache/maven/mae/conf/ mae-api/src/main/java/org/apache/maven/mae/internal/container/ mae-api/src/test/j

2011-08-17 Thread jdcasey
Added: 
maven/sandbox/trunk/mae/mae-booter/src/test/java/org/apache/maven/mae/internal/container/MAEApplicationTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-booter/src/test/java/org/apache/maven/mae/internal/container/MAEApplicationTest.java?rev=1158995view=auto
==
--- 
maven/sandbox/trunk/mae/mae-booter/src/test/java/org/apache/maven/mae/internal/container/MAEApplicationTest.java
 (added)
+++ 
maven/sandbox/trunk/mae/mae-booter/src/test/java/org/apache/maven/mae/internal/container/MAEApplicationTest.java
 Thu Aug 18 02:25:18 2011
@@ -0,0 +1,174 @@
+/*
+ * 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
+ * 
+ * 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.mae.internal.container;
+
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import org.apache.maven.mae.MAEException;
+import org.apache.maven.mae.app.AbstractMAEApplication;
+import org.apache.maven.mae.boot.embed.MAEEmbedderBuilder;
+import org.apache.maven.mae.internal.container.fixture.ContainerOwner;
+import org.junit.Test;
+
+public class MAEApplicationTest
+{
+
+@Test
+// @Ignore
+public void injectContainerIntoExternalInstance()
+throws Exception
+{
+ContainerOwner owner = new ContainerOwner();
+new TestApplication().withInstance( owner ).load();
+
+assertThat( owner.container, notNullValue() );
+}
+
+@Test
+// @Ignore
+public void loadBare()
+throws Exception
+{
+new TestApplication().load();
+}
+
+@Test
+public void loadTwoApplications()
+throws MAEException
+{
+ContainerOwner owner = new ContainerOwner();
+new TestApplication().load();
+
+assertThat( Container holder should not have a container instance 
after unrelated application is loaded.,
+owner.container, nullValue() );
+
+new TestApplication().withInstance( owner ).load();
+
+assertThat( Container holder should have a container instance after 
application with its registered instance is loaded.,
+owner.container, notNullValue() );
+}
+
+// @Test
+// public void mappedRequirementContainsNoLiteralIds()
+// throws Throwable
+// {
+// final ContainerConfiguration config = new 
DefaultContainerConfiguration().setClassPathScanning( ON );
+//
+// final MAEContainer container = new MAEContainer( config, new 
ComponentSelector(), new InstanceRegistry() );
+//
+// final MapOwner mapOwner = container.lookup( MapOwner.class );
+// final MapString, Child members = mapOwner.members();
+//
+// System.out.println( members );
+//
+// assertNull( members.get( simple + ComponentKey.LITERAL_SUFFIX ) );
+// }
+//
+// @Test
+// public void singletonImpliedRequirementOnComponentWithImpliedHint()
+// throws Throwable
+// {
+// final ContainerConfiguration config = new 
DefaultContainerConfiguration().setClassPathScanning( ON );
+//
+// final MAEContainer container = new MAEContainer( config, new 
ComponentSelector(), new InstanceRegistry() );
+//
+// final DefaultSingletonOwner owner = container.lookup( 
DefaultSingletonOwner.class );
+//
+// assertNotNull( owner.singleton() );
+// }
+//
+// @Test
+// public void singletonNonLiteralRequirement()
+// throws Throwable
+// {
+// final ContainerConfiguration config = new 
DefaultContainerConfiguration().setClassPathScanning( ON );
+//
+// final MAEContainer container = new MAEContainer( config, new 
ComponentSelector(), new InstanceRegistry() );
+//
+// final SingletonOwner owner = container.lookup( SingletonOwner.class );
+//
+// assertNotNull( owner.singleton() );
+// }
+//
+// @Test
+// public void singletonLiteralRequirement()
+// throws Throwable
+// {
+// final ContainerConfiguration config = new 
DefaultContainerConfiguration().setClassPathScanning( ON );
+//
+// final MAEContainer container = new MAEContainer( config, new 
ComponentSelector(), 

svn commit: r1158996 - in /maven/sandbox/trunk/mae/mae-booter/src: main/java/org/apache/maven/mae/boot/embed/ComponentSelectionModule.java test/java/org/apache/maven/mae/internal/container/MAEApplicat

2011-08-17 Thread jdcasey
Author: jdcasey
Date: Thu Aug 18 02:33:53 2011
New Revision: 1158996

URL: http://svn.apache.org/viewvc?rev=1158996view=rev
Log:
enabling a couple more tests (that don't work), and annotating sites to fix in 
the component-selection module

Modified:

maven/sandbox/trunk/mae/mae-booter/src/main/java/org/apache/maven/mae/boot/embed/ComponentSelectionModule.java

maven/sandbox/trunk/mae/mae-booter/src/test/java/org/apache/maven/mae/internal/container/MAEApplicationTest.java

Modified: 
maven/sandbox/trunk/mae/mae-booter/src/main/java/org/apache/maven/mae/boot/embed/ComponentSelectionModule.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-booter/src/main/java/org/apache/maven/mae/boot/embed/ComponentSelectionModule.java?rev=1158996r1=1158995r2=1158996view=diff
==
--- 
maven/sandbox/trunk/mae/mae-booter/src/main/java/org/apache/maven/mae/boot/embed/ComponentSelectionModule.java
 (original)
+++ 
maven/sandbox/trunk/mae/mae-booter/src/main/java/org/apache/maven/mae/boot/embed/ComponentSelectionModule.java
 Thu Aug 18 02:33:53 2011
@@ -72,6 +72,7 @@ public class ComponentSelectionModule
 private static final class ComponentSelectionInjectorT
 implements MembersInjectorT
 {
+// FIXME: This is NOT being injected!!
 @Inject
 private Injector injector;
 

Modified: 
maven/sandbox/trunk/mae/mae-booter/src/test/java/org/apache/maven/mae/internal/container/MAEApplicationTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-booter/src/test/java/org/apache/maven/mae/internal/container/MAEApplicationTest.java?rev=1158996r1=1158995r2=1158996view=diff
==
--- 
maven/sandbox/trunk/mae/mae-booter/src/test/java/org/apache/maven/mae/internal/container/MAEApplicationTest.java
 (original)
+++ 
maven/sandbox/trunk/mae/mae-booter/src/test/java/org/apache/maven/mae/internal/container/MAEApplicationTest.java
 Thu Aug 18 02:33:53 2011
@@ -27,6 +27,9 @@ import org.apache.maven.mae.MAEException
 import org.apache.maven.mae.app.AbstractMAEApplication;
 import org.apache.maven.mae.boot.embed.MAEEmbedderBuilder;
 import org.apache.maven.mae.internal.container.fixture.ContainerOwner;
+import org.apache.maven.mae.internal.container.fixture.DefaultSingletonOwner;
+import org.apache.maven.mae.internal.container.fixture.SingletonLiteralOwner;
+import org.apache.maven.mae.internal.container.fixture.SingletonOwner;
 import org.junit.Test;
 
 public class MAEApplicationTest
@@ -82,45 +85,40 @@ public class MAEApplicationTest
 //
 // assertNull( members.get( simple + ComponentKey.LITERAL_SUFFIX ) );
 // }
-//
-// @Test
-// public void singletonImpliedRequirementOnComponentWithImpliedHint()
-// throws Throwable
-// {
-// final ContainerConfiguration config = new 
DefaultContainerConfiguration().setClassPathScanning( ON );
-//
-// final MAEContainer container = new MAEContainer( config, new 
ComponentSelector(), new InstanceRegistry() );
-//
-// final DefaultSingletonOwner owner = container.lookup( 
DefaultSingletonOwner.class );
-//
-// assertNotNull( owner.singleton() );
-// }
-//
-// @Test
-// public void singletonNonLiteralRequirement()
-// throws Throwable
-// {
-// final ContainerConfiguration config = new 
DefaultContainerConfiguration().setClassPathScanning( ON );
-//
-// final MAEContainer container = new MAEContainer( config, new 
ComponentSelector(), new InstanceRegistry() );
-//
-// final SingletonOwner owner = container.lookup( SingletonOwner.class );
-//
-// assertNotNull( owner.singleton() );
-// }
-//
-// @Test
-// public void singletonLiteralRequirement()
-// throws Throwable
-// {
-// final ContainerConfiguration config = new 
DefaultContainerConfiguration().setClassPathScanning( ON );
-//
-// final MAEContainer container = new MAEContainer( config, new 
ComponentSelector(), new InstanceRegistry() );
-//
-// final SingletonLiteralOwner owner = container.lookup( 
SingletonLiteralOwner.class );
-//
-// assertNotNull( owner.singletonLiteral() );
-// }
+
+@Test
+public void singletonImpliedRequirementOnComponentWithImpliedHint()
+throws Throwable
+{
+ContainerOwner owner = new ContainerOwner();
+new TestApplication().load();
+final DefaultSingletonOwner single = owner.container.lookup( 
DefaultSingletonOwner.class );
+
+assertThat( single.singleton(), notNullValue() );
+}
+
+@Test
+public void singletonNonLiteralRequirement()
+throws Throwable
+{
+ContainerOwner owner = new ContainerOwner();
+new TestApplication().load();
+final SingletonOwner single = owner.container.lookup( 
SingletonOwner.class );
+
+assertThat( 

svn commit: r1158999 - in /maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site: apt/using-decoration-xsd.apt site.xml

2011-08-17 Thread hboutemy
Author: hboutemy
Date: Thu Aug 18 02:47:32 2011
New Revision: 1158999

URL: http://svn.apache.org/viewvc?rev=1158999view=rev
Log:
removed manual documentation on using decoration XML Schema since it is now in 
the xdoc documentation generated by Modello

Removed:

maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/apt/using-decoration-xsd.apt
Modified:
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml

Modified: 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml?rev=1158999r1=1158998r2=1158999view=diff
==
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml 
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml 
Thu Aug 18 02:47:32 2011
@@ -31,7 +31,6 @@
 
 menu name=Schema Decoration 1.0
   item name=Reference of Schema Decoration href=decoration.html/
-  item name=Using Schema Decoration href=using-decoration-xsd.html/
 /menu
 
 menu ref=reports/




svn commit: r1159000 - /maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml

2011-08-17 Thread hboutemy
Author: hboutemy
Date: Thu Aug 18 02:48:53 2011
New Revision: 1159000

URL: http://svn.apache.org/viewvc?rev=1159000view=rev
Log:
improved menu labels

Modified:
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml

Modified: 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml?rev=1159000r1=1158999r2=1159000view=diff
==
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml 
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/site.xml 
Thu Aug 18 02:48:53 2011
@@ -29,8 +29,8 @@
 
 menu ref=parent/
 
-menu name=Schema Decoration 1.0
-  item name=Reference of Schema Decoration href=decoration.html/
+menu name=Documentation
+  item name=Decoration Model Reference href=decoration.html/
 /menu
 
 menu ref=reports/




svn commit: r1159001 - /maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/apt/index.apt

2011-08-17 Thread hboutemy
Author: hboutemy
Date: Thu Aug 18 02:56:34 2011
New Revision: 1159001

URL: http://svn.apache.org/viewvc?rev=1159001view=rev
Log:
added an enhanced index page

Added:

maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/apt/index.apt 
  (with props)

Added: 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/apt/index.apt
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/apt/index.apt?rev=1159001view=auto
==
--- 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/apt/index.apt 
(added)
+++ 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/apt/index.apt 
Thu Aug 18 02:56:34 2011
@@ -0,0 +1,21 @@
+ -
+ Doxia Sitetool Decoration Model
+ -
+ Hervé Boutemy
+ -
+ 2011-08-18
+ -
+
+Doxia Sitetool Decoration Model
+
+ This is strictly the model for Doxia Sitetool Decoration Model, used in 
maven-site-plugin as site.xml.
+
+ The following are generated from this model:
+
+   * {{{./apidocs/index.html}Java sources}} with Reader and Writers for the 
Xpp3 XML parser
+
+   * A {{{./decoration.html}Descriptor Reference}}
+
+   * An XSD referenced in the {{{./decoration.html}Descriptor Reference}}.
+
+ Inheritance algorithm is added to merge the decoration between a parent and a 
child.

Propchange: 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/apt/index.apt
--
svn:eol-style = native

Propchange: 
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/site/apt/index.apt
--
svn:keywords = Author Date Id Revision




svn commit: r1159005 - in /maven/doxia/doxia-sitetools/trunk: doxia-decoration-model/pom.xml doxia-doc-renderer/pom.xml doxia-site-renderer/pom.xml

2011-08-17 Thread hboutemy
Author: hboutemy
Date: Thu Aug 18 03:05:02 2011
New Revision: 1159005

URL: http://svn.apache.org/viewvc?rev=1159005view=rev
Log:
tried to improve descriptions

Modified:
maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/pom.xml
maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/pom.xml
maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/pom.xml

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/pom.xml?rev=1159005r1=1159004r2=1159005view=diff
==
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/pom.xml (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/pom.xml Thu Aug 18 
03:05:02 2011
@@ -31,8 +31,8 @@ under the License.
 
   artifactIddoxia-decoration-model/artifactId
 
-  nameDoxia Sitetools :: Decoration Model/name
-  descriptionThe Decoration Model handles the site descriptor, also known as 
site.xml./description
+  nameDecoration Model/name
+  descriptionThe Decoration Model handles the decoration descriptor for 
sites, also known as site.xml./description
   
urlhttp://maven.apache.org/doxia/doxia-sitetools/doxia-decoration-model//url
 
   dependencies

Modified: maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/pom.xml?rev=1159005r1=1159004r2=1159005view=diff
==
--- maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/pom.xml (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/pom.xml Thu Aug 18 
03:05:02 2011
@@ -31,7 +31,7 @@ under the License.
 
   artifactIddoxia-doc-renderer/artifactId
 
-  nameDoxia Sitetools :: Document Renderer Component/name
+  nameDocument Renderer/name
   descriptionThe Document Renderer handles the rendering of documents, in 
formats like PDF and RTF./description
   urlhttp://maven.apache.org/doxia/doxia-sitetools/doxia-doc-renderer//url
 

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/pom.xml?rev=1159005r1=1159004r2=1159005view=diff
==
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/pom.xml (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/pom.xml Thu Aug 18 
03:05:02 2011
@@ -30,8 +30,9 @@ under the License.
   /parent
 
   artifactIddoxia-site-renderer/artifactId
-  nameDoxia Sitetools :: Site Renderer Component/name
-  descriptionThe Site Renderer handles the rendering of sites./description
+
+  nameSite Renderer/name
+  descriptionThe Site Renderer handles the rendering of sites, merging site 
decoration with document content./description
   urlhttp://maven.apache.org/doxia/doxia-sitetools/doxia-site-renderer//url
 
   contributors




svn commit: r1159009 - /maven/doxia/doxia-sitetools/trunk/src/site/xdoc/index.xml

2011-08-17 Thread hboutemy
Author: hboutemy
Date: Thu Aug 18 03:14:22 2011
New Revision: 1159009

URL: http://svn.apache.org/viewvc?rev=1159009view=rev
Log:
improved introduction

Modified:
maven/doxia/doxia-sitetools/trunk/src/site/xdoc/index.xml

Modified: maven/doxia/doxia-sitetools/trunk/src/site/xdoc/index.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/src/site/xdoc/index.xml?rev=1159009r1=1159008r2=1159009view=diff
==
--- maven/doxia/doxia-sitetools/trunk/src/site/xdoc/index.xml (original)
+++ maven/doxia/doxia-sitetools/trunk/src/site/xdoc/index.xml Thu Aug 18 
03:14:22 2011
@@ -19,7 +19,9 @@
  */
 --
 
-document
+document xmlns=http://maven.apache.org/XDOC/2.0;
+  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation=http://maven.apache.org/XDOC/2.0 
http://maven.apache.org/xsd/xdoc-2.0.xsd;
 
   properties
 titleDoxia Sitetools/title
@@ -30,20 +32,20 @@
 
 section name=Doxia Sitetools
 
-  pDoxia Sitetools generates sites, consisting of static and dynamic 
content that was generated by Doxia./p
+  pDoxia Sitetools generates either sites, consisting of decoration and 
content that was generated by Doxia, or documents like RTF or PDF./p
 
   p
-img src=images/doxia-sitetools-deps.png width=482 height=217 
border=0 usemap=#Doxia_sitetools_dependencies /
-map name=Doxia_sitetools_dependencies
-  area shape=rect coords=40,0,164,31 href=doxia-site-renderer/ 
/
-  area shape=rect coords=300,0,423,31 href=doxia-doc-renderer/ 
/
-  area shape=rect coords=20,135,184,167 
href=doxia-decoration-model/ /
-  area shape=rect coords=0,57,84,87 
href=http://velocity.apache.org; /
-  area shape=rect coords=111,58,236,88 
href=http://maven.apache.org/doxia/doxia/doxia-modules/doxia-module-xhtml/; /
-  area shape=rect coords=251,57,354,89 
href=http://maven.apache.org/doxia/doxia/doxia-modules/doxia-module-fo/; /
-  area shape=rect coords=356,57,478,88 
href=http://maven.apache.org/doxia/doxia/doxia-modules/doxia-module-itext/; /
-  area shape=rect coords=106,53,481,119 
href=http://maven.apache.org/doxia/doxia/doxia-modules/; /
-  area shape=rect coords=182,186,285,216 
href=http://plexus.codehaus.org/; /
+img src=images/doxia-sitetools-deps.png width=482 height=217 
border=0 usemap=#Doxia_sitetools_dependencies alt=Doxia Sitetools 
Dependencies/
+map name=Doxia_sitetools_dependencies 
id=Doxia_sitetools_dependencies
+  area shape=rect coords=40,0,164,31 href=doxia-site-renderer/ 
alt=Doxia Site Renderer/
+  area shape=rect coords=300,0,423,31 href=doxia-doc-renderer/  
alt=Doxia Document Renderer/
+  area shape=rect coords=20,135,184,167 
href=doxia-decoration-model/ alt=Doxia Decoration Model/
+  area shape=rect coords=0,57,84,87 
href=http://velocity.apache.org; alt=Velocity/
+  area shape=rect coords=111,58,236,88 
href=http://maven.apache.org/doxia/doxia/doxia-modules/doxia-module-xhtml/; 
alt=Doxia Module XHTML/
+  area shape=rect coords=251,57,354,89 
href=http://maven.apache.org/doxia/doxia/doxia-modules/doxia-module-fo/; 
alt=Doxia Module FO/
+  area shape=rect coords=356,57,478,88 
href=http://maven.apache.org/doxia/doxia/doxia-modules/doxia-module-itext/; 
alt=Doxia Module iText/
+  area shape=rect coords=106,53,481,119 
href=http://maven.apache.org/doxia/doxia/doxia-modules/; alt=Doxia Modules/
+  area shape=rect coords=182,186,285,216 
href=http://plexus.codehaus.org/plexus-utils/;  alt=plexus-utils/
 /map
   /p
 




svn commit: r1159010 - /maven/doxia/doxia-sitetools/trunk/src/site/site.xml

2011-08-17 Thread hboutemy
Author: hboutemy
Date: Thu Aug 18 03:17:07 2011
New Revision: 1159010

URL: http://svn.apache.org/viewvc?rev=1159010view=rev
Log:
removed Downloads menu that has no real meaning for components (available from 
central repository like every components)

Modified:
maven/doxia/doxia-sitetools/trunk/src/site/site.xml

Modified: maven/doxia/doxia-sitetools/trunk/src/site/site.xml
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/src/site/site.xml?rev=1159010r1=1159009r2=1159010view=diff
==
--- maven/doxia/doxia-sitetools/trunk/src/site/site.xml (original)
+++ maven/doxia/doxia-sitetools/trunk/src/site/site.xml Thu Aug 18 03:17:07 2011
@@ -50,10 +50,6 @@
   item name=Doxia Site Tools 
href=http://maven.apache.org/doxia/doxia-sitetools/index.html; /
 /breadcrumbs
 
-menu name=Downloads inherit=bottom
-  item name=Download ${project.name} 
href=http://maven.apache.org/doxia/downloads.html/
-/menu
-
 menu ref=modules/
 
 menu ref=reports/