<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>
* under the License.
*/
-import junit.framework.TestCase;
+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.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 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" } )
public class ArchivaConfigurationMRM789Test
- extends TestCase
{
- private Logger log = LoggerFactory.getLogger( getClass() );
-
@Inject
protected ApplicationContext applicationContext;
* 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() );
* 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();
* 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()
{
* 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;
*/
@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class LegacyArtifactPathTest
- extends TestCase
{
private LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath();
* 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;
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();
}
}
* 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;
*/
@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class ProxyConnectorConfigurationOrderComparatorTest
- extends TestCase
{
@Test
public void testSortOfAllZeros()
* 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;
*/
@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class RepositoryConfigurationComparatorTest
- extends TestCase
{
@Test
public void testComparator()