Переглянути джерело

Refactoring packages for mock classes

pull/62/head
Martin Stockhammer 2 роки тому
джерело
коміт
ff06849746
11 змінених файлів з 15 додано та 23 видалено
  1. 3
    3
      archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/conf/repository-manager.xml
  2. 2
    3
      archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/mock/repository/RepositoryProviderMock.java
  3. 1
    1
      archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-purge-consumer-test.xml
  4. 1
    1
      archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context.xml
  5. 1
    1
      archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletTestCase.java
  6. 1
    1
      archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletDeployTest.java
  7. 1
    1
      archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletSecurityTest.java
  8. 2
    3
      archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/mock/httpunit/MkColMethodWebRequest.java
  9. 3
    3
      archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/mock/metadata/audit/TestAuditListener.java
  10. 0
    1
      archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java
  11. 0
    5
      archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java

+ 3
- 3
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/conf/repository-manager.xml Переглянути файл

<managedRepository> <managedRepository>
<id>internal</id> <id>internal</id>
<name>Archiva Managed Internal Repository</name> <name>Archiva Managed Internal Repository</name>
<location>file://${appserver.base}/repositories/internal</location>
<location>${appserver.base}/repositories/internal</location>
<indexDir>${appserver.base}/repositories/internal/.indexer</indexDir> <indexDir>${appserver.base}/repositories/internal/.indexer</indexDir>
<layout>default</layout> <layout>default</layout>
<releases>true</releases> <releases>true</releases>
<managedRepository> <managedRepository>
<id>snapshots</id> <id>snapshots</id>
<name>Archiva Managed Snapshot Repository</name> <name>Archiva Managed Snapshot Repository</name>
<location>file://${appserver.base}/repositories/snapshots</location>
<location>${appserver.base}/repositories/snapshots</location>
<indexDir>.indexer</indexDir> <indexDir>.indexer</indexDir>
<layout>default</layout> <layout>default</layout>
<releases>false</releases> <releases>false</releases>
<managedRepository> <managedRepository>
<id>test-repo</id> <id>test-repo</id>
<name>Test Repository</name> <name>Test Repository</name>
<location>file://${appserver.base}/test-repo</location>
<location>${appserver.base}/test-repo</location>
<layout>default</layout> <layout>default</layout>
<releases>true</releases> <releases>true</releases>
<snapshots>true</snapshots> <snapshots>true</snapshots>

archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/repository/mock/RepositoryProviderMock.java → archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/consumers/core/mock/repository/RepositoryProviderMock.java Переглянути файл

package org.apache.archiva.repository.mock;
package org.apache.archiva.consumers.core.mock.repository;


/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* "License"); you may not use this file except in compliance * "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at * with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+ 1
- 1
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-purge-consumer-test.xml Переглянути файл

default-lazy-init="true"> default-lazy-init="true">


<context:annotation-config/> <context:annotation-config/>
<context:component-scan base-package="org.apache.archiva.metadata.repository,org.apache.archiva.repository.maven.content"/>
<context:component-scan base-package="org.apache.archiva.metadata.repository,org.apache.archiva.maven.repository.content"/>


<!-- for testing repo purge using retention count --> <!-- for testing repo purge using retention count -->



+ 1
- 1
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context.xml Переглянути файл

http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd" http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
default-lazy-init="true"> default-lazy-init="true">
<context:annotation-config/> <context:annotation-config/>
<context:component-scan base-package="org.apache.archiva.metadata.repository,org.apache.archiva.repository.maven.content,org.apache.archiva.maven.metadata"/>
<context:component-scan base-package="org.apache.archiva.metadata.repository,org.apache.archiva.maven.repository.content,org.apache.archiva.maven.metadata"/>


<bean name="commons-configuration" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry"> <bean name="commons-configuration" class="org.apache.archiva.components.registry.commons.CommonsConfigurationRegistry">
<property name="initialConfiguration"> <property name="initialConfiguration">

+ 1
- 1
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletTestCase.java Переглянути файл

import org.apache.archiva.repository.base.ArchivaRepositoryRegistry; import org.apache.archiva.repository.base.ArchivaRepositoryRegistry;
import org.apache.archiva.repository.base.RepositoryHandlerDependencies; import org.apache.archiva.repository.base.RepositoryHandlerDependencies;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.apache.archiva.webdav.httpunit.MkColMethodWebRequest;
import org.apache.archiva.webdav.mock.httpunit.MkColMethodWebRequest;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;

+ 1
- 1
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletDeployTest.java Переглянути файл

import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse; import com.gargoylesoftware.htmlunit.WebResponse;
import org.apache.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.archiva.webdav.httpunit.MkColMethodWebRequest;
import org.apache.archiva.webdav.mock.httpunit.MkColMethodWebRequest;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;

+ 1
- 1
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/RepositoryServletSecurityTest.java Переглянути файл

import org.apache.archiva.redback.users.User; import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.users.memory.SimpleUser; import org.apache.archiva.redback.users.memory.SimpleUser;
import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.RepositoryRegistry;
import org.apache.archiva.metadata.audit.TestAuditListener;
import org.apache.archiva.webdav.mock.metadata.audit.TestAuditListener;
import org.apache.archiva.repository.base.group.RepositoryGroupHandler; import org.apache.archiva.repository.base.group.RepositoryGroupHandler;
import org.apache.archiva.security.ServletAuthenticator; import org.apache.archiva.security.ServletAuthenticator;
import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.archiva.security.common.ArchivaRoleConstants;

archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/httpunit/MkColMethodWebRequest.java → archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/mock/httpunit/MkColMethodWebRequest.java Переглянути файл

package org.apache.archiva.webdav.httpunit;
package org.apache.archiva.webdav.mock.httpunit;


/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* "License"); you may not use this file except in compliance * "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at * with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/audit/TestAuditListener.java → archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/mock/metadata/audit/TestAuditListener.java Переглянути файл

package org.apache.archiva.metadata.audit;
package org.apache.archiva.webdav.mock.metadata.audit;


/* /*
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* "License"); you may not use this file except in compliance * "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at * with the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an * software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* under the License. * under the License.
*/ */


import org.apache.archiva.metadata.audit.AuditListener;
import org.apache.archiva.metadata.model.facets.AuditEvent; import org.apache.archiva.metadata.model.facets.AuditEvent;


import java.util.ArrayList; import java.util.ArrayList;

+ 0
- 1
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/DefaultCassandraArchivaManager.java Переглянути файл



List<String> hostNames = new ArrayList<>( ); List<String> hostNames = new ArrayList<>( );
hostNames.add( cassandraHost + ":" + cassandraPort ); hostNames.add( cassandraHost + ":" + cassandraPort );
System.out.println( "Contact point: " + cassandraHost + ":" + cassandraPort );
configLoader = configLoader =
DriverConfigLoader.programmaticBuilder( ) DriverConfigLoader.programmaticBuilder( )



+ 0
- 5
archiva-modules/metadata/metadata-store-provider/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java Переглянути файл

throws Exception throws Exception
{ {
cTime = System.currentTimeMillis( ); cTime = System.currentTimeMillis( );
System.err.println( "Setting up - "+(testNum++) + " - " + testInfo.getDisplayName() + " - 0ms");
super.setUp(); super.setUp();
System.err.println( "Setting up - " + testInfo.getDisplayName( ) + " - " + (System.currentTimeMillis( ) - cTime) +"ms");
assertMaxTries =1; assertMaxTries =1;
assertRetrySleepMs=10; assertRetrySleepMs=10;


{ {
clearReposAndNamespace( cassandraArchivaManager, clearedTables ); clearReposAndNamespace( cassandraArchivaManager, clearedTables );
} }
System.err.println( "Finished setting up - "+testInfo.getDisplayName() + " - " + (System.currentTimeMillis( ) - cTime) +"ms");
} }


/** /**
public void shutdown(TestInfo testInfo) public void shutdown(TestInfo testInfo)
throws Exception throws Exception
{ {
System.err.println( "Shutting down - " + (testNum-1) + " - " + testInfo.getDisplayName( ) + " - " + ( System.currentTimeMillis( ) - cTime ) +"ms");
clearReposAndNamespace( cassandraArchivaManager, clearedTables ); clearReposAndNamespace( cassandraArchivaManager, clearedTables );
super.tearDown(); super.tearDown();
System.err.println( "Shutting down finished - " + testInfo.getDisplayName( ) + " - " + ( System.currentTimeMillis( ) - cTime ) +"ms");
} }


static void clearReposAndNamespace( final CassandraArchivaManager cassandraArchivaManager, final AtomicBoolean clearedFlag ) static void clearReposAndNamespace( final CassandraArchivaManager cassandraArchivaManager, final AtomicBoolean clearedFlag )

Завантаження…
Відмінити
Зберегти