]> source.dussan.org Git - archiva.git/commitdiff
fixing test for rest services, correctly close jcr repo
authorolivier lamy <olamy@apache.org>
Mon, 14 Aug 2017 07:20:12 +0000 (17:20 +1000)
committerolivier lamy <olamy@apache.org>
Mon, 14 Aug 2017 07:20:12 +0000 (17:20 +1000)
Signed-off-by: olivier lamy <olamy@apache.org>
archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java
archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java
archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java
archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java
archiva-modules/plugins/metadata-store-jcr/pom.xml
archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java
archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml
pom.xml

index a1a27dcb9b5fa125649f7c38dd3de0ddf9b51631..d293d5247854bdc820eb1614a75535cb44ff5e25 100644 (file)
@@ -73,4 +73,10 @@ public class MockRepositorySessionFactory
             }
         };
     }
+
+    @Override
+    public void close()
+    {
+        // no op
+    }
 }
index f69d776d270d05468651b74ee54876ee2d08c9ef..fd293fa26e01289e77b645d2b6c66e8f3dddbf57 100644 (file)
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
+          <reuseForks>false</reuseForks>
           <includes>
             <include>**/*Tests.java</include>
             <include>**/*Test.java</include>
           </includes>
-          <argLine>-Xms1024m -Xmx2048m -server -XX:MaxPermSize=256m @{jacocoproperty}</argLine>
+          <argLine>-Xms1024m -Xmx3072m -server -XX:MaxPermSize=256m @{jacocoproperty}</argLine>
           <systemPropertyVariables>
             <appserver.base>${project.build.directory}/appserver-base</appserver.base>
             <plexus.home>${project.build.directory}/appserver-base</plexus.home>
index 0d924f723075b8cbd03418828a933c64b4f3848c..bc1b545ab10ecb00bd65120fec85ad2c8b6e7cb5 100644 (file)
@@ -45,6 +45,7 @@ import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 import org.apache.cxf.jaxrs.client.WebClient;
+import org.junit.After;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -77,6 +78,7 @@ public abstract class AbstractArchivaRestTest
 
     // END SNIPPET: authz-header
 
+
     @BeforeClass
     public static void chekRepo()
     {
@@ -102,6 +104,7 @@ public abstract class AbstractArchivaRestTest
         super.startServer();
     }
 
+
     private void removeAppsubFolder( File appServerBase, String folder )
         throws Exception
     {
index d45e2cb10981e5df0ffeeeb19f897afd73e9cc20..2e434fc6efc6f6cc193f60d823d037bd26d9f368 100644 (file)
@@ -82,4 +82,10 @@ public class CassandraRepositorySessionFactory
         return new RepositorySession( metadataRepository, metadataResolver );
     }
 
+
+    @Override
+    public void close()
+    {
+        cassandraArchivaManager.shutdown();
+    }
 }
index 0d63f4ee9a37c728c426e727e85dbd16f8cf00c2..ce640fe1d1d2053e06aa5bed52ef230234e02612 100644 (file)
@@ -42,21 +42,12 @@ import java.util.Map;
 public class FileRepositorySessionFactory
     implements RepositorySessionFactory
 {
-    /**
-     *
-     */
     private Map<String, MetadataFacetFactory> metadataFacetFactories;
 
-    /**
-     *
-     */
     @Inject
     @Named( value = "archivaConfiguration#default" )
     private ArchivaConfiguration configuration;
 
-    /**
-     *
-     */
     @Inject
     private MetadataResolver metadataResolver;
 
@@ -87,4 +78,10 @@ public class FileRepositorySessionFactory
 
         return new RepositorySession( metadataRepository, metadataResolver );
     }
+
+    @Override
+    public void close()
+    {
+        // no op
+    }
 }
index fc6976c0883a9fb52cecff1c4939929391c2830f..43522a0cd635dc680f46cfa50fddddf6a205aa4c 100644 (file)
       <artifactId>lucene-analyzers-common</artifactId>
       <version>${lucene.version}</version>
     </dependency>
-
+    <dependency>
+      <groupId>io.dropwizard.metrics</groupId>
+      <artifactId>metrics-core</artifactId>
+      <version>3.1.0</version>
+    </dependency>
   </dependencies>
   <build>
     <testResources>
index c02e71f76c08e5aba556ca0cf146dbe4cad628e7..b1b821dc89e8776eb210aaff0a51806d98556a32 100644 (file)
@@ -77,6 +77,8 @@ public class RepositoryFactory
 
     private FileStore fileStore;
 
+    private NodeStore nodeStore;
+
     private ExecutorService executorService;
 
     public enum StoreType
@@ -93,11 +95,13 @@ public class RepositoryFactory
         throws IOException, InvalidFileStoreVersionException
     {
         createExecutor();
-        NodeStore nodeStore;
+
         if ( SEGMENT_FILE_TYPE == storeType )
         {
             fileStore = FileStoreBuilder.fileStoreBuilder( repositoryPath.toFile() ).build();
-            nodeStore = SegmentNodeStoreBuilders.builder( fileStore ).build();
+            nodeStore = SegmentNodeStoreBuilders.builder( fileStore ) //
+                .withStatisticsProvider( StatisticsProvider.NOOP ) //
+                .build();
         }
         else if ( IN_MEMORY_TYPE == storeType )
         {
index 50dab921b307f38ec521f57b23012d4a8626eda6..7f4b0cd9c932bba5c49c136f9e1d62f7b35e5068 100644 (file)
@@ -19,9 +19,7 @@
   -->
 
 
-<configuration>
-
-
+<configuration status="debug">
 
   <appenders>
     <Console name="console" target="SYSTEM_OUT">
diff --git a/pom.xml b/pom.xml
index 4dc86ac777e599bc8d0f9328c3a2a450983f5351..0a8fc1cf7730697d622ac0077a58acb024c928a4 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -78,7 +78,7 @@
     <surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
     <lucene.version>4.10.4</lucene.version>
 
-    <jcr-oak.version>1.7.3</jcr-oak.version>
+    <jcr-oak.version>1.7.5</jcr-oak.version>
     <jackrabbit.version>2.15.4</jackrabbit.version>
 
     <cxf.version>3.0.3</cxf.version>