archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [18/31] archiva git commit: fixing test for rest services, correctly close jcr repo
Date Sat, 19 Aug 2017 11:40:58 GMT
fixing test for rest services, correctly close jcr repo

Signed-off-by: olivier lamy <olamy@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/789f879c
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/789f879c
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/789f879c

Branch: refs/heads/master
Commit: 789f879c3bba01a8188416b7adf11d89291356f0
Parents: e4ef827
Author: olivier lamy <olamy@apache.org>
Authored: Mon Aug 14 17:20:12 2017 +1000
Committer: olivier lamy <olamy@apache.org>
Committed: Mon Aug 14 17:20:12 2017 +1000

----------------------------------------------------------------------
 .../archiva/mock/MockRepositorySessionFactory.java   |  6 ++++++
 .../archiva-rest/archiva-rest-services/pom.xml       |  3 ++-
 .../rest/services/AbstractArchivaRestTest.java       |  3 +++
 .../webtest/memory/TestRepositorySessionFactory.java |  6 ++++++
 .../repository/RepositorySessionFactory.java         |  2 ++
 .../cassandra/CassandraRepositorySessionFactory.java |  6 ++++++
 .../file/FileRepositorySessionFactory.java           | 15 ++++++---------
 archiva-modules/plugins/metadata-store-jcr/pom.xml   |  6 +++++-
 .../metadata/repository/jcr/RepositoryFactory.java   |  8 ++++++--
 .../src/test/resources/log4j2-test.xml               |  4 +---
 pom.xml                                              |  2 +-
 11 files changed, 44 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java
b/archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java
index a1a27dc..d293d52 100644
--- a/archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java
+++ b/archiva-modules/archiva-base/archiva-mock/src/main/java/org/apache/archiva/mock/MockRepositorySessionFactory.java
@@ -73,4 +73,10 @@ public class MockRepositorySessionFactory
             }
         };
     }
+
+    @Override
+    public void close()
+    {
+        // no op
+    }
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
index f69d776..fd293fa 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
@@ -435,11 +435,12 @@
         <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>

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
index 0d924f7..bc1b545 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/AbstractArchivaRestTest.java
@@ -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
     {

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java
b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java
index 0e10a52..31e5a29 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java
+++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestRepositorySessionFactory.java
@@ -55,4 +55,10 @@ public class TestRepositorySessionFactory
     {
         return this;
     }
+
+    @Override
+    public void close()
+    {
+        // no op
+    }
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java
----------------------------------------------------------------------
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java
b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java
index ff6be95..ba2c585 100644
--- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java
+++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/RepositorySessionFactory.java
@@ -22,4 +22,6 @@ package org.apache.archiva.metadata.repository;
 public interface RepositorySessionFactory
 {
     RepositorySession createSession();
+
+    void close();
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java
b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java
index d45e2cb..2e434fc 100644
--- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java
+++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraRepositorySessionFactory.java
@@ -82,4 +82,10 @@ public class CassandraRepositorySessionFactory
         return new RepositorySession( metadataRepository, metadataResolver );
     }
 
+
+    @Override
+    public void close()
+    {
+        cassandraArchivaManager.shutdown();
+    }
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java
b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java
index 0d63f4e..ce640fe 100644
--- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java
+++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileRepositorySessionFactory.java
@@ -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
+    }
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/plugins/metadata-store-jcr/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/metadata-store-jcr/pom.xml b/archiva-modules/plugins/metadata-store-jcr/pom.xml
index fc6976c..43522a0 100644
--- a/archiva-modules/plugins/metadata-store-jcr/pom.xml
+++ b/archiva-modules/plugins/metadata-store-jcr/pom.xml
@@ -165,7 +165,11 @@
       <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>

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java
b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java
index c02e71f..b1b821d 100644
--- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java
+++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/RepositoryFactory.java
@@ -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 )
         {

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml
b/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml
index 50dab92..7f4b0cd 100644
--- a/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml
+++ b/archiva-modules/plugins/metadata-store-jcr/src/test/resources/log4j2-test.xml
@@ -19,9 +19,7 @@
   -->
 
 
-<configuration>
-
-
+<configuration status="debug">
 
   <appenders>
     <Console name="console" target="SYSTEM_OUT">

http://git-wip-us.apache.org/repos/asf/archiva/blob/789f879c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4dc86ac..0a8fc1c 100644
--- 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>


Mime
View raw message