<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> |
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 |
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 --> | ||||
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"> |
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; |
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; |
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; |
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 |
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; |
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( ) | ||||
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 ) |