Browse files

[maven-release-plugin] copy for tag nexus-indexer-1.1.2.1

git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/tags/nexus-indexer-1.1.2.1@2712 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information...
1 parent 9b2529d commit 818c301b7a73f8a618825cae633c8d444aa3e115 mpowers committed Dec 15, 2008
Showing with 95 additions and 2 deletions.
  1. +8 −2 pom.xml
  2. +87 −0 src/test/java/org/sonatype/nexus/index/FSDirectoryDeleteTest.java
View
10 pom.xml
@@ -4,13 +4,13 @@
<parent>
<groupId>org.sonatype.nexus</groupId>
<artifactId>nexus-parent</artifactId>
- <version>7-SNAPSHOT</version>
+ <version>7</version>
<relativePath>../nexus-parent/pom.xml</relativePath>
</parent>
<groupId>org.sonatype.nexus</groupId>
<artifactId>nexus-indexer</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.1.2.1</version>
<name>Sonatype Nexus: Indexer</name>
@@ -287,4 +287,10 @@
<timezone>-5</timezone>
</developer>
</developers>
+
+ <scm>
+ <connection>scm:svn:http://svn.sonatype.org/nexus/tags/nexus-indexer-1.1.2.1</connection>
+ <developerConnection>scm:svn:https://svn.sonatype.org/nexus/tags/nexus-indexer-1.1.2.1</developerConnection>
+ <url>http://svn.sonatype.org/nexus/tags/nexus-indexer-1.1.2.1</url>
+ </scm>
</project>
View
87 src/test/java/org/sonatype/nexus/index/FSDirectoryDeleteTest.java
@@ -0,0 +1,87 @@
+package org.sonatype.nexus.index;
+
+import java.io.File;
+
+import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.FSDirectory;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.FileUtils;
+import org.sonatype.nexus.index.context.IndexingContext;
+
+public class FSDirectoryDeleteTest
+ extends PlexusTestCase
+{
+ protected NexusIndexer nexusIndexer;
+
+ protected File repo = new File( getBasedir(), "src/test/nexus-13" );
+
+ protected IndexingContext context;
+ protected File indexDirFile = new File( getBasedir(), "target/fsdirectorytest/one" );
+ protected Directory indexDir;
+
+ protected IndexingContext otherContext;
+ protected File otherIndexDirFile = new File( getBasedir(), "target/fsdirectorytest/other" );
+ protected Directory otherIndexDir;
+
+ @Override
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ nexusIndexer = (NexusIndexer) lookup( NexusIndexer.class );
+
+ indexDir = FSDirectory.getDirectory( indexDirFile );
+
+ context = nexusIndexer.addIndexingContext(
+ "one",
+ "nexus-13",
+ repo,
+ indexDir,
+ null,
+ null,
+ NexusIndexer.DEFAULT_INDEX, false );
+
+ nexusIndexer.scan( context );
+
+ otherIndexDir = FSDirectory.getDirectory( otherIndexDirFile );
+
+ otherContext = nexusIndexer.addIndexingContext(
+ "other",
+ "nexus-13",
+ repo,
+ otherIndexDir,
+ null,
+ null,
+ NexusIndexer.DEFAULT_INDEX, false );
+
+ nexusIndexer.scan( otherContext );
+ }
+
+ @Override
+ protected void tearDown()
+ throws Exception
+ {
+ super.tearDown();
+
+ nexusIndexer.removeIndexingContext( context, true );
+
+ nexusIndexer.removeIndexingContext( otherContext, true );
+
+ FileUtils.deleteDirectory( indexDirFile );
+
+ FileUtils.deleteDirectory( otherIndexDirFile );
+ }
+
+ public void testIndexAndDelete()
+ throws Exception
+ {
+ context.getIndexReader().maxDoc();
+
+ otherContext.getIndexReader().maxDoc();
+
+ context.replace( otherIndexDir );
+
+ context.merge( otherIndexDir );
+ }
+}

0 comments on commit 818c301

Please sign in to comment.