continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1373366 - /continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
Date Wed, 15 Aug 2012 12:23:03 GMT
Author: brett
Date: Wed Aug 15 12:23:02 2012
New Revision: 1373366

URL: http://svn.apache.org/viewvc?rev=1373366&view=rev
Log:
make agent tests more independent

Modified:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java?rev=1373366&r1=1373365&r2=1373366&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
Wed Aug 15 12:23:02 2012
@@ -47,10 +47,12 @@ public class BuildAgentsTest
 
     @AfterMethod
     public void tearDown()
-        throws UnsupportedEncodingException
+        throws Exception
     {
         removeBuildAgentGroup( buildAgentGroup, false );
 
+        removeBuildAgent( buildAgentUrl, false );
+
         disableDistributedBuilds();
     }
 
@@ -87,17 +89,19 @@ public class BuildAgentsTest
         Assert.assertFalse( getSelenium().isAlertPresent() );
     }
 
-    @Test( dependsOnMethods = { "testAddBuildAgent" } )
     public void testAddAnExistingBuildAgent()
     {
+        addBuildAgent( buildAgentUrl );
+
         goToAddBuildAgent();
         addBuildAgent( buildAgentUrl, buildAgentDescription, false, false, true );
         assertTextPresent( "Build agent already exists" );
     }
 
-    @Test( dependsOnMethods = { "testAddBuildAgent" } )
     public void testEditBuildAgent()
+        throws Exception
     {
+        // reset agent to expected state
         addBuildAgent( buildAgentUrl, buildAgentDescription );
 
         String new_agentDescription = "new_agentDescription";
@@ -155,10 +159,14 @@ public class BuildAgentsTest
         addEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl }, new String[]{
}, true );
     }
 
-    @Test( dependsOnMethods = { "testAddBuildAgentGroup" } )
     public void testEditBuildAgentGroup()
         throws Exception
     {
+        addBuildAgent( buildAgentUrl );
+
+        goToAddBuildAgentGroup();
+        addEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl }, new String[]{
}, true );
+
         String newName = "new_agentgroupname";
         goToEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl } );
         addEditBuildAgentGroup( newName, new String[]{ }, new String[]{ buildAgentUrl },
true );
@@ -166,10 +174,14 @@ public class BuildAgentsTest
         addEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl }, new String[]{
}, true );
     }
 
-    @Test( dependsOnMethods = { "testAddBuildAgentGroup" } )
     public void testAddAnExistingBuildAgentGroup()
         throws Exception
     {
+        addBuildAgent( buildAgentUrl );
+
+        goToAddBuildAgentGroup();
+        addEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl }, new String[]{
}, true );
+
         goToAddBuildAgentGroup();
         addEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl }, new String[]{
}, false );
         assertTextPresent( "Build agent group already exists." );
@@ -178,6 +190,8 @@ public class BuildAgentsTest
     public void testAddEmptyBuildAgentGroupName()
         throws Exception
     {
+        addBuildAgent( buildAgentUrl );
+
         goToAddBuildAgentGroup();
         addEditBuildAgentGroup( "", new String[]{ }, new String[]{ }, false );
         assertTextPresent( "Build agent group name is required." );
@@ -197,6 +211,8 @@ public class BuildAgentsTest
     public void testAddBuildAgentGroupWithEmptyBuildAgent()
         throws Exception
     {
+        addBuildAgent( buildAgentUrl );
+
         goToAddBuildAgentGroup();
         addEditBuildAgentGroup( buildAgentGroup, new String[]{ }, new String[]{ }, true );
     }



Mime
View raw message