continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1659075 - in /continuum/trunk: continuum-api/src/test/java/org/apache/continuum/utils/ continuum-api/src/test/java/org/apache/continuum/utils/shell/ continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ continuum-base/contin...
Date Wed, 11 Feb 2015 21:26:58 GMT
Author: batkinson
Date: Wed Feb 11 21:26:58 2015
New Revision: 1659075

URL: http://svn.apache.org/r1659075
Log:
Migrated tests using junit 3 TestCase to junit 4's annotations.

Modified:
    continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java
    continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/shell/DefaultShellCommandHelperTest.java
    continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ContinuumScmUtilsTest.java
    continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/DefaultContinuumScmTest.java
    continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ScmSanityTest.java
    continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavResourceLocatorTest.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionProviderTest.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionTest.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/util/WorkingCopyPathUtilTest.java
    continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/utils/ContinuumUtilsTest.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryActionTest.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java
    continuum/trunk/continuum-webapp-test/pom.xml
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java

Modified: continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java
(original)
+++ continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/ProjectSorterTest.java
Wed Feb 11 21:26:58 2015
@@ -19,26 +19,28 @@ package org.apache.continuum.utils;
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectDependency;
 import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.junit.Test;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 /**
  * @author <a href="mailto:jmcconnell@apache.org">Jesse McConnell</a>
- * @version $Id:$
  */
 public class ProjectSorterTest
-    extends TestCase
 {
 
     /**
      * test basic three project tree (really a line in this case)
      */
+    @Test
     public void testBasicNestedProjectStructure()
         throws Exception
     {

Modified: continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/shell/DefaultShellCommandHelperTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/shell/DefaultShellCommandHelperTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/shell/DefaultShellCommandHelperTest.java
(original)
+++ continuum/trunk/continuum-api/src/test/java/org/apache/continuum/utils/shell/DefaultShellCommandHelperTest.java
Wed Feb 11 21:26:58 2015
@@ -19,8 +19,10 @@ package org.apache.continuum.utils.shell
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.commons.lang.StringUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -28,11 +30,13 @@ import java.io.File;
 import java.util.Arrays;
 import java.util.List;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 /**
  * @see org.apache.continuum.utils.shell.DefaultShellCommandHelper
  */
 public class DefaultShellCommandHelperTest
-    extends TestCase
 {
     private static final Logger log = LoggerFactory.getLogger( DefaultShellCommandHelper.class
);
 
@@ -42,6 +46,7 @@ public class DefaultShellCommandHelperTe
 
     private String sleepClasspath;
 
+    @Before
     public void setUp()
     {
         helper = new DefaultShellCommandHelper();
@@ -52,6 +57,7 @@ public class DefaultShellCommandHelperTe
         sleepClasspath = System.getProperty( "sleepClasspath" );
     }
 
+    @After
     public void tearDown()
     {
         helper = null;
@@ -92,6 +98,7 @@ public class DefaultShellCommandHelperTe
         }
     }
 
+    @Test
     public void testIsRunning()
         throws Exception
     {

Modified: continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ContinuumScmUtilsTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ContinuumScmUtilsTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ContinuumScmUtilsTest.java
(original)
+++ continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ContinuumScmUtilsTest.java
Wed Feb 11 21:26:58 2015
@@ -19,15 +19,19 @@ package org.apache.continuum.scm;
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.commons.lang.StringUtils;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
  */
 public class ContinuumScmUtilsTest
-    extends TestCase
 {
+
+    @Test
     public void testGitProviderWithSSHProtocolUsernameInUrl()
         throws Exception
     {
@@ -41,6 +45,7 @@ public class ContinuumScmUtilsTest
         assertTrue( StringUtils.isBlank( scmConfiguration.getPassword() ) );
     }
 
+    @Test
     public void testGitProviderWithSSHProtocolUsernameAndPasswordInUrl()
         throws Exception
     {
@@ -54,6 +59,7 @@ public class ContinuumScmUtilsTest
         assertEquals( "sshPassword", scmConfiguration.getPassword() );
     }
 
+    @Test
     public void testGitProviderWithSSHProtocolNoCredentialsInUrl()
         throws Exception
     {
@@ -67,6 +73,7 @@ public class ContinuumScmUtilsTest
         assertEquals( "dummypassword", scmConfiguration.getPassword() );
     }
 
+    @Test
     public void testNotGitProvider()
         throws Exception
     {
@@ -80,6 +87,7 @@ public class ContinuumScmUtilsTest
         assertEquals( "dummypassword", scmConfiguration.getPassword() );
     }
 
+    @Test
     public void testNotSSHProtocol()
         throws Exception
     {

Modified: continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/DefaultContinuumScmTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/DefaultContinuumScmTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/DefaultContinuumScmTest.java
(original)
+++ continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/DefaultContinuumScmTest.java
Wed Feb 11 21:26:58 2015
@@ -19,7 +19,6 @@ package org.apache.continuum.scm;
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.continuum.scm.manager.ScmManager;
 import org.apache.maven.scm.ScmBranch;
 import org.apache.maven.scm.ScmFileSet;
@@ -29,12 +28,13 @@ import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.jmock.integration.junit3.JUnit3Mockery;
 import org.jmock.lib.legacy.ClassImposteriser;
+import org.junit.Before;
+import org.junit.Test;
 
 import java.io.File;
 import java.util.Date;
 
 public class DefaultContinuumScmTest
-    extends TestCase
 {
     private ScmManager scmManager;
 
@@ -44,7 +44,7 @@ public class DefaultContinuumScmTest
 
     private ContinuumScmConfiguration config;
 
-    @Override
+    @Before
     public void setUp()
     {
         context = new JUnit3Mockery();
@@ -58,6 +58,7 @@ public class DefaultContinuumScmTest
         config = getScmConfiguration();
     }
 
+    @Test
     public void testChangeLogWithScmVersion()
         throws Exception
     {
@@ -77,6 +78,7 @@ public class DefaultContinuumScmTest
         context.assertIsSatisfied();
     }
 
+    @Test
     public void testChangeLogWithNoScmVersion()
         throws Exception
     {

Modified: continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ScmSanityTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ScmSanityTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ScmSanityTest.java
(original)
+++ continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/ScmSanityTest.java
Wed Feb 11 21:26:58 2015
@@ -19,21 +19,22 @@ package org.apache.continuum.scm;
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.maven.scm.ChangeSet;
 import org.apache.maven.scm.log.DefaultLog;
 import org.apache.maven.scm.provider.svn.svnexe.command.changelog.SvnChangeLogConsumer;
+import org.junit.Test;
 
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.List;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * Tests to verify assumptions and avoid regressions in SCM dependencies.
  */
 public class ScmSanityTest
-    extends TestCase
 {
 
     private InputStream getTestInput( String path )
@@ -44,6 +45,7 @@ public class ScmSanityTest
     /**
      * Tests that CONTINUUM-1640 is fixed by updated maven-scm
      */
+    @Test
     public void testSvnLogWithSpaceInAuthorWorks()
         throws Exception
     {

Modified: continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java
(original)
+++ continuum/trunk/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java
Wed Feb 11 21:26:58 2015
@@ -19,37 +19,41 @@ package org.apache.continuum.scm.manager
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
 import org.apache.maven.scm.provider.ScmProvider;
 import org.apache.maven.scm.provider.cvslib.cvsexe.CvsExeScmProvider;
 import org.apache.maven.scm.provider.cvslib.cvsjava.CvsJavaScmProvider;
 import org.codehaus.plexus.spring.PlexusClassPathXmlApplicationContext;
+import org.junit.Before;
+import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
 
 import java.util.Properties;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 /**
- * @version $Id$
  * @todo replace with a spring integration test
  */
 public class ScmManagerTest
-    extends TestCase
 {
     private static final Logger log = LoggerFactory.getLogger( ScmManagerTest.class );
 
     private ScmManager manager;
 
+    @Before
     public void setUp()
     {
         ApplicationContext context = new PlexusClassPathXmlApplicationContext(
-            new String[]{"classpath*:META-INF/spring-context.xml", "classpath*:META-INF/plexus/components.xml",
-                "classpath*:" + getClass().getName().replace( '.', '/' ) + ".xml"} );
+            new String[] { "classpath*:META-INF/spring-context.xml", "classpath*:META-INF/plexus/components.xml",
+                "classpath*:" + getClass().getName().replace( '.', '/' ) + ".xml" } );
         manager = (ScmManager) context.getBean( "scmManager" );
     }
 
+    @Test
     public void testScmProviders()
         throws NoSuchScmProviderException
     {

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavResourceLocatorTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavResourceLocatorTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavResourceLocatorTest.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavResourceLocatorTest.java
Wed Feb 11 21:26:58 2015
@@ -19,23 +19,25 @@ package org.apache.continuum.webdav;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 public class ContinuumBuildAgentDavResourceLocatorTest
-    extends TestCase
 {
     private ContinuumBuildAgentDavLocatorFactory factory;
 
     private ContinuumBuildAgentDavResourceLocator locator;
 
-    @Override
-    protected void setUp()
+    @Before
+    public void setUp()
         throws Exception
     {
-        super.setUp();
         factory = new ContinuumBuildAgentDavLocatorFactory();
     }
 
+    @Test
     public void testAvoidDoubleSlashInHref()
         throws Exception
     {
@@ -53,6 +55,7 @@ public class ContinuumBuildAgentDavResou
         assertEquals( "/workingcopy/1", locator.getRepositoryPath() );
     }
 
+    @Test
     public void testLocatorWithPrefixHref()
         throws Exception
     {
@@ -70,6 +73,7 @@ public class ContinuumBuildAgentDavResou
         assertEquals( "/workingcopy/1", locator.getRepositoryPath() );
     }
 
+    @Test
     public void testLocatorWithHrefThatContainsPrefix()
         throws Exception
     {
@@ -87,6 +91,7 @@ public class ContinuumBuildAgentDavResou
         assertEquals( "/workingcopy/1", locator.getRepositoryPath() );
     }
 
+    @Test
     public void testLocatorWithRootHref()
         throws Exception
     {

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionProviderTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionProviderTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionProviderTest.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionProviderTest.java
Wed Feb 11 21:26:58 2015
@@ -19,7 +19,6 @@ package org.apache.continuum.webdav;
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.commons.io.IOUtils;
 import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
 import org.apache.jackrabbit.webdav.DavSessionProvider;
@@ -27,7 +26,14 @@ import org.apache.jackrabbit.webdav.Webd
 import org.apache.jackrabbit.webdav.WebdavRequestImpl;
 import org.codehaus.plexus.util.Base64;
 import org.easymock.MockControl;
+import org.junit.Before;
+import org.junit.Test;
 
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
@@ -36,14 +42,11 @@ import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Locale;
 import java.util.Map;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 
 public class ContinuumBuildAgentDavSessionProviderTest
-    extends TestCase
 {
     private DavSessionProvider sessionProvider;
 
@@ -53,14 +56,11 @@ public class ContinuumBuildAgentDavSessi
 
     private BuildAgentConfigurationService buildAgentConfigurationService;
 
-    @Override
-    protected void setUp()
+    @Before
+    public void setUp()
         throws Exception
     {
-        super.setUp();
-
-        buildAgentConfigurationServiceControl = MockControl.
-            createControl( BuildAgentConfigurationService.class );
+        buildAgentConfigurationServiceControl = MockControl.createControl( BuildAgentConfigurationService.class
);
         buildAgentConfigurationService =
             (BuildAgentConfigurationService) buildAgentConfigurationServiceControl.getMock();
 
@@ -74,6 +74,7 @@ public class ContinuumBuildAgentDavSessi
 
     }
 
+    @Test
     public void testAttachSession()
         throws Exception
     {
@@ -86,6 +87,7 @@ public class ContinuumBuildAgentDavSessi
         assertNotNull( request.getDavSession() );
     }
 
+    @Test
     public void testReleaseSession()
         throws Exception
     {
@@ -253,7 +255,6 @@ public class ContinuumBuildAgentDavSessi
             throw new UnsupportedOperationException( "Not supported yet." );
         }
 
-
         public String getAuthType()
         {
             throw new UnsupportedOperationException( "Not supported yet." );

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionTest.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/ContinuumBuildAgentDavSessionTest.java
Wed Feb 11 21:26:58 2015
@@ -19,11 +19,14 @@ package org.apache.continuum.webdav;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
 
 public class ContinuumBuildAgentDavSessionTest
-    extends TestCase
 {
+
+    @Test
     public void testTokens()
     {
         ContinuumBuildAgentDavSession session = new ContinuumBuildAgentDavSession();
@@ -37,6 +40,7 @@ public class ContinuumBuildAgentDavSessi
         assertEquals( 0, session.getLockTokens().length );
     }
 
+    @Test
     public void testAddReferencesThrowsUnsupportedOperationException()
     {
         ContinuumBuildAgentDavSession session = new ContinuumBuildAgentDavSession();
@@ -51,6 +55,7 @@ public class ContinuumBuildAgentDavSessi
         }
     }
 
+    @Test
     public void testRemoveReferencesThrowsUnsupportedOperationException()
     {
         ContinuumBuildAgentDavSession session = new ContinuumBuildAgentDavSession();

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/util/WorkingCopyPathUtilTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/util/WorkingCopyPathUtilTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/util/WorkingCopyPathUtilTest.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-webdav/src/test/java/org/apache/continuum/webdav/util/WorkingCopyPathUtilTest.java
Wed Feb 11 21:26:58 2015
@@ -19,11 +19,14 @@ package org.apache.continuum.webdav.util
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 public class WorkingCopyPathUtilTest
-    extends TestCase
 {
+
+    @Test
     public void testGetProjectId()
     {
         String href = "/path/1/src/main/java";
@@ -33,6 +36,7 @@ public class WorkingCopyPathUtilTest
         assertEquals( 2, WorkingCopyPathUtil.getProjectId( href ) );
     }
 
+    @Test
     public void testGetLogicalPath()
     {
         String href = "/workingcopy/1/src/main/java/org/apache/maven/someartifact.jar";

Modified: continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/utils/ContinuumUtilsTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/utils/ContinuumUtilsTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/utils/ContinuumUtilsTest.java
(original)
+++ continuum/trunk/continuum-commons/src/test/java/org/apache/continuum/utils/ContinuumUtilsTest.java
Wed Feb 11 21:26:58 2015
@@ -19,15 +19,16 @@ package org.apache.continuum.utils;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id$
  */
 public class ContinuumUtilsTest
-    extends TestCase
 {
+    @Test
     public void testThrowableMessagesToString()
     {
         Throwable a = new Exception( "bar" );

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java
Wed Feb 11 21:26:58 2015
@@ -19,12 +19,13 @@ package org.apache.maven.continuum;
  * under the License.
  */
 
-import junit.framework.Assert;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
 import org.apache.maven.continuum.core.action.CheckoutProjectContinuumAction;
 
 import java.util.Map;
 
+import static org.junit.Assert.assertEquals;
+
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
  */
@@ -38,9 +39,7 @@ public class AddProjectToCheckoutQueueSt
         getLogger().info( "Executing add-project-to-checkout-queue (stub for testing) action."
);
 
         // check if scm credentials were set in context (CONTINUUM-2466)
-        Assert.assertEquals( AddProjectTest.SCM_USERNAME, CheckoutProjectContinuumAction.getScmUsername(
context,
-                                                                                        
                null ) );
-        Assert.assertEquals( AddProjectTest.SCM_PASSWORD, CheckoutProjectContinuumAction.getScmPassword(
context,
-                                                                                        
                null ) );
+        assertEquals( AddProjectTest.SCM_USERNAME, CheckoutProjectContinuumAction.getScmUsername(
context, null ) );
+        assertEquals( AddProjectTest.SCM_PASSWORD, CheckoutProjectContinuumAction.getScmPassword(
context, null ) );
     }
 }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryActionTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryActionTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryActionTest.java
Wed Feb 11 21:26:58 2015
@@ -19,7 +19,6 @@ package org.apache.maven.continuum.core.
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.commons.io.IOUtils;
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.Project;
@@ -29,6 +28,8 @@ import org.jmock.Expectations;
 import org.jmock.Mockery;
 import org.jmock.integration.junit3.JUnit3Mockery;
 import org.jmock.lib.legacy.ClassImposteriser;
+import org.junit.Before;
+import org.junit.Test;
 
 import java.io.File;
 import java.io.IOException;
@@ -37,6 +38,8 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 
+import static org.junit.Assert.*;
+
 /**
  * Tests that the cleanup action works properly. This is a non-portable test, and needs a
special setup to run.
  * Specifically:
@@ -46,7 +49,6 @@ import java.util.HashMap;
  * @see org.apache.maven.continuum.core.action.CleanWorkingDirectoryAction
  */
 public class CleanWorkingDirectoryActionTest
-    extends TestCase
 {
 
     public static final String FILE_PREFIX = "cwdat";
@@ -101,6 +103,7 @@ public class CleanWorkingDirectoryAction
         return root;
     }
 
+    @Before
     public void setUp()
         throws NoSuchFieldException, IllegalAccessException
     {
@@ -133,6 +136,7 @@ public class CleanWorkingDirectoryAction
      *
      * @throws Exception
      */
+    @Test
     public void testOutOfMemory()
         throws Exception
     {
@@ -160,6 +164,7 @@ public class CleanWorkingDirectoryAction
     /**
      * Tests that cleanup doesn't traverse across symlinks.
      */
+    @Test
     public void testSymlinkTraversal()
         throws Exception
     {
@@ -205,6 +210,7 @@ public class CleanWorkingDirectoryAction
     /**
      * Tests that cleanup doesn't traverse across hard links.
      */
+    @Test
     public void testHardlinkTraversal()
         throws Exception
     {

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
Wed Feb 11 21:26:58 2015
@@ -19,7 +19,6 @@ package org.apache.maven.continuum.execu
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.continuum.utils.shell.ExecutionResult;
 import org.apache.continuum.utils.shell.ShellCommandHelper;
 import org.apache.maven.continuum.configuration.ConfigurationService;
@@ -31,14 +30,16 @@ import org.apache.maven.continuum.model.
 import org.apache.maven.continuum.utils.ChrootJailWorkingDirectoryService;
 import org.jmock.Expectations;
 import org.jmock.Mockery;
+import org.junit.Test;
 
 import java.io.File;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import static org.junit.Assert.assertEquals;
+
 public class ContinuumBuildExecutorTest
-    extends TestCase
 {
     protected final AbstractBuildExecutor executor = new BuildExecutorStub();
 
@@ -54,6 +55,7 @@ public class ContinuumBuildExecutorTest
         return path;
     }
 
+    @Test
     public void testExecuteShellCommand()
         throws Exception
     {

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/FormatterToolTest.java
Wed Feb 11 21:26:58 2015
@@ -19,15 +19,16 @@ package org.apache.maven.continuum.notif
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id$
  */
 public class FormatterToolTest
-    extends TestCase
 {
+    @Test
     public void testIntervalFormatting()
         throws Exception
     {

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilderTest.java
Wed Feb 11 21:26:58 2015
@@ -19,8 +19,10 @@ package org.apache.maven.continuum.proje
  * under the License.
  */
 
-import junit.framework.TestCase;
 import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
 
 import java.net.URL;
 
@@ -28,27 +30,22 @@ import java.net.URL;
  * Test for {@link AbstractContinuumProjectBuilder}
  *
  * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
- * @version $Id$
  */
 public abstract class AbstractContinuumProjectBuilderTest
-    extends TestCase
 {
 
     private ContinuumProjectBuilder builder;
 
-    protected void setUp()
+    @Before
+    public void setUp()
         throws Exception
     {
-        super.setUp();
         builder = new ContinuumProjectBuilder();
     }
 
-    /**
-     * Test for CONTINUUM-747. Disable as it requires a password protected resource under
https.
-     *
-     * @throws Exception
-     */
-    public void disabledTestCreateMetadataFileURLStringString()
+    @Test
+    @Ignore( "requires a password protected resource under https" )
+    public void testCreateMetadataFileURLStringString()
         throws Exception
     {
         URL url = new URL( "https://someurl/pom.xml" );

Modified: continuum/trunk/continuum-webapp-test/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/pom.xml?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/pom.xml (original)
+++ continuum/trunk/continuum-webapp-test/pom.xml Wed Feb 11 21:26:58 2015
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.continuum</groupId>
     <artifactId>continuum</artifactId>
-    <version>1.4.3-SNAPSHOT</version>
+    <version>1.5-SNAPSHOT</version>
   </parent>
   <artifactId>continuum-webapp-test</artifactId>
   <name>Continuum :: Webapp Tests</name>

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java?rev=1659075&r1=1659074&r2=1659075&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildDefinitionTest.java
Wed Feb 11 21:26:58 2015
@@ -19,7 +19,6 @@ package org.apache.continuum.web.test;
  * under the License.
  */
 
-import junit.framework.Assert;
 import org.apache.continuum.web.test.parent.AbstractAdminTest;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
@@ -28,11 +27,13 @@ import org.testng.annotations.Test;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import static org.testng.Assert.assertTrue;
+
 /**
  * @author José Morales Martínez
  * @version $Id$
  */
-@Test( groups = {"buildDefinition"} )
+@Test( groups = { "buildDefinition" } )
 public class BuildDefinitionTest
     extends AbstractAdminTest
 {
@@ -194,7 +195,7 @@ public class BuildDefinitionTest
                                      MAVEN_PROJECT_TYPE, true );
     }
 
-    @Test( dependsOnMethods = {"testAddNotDefaultGroupBuildDefinition"} )
+    @Test( dependsOnMethods = { "testAddNotDefaultGroupBuildDefinition" } )
     public void testEditGroupBuildDefinition()
         throws Exception
     {
@@ -216,7 +217,7 @@ public class BuildDefinitionTest
                                      MAVEN_PROJECT_TYPE, true );
     }
 
-    @Test( dependsOnMethods = {"testEditGroupBuildDefinition"} )
+    @Test( dependsOnMethods = { "testEditGroupBuildDefinition" } )
     public void testDeleteGroupBuildDefinition()
         throws Exception
     {
@@ -238,7 +239,7 @@ public class BuildDefinitionTest
         String value = getSelenium().getAttribute(
             "xpath=(//a[contains(@href,'removeProjectBuildDefinition')])[last()]/@href" );
         Matcher m = Pattern.compile( "^.*buildDefinitionId=([0-9]+).*$" ).matcher( value
);
-        Assert.assertTrue( m.matches() );
+        assertTrue( m.matches() );
         buildDefinitionId = m.group( 1 );
     }
 
@@ -253,7 +254,7 @@ public class BuildDefinitionTest
                                      MAVEN_PROJECT_TYPE, true );
     }
 
-    @Test( dependsOnMethods = {"testAddNotDefaultProjectBuildDefinition"} )
+    @Test( dependsOnMethods = { "testAddNotDefaultProjectBuildDefinition" } )
     public void testDeleteProjectBuildDefinition()
         throws Exception
     {



Mime
View raw message