]> source.dussan.org Git - archiva.git/commitdiff
use testcontainers to run cassandra tests (#79)
authorOlivier Lamy <olamy@apache.org>
Sun, 17 Apr 2022 11:31:02 +0000 (21:31 +1000)
committerGitHub <noreply@github.com>
Sun, 17 Apr 2022 11:31:02 +0000 (21:31 +1000)
* use testcontainers for cassandra test

Signed-off-by: Olivier Lamy <olamy@apache.org>
13 files changed:
archiva-cli/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/test/test-settings.xml
archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/pom.xml
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/filtered-resources/META-INF/spring-context.xml [deleted file]
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/RepositoriesNamespaceTest.java
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/resources/META-INF/spring-context.xml [new file with mode: 0644]
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/resources/log4j2-test.xml
archiva-modules/metadata/metadata-store-provider/oak-jcr/metadata-store-jcr/src/test/resources/log4j2-test.xml
archiva-modules/metadata/metadata-store-provider/oak-jcr/oak-jcr-lucene/pom.xml
pom.xml

index 9359d81bbd0a214c006ca92f79f1da3752c44145..88f3c27e01b0436998db770ceb69c602d64d3c91 100644 (file)
@@ -91,6 +91,7 @@
               <goal>shade</goal>
             </goals>
             <configuration>
+              <createDependencyReducedPom>false</createDependencyReducedPom>
               <finalName>apache-archiva-cli-${project.version}</finalName>
               <transformers>
                 <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
index ed41e84d5dc4806fffd055a691aca069f0cd0659..fcbb3649ee7509d1bd551cfc80bb05a01d430843 100644 (file)
@@ -24,7 +24,7 @@ under the License.
   xmlns="http://maven.apache.org/SETTINGS/1.0.0">
   <mirrors>
     <mirror>
-      <mirrorOf>external:*</mirrorOf>
+      <mirrorOf>external:*,!central</mirrorOf>
       <id>local-mirror</id>
       <name>local-mirror</name>
       <url>@localRepositoryUrl@</url>
@@ -60,6 +60,16 @@ under the License.
             <enabled>true</enabled>
           </snapshots>
         </repository>
+        <repository>
+          <id>central</id>
+          <url>https://repo.maven.apache.org/maven2</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
       </repositories>
       <pluginRepositories>
         <pluginRepository>
@@ -72,6 +82,16 @@ under the License.
             <enabled>true</enabled>
           </snapshots>
         </pluginRepository>
+        <pluginRepository>
+          <id>central</id>
+          <url>https://repo.maven.apache.org/maven2</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </pluginRepository>
       </pluginRepositories>
     </profile>
   </profiles>
index 52eb42195310d0f58d3419cef31cc2769c2b9d91..4c351447be2e26605dc66b970707c8674e1f5dad 100644 (file)
@@ -234,20 +234,14 @@ public abstract class AbstractMetadataRepositoryTest
     {
         try ( RepositorySession session = getSessionFactory( ).createSession( ) )
         {
-            tryAssert( ( ) -> {
-                assertThat( getRepository( ).getRootNamespaces( session, TEST_REPO_ID ) ).isNotNull( ).isEmpty( );
-            } );
+            tryAssert( ( ) -> assertThat( getRepository( ).getRootNamespaces( session, TEST_REPO_ID ) ).isNotNull( ).isEmpty( ));
             getRepository( ).updateNamespace( session, TEST_REPO_ID, TEST_NAMESPACE );
 
-            tryAssert( ( ) -> {
-                assertThat( getRepository( ).getRootNamespaces( session, TEST_REPO_ID ) ).isNotNull( ).isNotEmpty( ).contains(
-                    TEST_NAMESPACE ).hasSize( 1 );
-            } );
+            tryAssert( ( ) -> assertThat( getRepository( ).getRootNamespaces( session, TEST_REPO_ID ) ).isNotNull( ).isNotEmpty( )
+                                .contains( TEST_NAMESPACE ).hasSize( 1 ));
             getRepository( ).removeNamespace( session, TEST_REPO_ID, TEST_NAMESPACE );
 
-            tryAssert( ( ) -> {
-                assertThat( getRepository( ).getRootNamespaces( session, TEST_REPO_ID ) ).isNotNull( ).isEmpty( );
-            } );
+            tryAssert( ( ) -> assertThat( getRepository( ).getRootNamespaces( session, TEST_REPO_ID ) ).isNotNull( ).isEmpty( ));
         }
     }
 
index 4aee8731100f0d2ea4e3652e6ae93f40388061c7..fcdce8a9900882e677fae9b622e21599cbd369e9 100644 (file)
       <groupId>org.apache.archiva</groupId>
       <artifactId>metadata-repository-api</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>metadata-repository-api</artifactId>
-      <classifier>tests</classifier>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-common</artifactId>
@@ -79,7 +73,6 @@
       <artifactId>metadata-model</artifactId>
     </dependency>
 
-
     <dependency>
       <groupId>jakarta.annotation</groupId>
       <artifactId>jakarta.annotation-api</artifactId>
       <version>${datastax.driver.version}</version>
     </dependency>
 
-
     <!-- TEST Scope -->
     <dependency>
-      <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>metadata-repository-api</artifactId>
+      <classifier>tests</classifier>
       <scope>test</scope>
     </dependency>
     <dependency>
     </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
-      <artifactId>log4j-1.2-api</artifactId>
+      <artifactId>log4j-core</artifactId>
       <version>${log4j.version}</version>
       <scope>test</scope>
     </dependency>
 
     <dependency>
-      <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-engine</artifactId>
+      <groupId>org.testcontainers</groupId>
+      <artifactId>cassandra</artifactId>
+      <version>1.17.1</version>
       <scope>test</scope>
     </dependency>
 
-
   </dependencies>
 
   <build>
-    <testResources>
-      <testResource>
-        <directory>src/test/filtered-resources</directory>
-        <filtering>true</filtering>
-      </testResource>
-    </testResources>
-
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>reserve-ports</id>
-            <phase>process-test-resources</phase>
-            <goals>
-              <goal>reserve-network-port</goal>
-            </goals>
-            <configuration>
-              <portNames>
-                <portName>cassandra.rpcPort</portName>
-                <portName>cassandra.storagePort</portName>
-                <portName>cassandra.stopPort</portName>
-                <portName>cassandra.jmxPort</portName>
-                <portName>cassandra.nativeTransportPort</portName>
-              </portNames>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>cassandra-maven-plugin</artifactId>
-        <version>3.7-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <id>start-cassandra</id>
-            <phase>pre-integration-test</phase>
-            <goals>
-              <goal>start</goal>
-            </goals>
-            <configuration>
-              <nativeTransportPort>${cassandra.nativeTransportPort}</nativeTransportPort>
-              <rpcPort>${cassandra.rpcPort}</rpcPort>
-              <storagePort>${cassandra.storagePort}</storagePort>
-              <stopPort>${cassandra.stopPort}</stopPort>
-              <jmxPort>${cassandra.jmxPort}</jmxPort>
-              <addMainClasspath>false</addMainClasspath>
-              <addTestClasspath>false</addTestClasspath>
-              <startWaitSeconds>500</startWaitSeconds>
-              <startNativeTransport>true</startNativeTransport>
-              <logLevel>INFO</logLevel>
-              <loadAfterFirstStart>false</loadAfterFirstStart>
-              <systemPropertyVariables>
-                <cassandra.jmx.local.port>${cassandra.jmxPort}</cassandra.jmx.local.port>
-              </systemPropertyVariables>
-              <yaml><![CDATA[rpc_address: 127.0.0.1
-broadcast_rpc_address: 127.0.0.1
-listen_address: 127.0.0.1
-auto_snapshot: false
-snapshot_before_compaction: false
-num_tokens: 1
-]]></yaml>
-            </configuration>
-          </execution>
-          <execution>
-            <id>stop-cassandra</id>
-            <phase>post-integration-test</phase>
-            <goals>
-              <goal>stop</goal>
-            </goals>
-          </execution>
-        </executions>
-        <dependencies>
-          <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <version>${slf4j.version}</version>
-          </dependency>
-          <dependency>
-            <groupId>net.java.dev.jna</groupId>
-            <artifactId>jna</artifactId>
-            <version>4.2.2</version>
-          </dependency>
-            <dependency>
-              <groupId>org.apache.cassandra</groupId>
-              <artifactId>cassandra-all</artifactId>
-              <version>${cassandraVersion}</version>
-            </dependency>
-        </dependencies>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-failsafe-plugin</artifactId>
-        <version>3.0.0-M5</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>integration-test</goal>
-              <goal>verify</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <includes>
-            <include>**/*Test.java</include>
-          </includes>
-          <systemPropertyVariables>
-            <cassandra.port>${cassandra.nativeTransportPort}</cassandra.port>
-            <cassandra.host>127.0.0.1</cassandra.host>
-            <archiva.repositorySessionFactory.id>cassandra</archiva.repositorySessionFactory.id>
-            <appserver.base>${project.build.directory}/appserver-base</appserver.base>
-            <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
-          </systemPropertyVariables>
-          <trimStackTrace>false</trimStackTrace>
-          <skip>false</skip>
-          <classesDirectory>${project.build.outputDirectory}</classesDirectory>
-        </configuration>
-        <dependencies>
-          <dependency>
-            <groupId>org.junit.jupiter</groupId>
-            <artifactId>junit-jupiter-engine</artifactId>
-            <version>${junit.jupiter.version}</version>
-          </dependency>
-        </dependencies>
-      </plugin>
-
-    </plugins>
     <pluginManagement>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
-          <executions>
-          </executions>
           <configuration>
-            <skip>true</skip>
+            <systemPropertyVariables>
+              <archiva.repositorySessionFactory.id>cassandra</archiva.repositorySessionFactory.id>
+              <appserver.base>${project.build.directory}/appserver-base</appserver.base>
+              <cassandraVersion>${cassandraVersion}</cassandraVersion>
+            </systemPropertyVariables>
           </configuration>
         </plugin>
 
@@ -326,7 +193,6 @@ num_tokens: 1
           <configuration>
             <excludes>
               <exclude>src/cassandra/**</exclude>
-              <exclude>src/test/resources/cassandra-test.yaml</exclude>
             </excludes>
           </configuration>
         </plugin>
@@ -334,15 +200,4 @@ num_tokens: 1
     </pluginManagement>
   </build>
 
-  <profiles>
-    <profile>
-      <id>jdk9+</id>
-      <activation>
-        <jdk>[1.9,)</jdk>
-      </activation>
-      <properties >
-        <cassandra.addJdk11Options>true</cassandra.addJdk11Options>
-      </properties>
-    </profile>
-  </profiles>
 </project>
index df53f600b12434a5b60b87eccc9910504da43bbb..21df2ca15620105516beab6efd729ab37d7c962c 100644 (file)
@@ -182,7 +182,6 @@ public class DefaultCassandraArchivaManager
         hostNames.add( cassandraHost + ":" + cassandraPort );
         configLoader =
             DriverConfigLoader.programmaticBuilder( )
-
                 .withStringList( DefaultDriverOption.CONTACT_POINTS, hostNames )
                 .withInt( DefaultDriverOption.CONNECTION_POOL_LOCAL_SIZE, maxActive )
                 .withInt( DefaultDriverOption.CONNECTION_POOL_REMOTE_SIZE, maxActive )
diff --git a/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/filtered-resources/META-INF/spring-context.xml b/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/filtered-resources/META-INF/spring-context.xml
deleted file mode 100644 (file)
index 49f80f8..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-  <bean name="repositoryStorage#maven2" class="org.apache.archiva.metadata.repository.cassandra.MockRepositoryStorage"/>
-
-  <bean name="mockrepo#listener" class="org.apache.archiva.metadata.repository.cassandra.MockRepositoryStorage"/>
-
-</beans>
\ No newline at end of file
index c1e07a07a097a2b890139a811768d8f102fb59b1..ce85af8ad42d905e88e26be363ea330d79febfe7 100644 (file)
@@ -27,13 +27,19 @@ import org.apache.archiva.metadata.repository.MetadataService;
 import org.apache.archiva.metadata.repository.RepositorySession;
 import org.apache.archiva.metadata.repository.RepositorySessionFactory;
 import org.apache.archiva.metadata.repository.cassandra.model.ProjectVersionMetadataModel;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
 import org.junit.jupiter.api.TestInstance;
 import org.junit.jupiter.api.extension.ExtendWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.CassandraContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.utility.DockerImageName;
 
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -57,9 +63,13 @@ import static org.mockito.Mockito.when;
  */
 @ExtendWith( SpringExtension.class )
 @TestInstance( TestInstance.Lifecycle.PER_CLASS )
+@ContextConfiguration( locations = {"classpath*:/META-INF/spring-context.xml"} )
 public class CassandraMetadataRepositoryTest
     extends AbstractMetadataRepositoryTest
 {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger( CassandraMetadataRepositoryTest.class );
+
     @Inject
     @Named(value = "archivaEntityManagerFactory#cassandra")
     CassandraArchivaManager cassandraArchivaManager;
@@ -70,6 +80,19 @@ public class CassandraMetadataRepositoryTest
 
     RepositorySession session;
 
+    private static final CassandraContainer CASSANDRA =
+            new CassandraContainer(DockerImageName.parse("cassandra")
+                    .withTag(System.getProperty("cassandraVersion","3.11.2")));
+
+    // because of @ExtendWith( SpringExtension.class ) @BeforeAll will not be executed before spring resolution so need to use this...
+    static {
+        LOGGER.info("initCassandra");
+        CASSANDRA.withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("org.apache.archiva.metadata.repository.cassandra.logs")));
+        CASSANDRA.start();
+        System.setProperty("cassandra.host", CASSANDRA.getHost());
+        System.setProperty("cassandra.port", CASSANDRA.getMappedPort(9042).toString());
+    }
+
     long cTime;
     int testNum = 0;
     final AtomicBoolean clearedTables = new AtomicBoolean( false );
@@ -87,8 +110,15 @@ public class CassandraMetadataRepositoryTest
         return cmr;
     }
 
+    @AfterAll
+    public static void stopCassandra()
+            throws Exception {
+        CASSANDRA.close();
+    }
+
     @BeforeEach
-    public void setUp( TestInfo testInfo )
+    @Override
+    public void setUp()
         throws Exception
     {
         cTime = System.currentTimeMillis( );
@@ -152,7 +182,7 @@ public class CassandraMetadataRepositoryTest
 
 
     @AfterEach
-    public void shutdown(TestInfo testInfo)
+    public void shutdown()
         throws Exception
     {
         clearReposAndNamespace( cassandraArchivaManager, clearedTables );
@@ -177,7 +207,8 @@ public class CassandraMetadataRepositoryTest
                     cassandraArchivaManager.getLicenseFamilyName( ),
                     cassandraArchivaManager.getDependencyFamilyName( )
                 );
-                CompletableFuture.allOf( tables.stream( ).map( table -> session.executeAsync( truncate( table ).build( ) ) )
+                CompletableFuture.allOf(tables.stream()
+                                .map(table -> session.executeAsync(truncate(table).build()))
                         .map( CompletionStage::toCompletableFuture ).collect( Collectors.toList( ) ).toArray( new CompletableFuture[0] ) )
                     .whenComplete( ( c, e ) -> {
                         if ( clearedFlag != null ) clearedFlag.set( true );
index 7bcc68758e9bd31c9c638f783fdaf632bb1f1904..c2d92ad157410f0e67522ec659f1331d67e8e474 100644 (file)
@@ -22,7 +22,9 @@ package org.apache.archiva.metadata.repository.cassandra;
 import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.repository.cassandra.model.Namespace;
 import org.apache.archiva.metadata.repository.cassandra.model.Repository;
+import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
@@ -30,6 +32,9 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.testcontainers.containers.CassandraContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.utility.DockerImageName;
 
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -40,19 +45,37 @@ import static org.assertj.core.api.Assertions.assertThat;
  * @author Olivier Lamy
  */
 @ExtendWith( SpringExtension.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml" } )
 public class RepositoriesNamespaceTest
 {
 
-    private Logger logger = LoggerFactory.getLogger( getClass() );
+    private static final Logger LOGGER = LoggerFactory.getLogger( RepositoriesNamespaceTest.class );
+
+    private static final CassandraContainer CASSANDRA =
+            new CassandraContainer(DockerImageName.parse("cassandra")
+                    .withTag(System.getProperty("cassandraVersion","3.11.2")));
 
     @Inject
     @Named( value = "archivaEntityManagerFactory#cassandra" )
     CassandraArchivaManager cassandraArchivaManager;
 
-
     CassandraMetadataRepository cmr;
 
+    @BeforeAll
+    public static void initCassandra()
+            throws Exception {
+        CASSANDRA.withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("org.apache.archiva.metadata.repository.cassandra.logs")));
+        CASSANDRA.start();
+        System.setProperty("cassandra.host", CASSANDRA.getHost());
+        System.setProperty("cassandra.port", CASSANDRA.getMappedPort(9042).toString());
+    }
+
+    @AfterAll
+    public static void stopCassandra()
+        throws Exception {
+        CASSANDRA.close();
+    }
+
     @BeforeEach
     public void setup()
         throws Exception
@@ -131,7 +154,7 @@ public class RepositoriesNamespaceTest
         }
         catch ( Exception e )
         {
-            logger.error( e.getMessage(), e );
+            LOGGER.error( e.getMessage(), e );
             throw e;
         }
         finally
diff --git a/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/resources/META-INF/spring-context.xml b/archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/resources/META-INF/spring-context.xml
new file mode 100644 (file)
index 0000000..49f80f8
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+  <bean name="repositoryStorage#maven2" class="org.apache.archiva.metadata.repository.cassandra.MockRepositoryStorage"/>
+
+  <bean name="mockrepo#listener" class="org.apache.archiva.metadata.repository.cassandra.MockRepositoryStorage"/>
+
+</beans>
\ No newline at end of file
index 6e871d9672a03d3a43c547a166279dc7c0d3ffbe..6a899215018f12c1812565884b8614ce610ae374 100644 (file)
   -->
 
 
-<configuration status="debug">
-
-
-
+<configuration>
   <appenders>
     <Console name="console" target="SYSTEM_OUT">
-      <!--PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/-->
       <PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n}" />
     </Console>
-
   </appenders>
   <loggers>
-
-
-    <logger name="org.apache.archiva.metadata.repository.cassandra" level="debug"/>
-
-    <root level="debug" includeLocation="true">
+    <logger name="org.apache.archiva.metadata.repository.cassandra" level="info"/>
+    <logger name="org.apache.archiva.metadata.repository.cassandra.logs" level="error"/>
+    <root level="info" includeLocation="true">
       <appender-ref ref="console"/>
     </root>
   </loggers>
index 961fe0d169d7af9f5c1df4703537022bc3fc81a2..633914610f56dcb9521853621aea13a02915d245 100644 (file)
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
-        <version>3.2.4</version>
         <executions>
           <!-- Run shade goal on package phase -->
           <execution>
               <goal>shade</goal>
             </goals>
             <configuration>
+              <createDependencyReducedPom>false</createDependencyReducedPom>
               <filters>
                 <filter>
                   <artifact>*:*</artifact>
diff --git a/pom.xml b/pom.xml
index e3cbef7b4f632ccb6b0978f4279032d0672fb86a..50ff533ab185e287a2ffbe6b9f8da157862f5c31 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     </dependency>
 
     <!-- JUNIT 5 -->
-    <dependency>
-      <groupId>org.junit.platform</groupId>
-      <artifactId>junit-platform-launcher</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.platform</groupId>
-      <artifactId>junit-platform-console-standalone</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-engine</artifactId>
+      <artifactId>junit-jupiter-api</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
+      <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
       <scope>test</scope>
     </dependency>
-    
-
+<!--    <dependency>-->
+<!--      <groupId>org.junit.platform</groupId>-->
+<!--      <artifactId>junit-platform-launcher</artifactId>-->
+<!--      <scope>test</scope>-->
+<!--    </dependency>-->
+<!--    <dependency>-->
+<!--      <groupId>org.junit.platform</groupId>-->
+<!--      <artifactId>junit-platform-console-standalone</artifactId>-->
+<!--      <scope>test</scope>-->
+<!--    </dependency>-->
+<!--    <dependency>-->
+<!--      <groupId>org.junit.jupiter</groupId>-->
+<!--      <artifactId>junit-jupiter-engine</artifactId>-->
+<!--      <scope>test</scope>-->
+<!--    </dependency>-->
+<!--    <dependency>-->
+<!--      <groupId>org.junit.vintage</groupId>-->
+<!--      <artifactId>junit-vintage-engine</artifactId>-->
+<!--      <scope>test</scope>-->
+<!--    </dependency>-->
   </dependencies>