mirror of
https://github.com/apache/archiva.git
synced 2025-02-20 17:04:57 +00:00
Archiva base configuration test refresh to junit 4
remove testcase; reorder import; dirty context annotation for ArchivvaConfigurationTest git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1379764 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
23a775efab
commit
c9167d64b9
@ -213,6 +213,7 @@
|
||||
<exclude>src/main/resources/org/apache/archiva/configuration/default-archiva.xml</exclude>
|
||||
<exclude>src/test/conf/maven-proxy-complete.conf</exclude>
|
||||
<exclude>src/test/resources/org/apache/archiva/configuration/test-default-archiva.xml</exclude>
|
||||
<exclude>nbactions.xml</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -19,22 +19,18 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.archiva.common.utils.FileUtil;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import org.apache.archiva.common.utils.FileUtil;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
/**
|
||||
* Test the configuration store.
|
||||
@ -42,11 +38,8 @@
|
||||
@RunWith( ArchivaSpringJUnit4ClassRunner.class )
|
||||
@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
|
||||
public class ArchivaConfigurationMRM789Test
|
||||
extends TestCase
|
||||
{
|
||||
|
||||
private Logger log = LoggerFactory.getLogger( getClass() );
|
||||
|
||||
@Inject
|
||||
protected ApplicationContext applicationContext;
|
||||
|
||||
|
@ -19,34 +19,33 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import org.apache.archiva.common.utils.FileUtil;
|
||||
import org.apache.archiva.redback.components.registry.RegistryException;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.custommonkey.xmlunit.XMLAssert;
|
||||
import org.easymock.MockControl;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.annotation.DirtiesContext.ClassMode;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
|
||||
/**
|
||||
* Test the configuration store.
|
||||
*/
|
||||
@RunWith( ArchivaSpringJUnit4ClassRunner.class )
|
||||
@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } )
|
||||
@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
|
||||
public class ArchivaConfigurationTest
|
||||
extends TestCase
|
||||
{
|
||||
|
||||
private Logger log = LoggerFactory.getLogger( getClass() );
|
||||
|
@ -19,21 +19,19 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Test the generated Configuration class from Modello. This is primarily to test the hand coded methods.
|
||||
*/
|
||||
@RunWith( ArchivaBlockJUnit4ClassRunner.class )
|
||||
public class ConfigurationTest
|
||||
extends TestCase
|
||||
{
|
||||
private Configuration configuration = new Configuration();
|
||||
|
||||
|
@ -19,29 +19,20 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import javax.inject.Inject;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
|
||||
|
||||
@RunWith( ArchivaSpringJUnit4ClassRunner.class )
|
||||
@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml" } )
|
||||
public class FileTypesTest
|
||||
extends TestCase
|
||||
{
|
||||
@Inject
|
||||
private FileTypes filetypes;
|
||||
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsArtifact()
|
||||
{
|
||||
|
@ -19,8 +19,8 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
*/
|
||||
@RunWith( ArchivaBlockJUnit4ClassRunner.class )
|
||||
public class LegacyArtifactPathTest
|
||||
extends TestCase
|
||||
{
|
||||
|
||||
private LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath();
|
||||
|
@ -19,23 +19,21 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
*/
|
||||
@RunWith( ArchivaBlockJUnit4ClassRunner.class )
|
||||
public class MavenProxyPropertyLoaderTest
|
||||
extends TestCase
|
||||
{
|
||||
private MavenProxyPropertyLoader loader;
|
||||
|
||||
@ -81,26 +79,19 @@ private void assertRepositoryExists( String id, String expectedUrl, RemoteReposi
|
||||
assertEquals( "Repository url", expectedUrl, repo.getUrl() );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidConfiguration()
|
||||
@Test( expected=InvalidConfigurationException.class )
|
||||
public void testInvalidConfiguration()
|
||||
throws InvalidConfigurationException
|
||||
{
|
||||
Configuration configuration = new Configuration();
|
||||
try
|
||||
{
|
||||
loader.load( new Properties(), configuration );
|
||||
fail( "Incomplete config should have failed" );
|
||||
}
|
||||
catch ( InvalidConfigurationException e )
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
loader.load( new Properties(), configuration );
|
||||
//fail( "Incomplete config should have failed" );
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp()
|
||||
throws Exception
|
||||
{
|
||||
super.setUp();
|
||||
loader = new MavenProxyPropertyLoader();
|
||||
}
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
|
||||
import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@ -37,7 +36,6 @@
|
||||
*/
|
||||
@RunWith( ArchivaBlockJUnit4ClassRunner.class )
|
||||
public class ProxyConnectorConfigurationOrderComparatorTest
|
||||
extends TestCase
|
||||
{
|
||||
@Test
|
||||
public void testSortOfAllZeros()
|
||||
|
@ -19,12 +19,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import java.util.Comparator;
|
||||
import org.apache.archiva.configuration.AbstractRepositoryConfiguration;
|
||||
import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
|
||||
|
||||
import java.util.Comparator;
|
||||
import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@ -33,7 +32,6 @@
|
||||
*/
|
||||
@RunWith( ArchivaBlockJUnit4ClassRunner.class )
|
||||
public class RepositoryConfigurationComparatorTest
|
||||
extends TestCase
|
||||
{
|
||||
@Test
|
||||
public void testComparator()
|
||||
|
Loading…
x
Reference in New Issue
Block a user