continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r489788 - in /maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test: AbstractContinuumTestCase.java AddMavenTwoProjectTest.java AddMavenTwoProjectTestCase.java ProjectGroupTest.java UserGroupTest.java
Date Fri, 22 Dec 2006 22:37:17 GMT
Author: evenisse
Date: Fri Dec 22 14:37:16 2006
New Revision: 489788

URL: http://svn.apache.org/viewvc?view=rev&rev=489788
Log:
Fix some "add m2 project" tests

Removed:
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/UserGroupTest.java
Modified:
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java
    maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java?view=diff&rev=489788&r1=489787&r2=489788
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AbstractContinuumTestCase.java
Fri Dec 22 14:37:16 2006
@@ -327,7 +327,6 @@
     // Maven 2.0.x Project
     //////////////////////////////////////
     public void goToAddMavenProjectPage()
-        throws Exception
     {
         clickLinkWithText( "Maven 2.0.x Project" );
 
@@ -335,7 +334,6 @@
     }
 
     public void assertAddMavenTwoProjectPage()
-        throws Exception
     {
         assertTextPresent( "POM Url" );
         assertElementPresent( "m2PomUrl" );
@@ -349,8 +347,7 @@
         assertElementPresent( "selectedProjectGroup" );
     }
 
-    public void addMavenTwoProject( String pomUrl, String username, String password, String
projectGroup )
-        throws Exception
+    public void addMavenTwoProject( String pomUrl, String username, String password, String
projectGroup, boolean validProject )
     {
         goToAddMavenProjectPage();
 
@@ -365,6 +362,40 @@
         }
 
         submit();
+
+        if ( validProject )
+        {
+            assertProjectGroupsSummaryPage();
+        }
+        else
+        {
+            assertAddMavenTwoProjectPage();
+        }
+    }
+
+    public void addMavenTwoProject( String pomFile, String projectGroup, boolean validProject
)
+        throws Exception
+    {
+        goToAddMavenProjectPage();
+
+        // Enter values into Add Maven Two Project fields, and submit  
+        setFieldValue( "m2PomFile", pomFile );
+
+        if ( projectGroup != null )
+        {
+            selectValue( "addMavenTwoProject_selectedProjectGroup", projectGroup );
+        }
+
+        submit();
+
+        if ( validProject )
+        {
+            assertProjectGroupsSummaryPage();
+        }
+        else
+        {
+            assertAddMavenTwoProjectPage();
+        }
     }
 
     public void moveProjectToProjectGroup( String name, String groupId, String description,
String newProjectGroup )

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java?view=diff&rev=489788&r1=489787&r2=489788
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTest.java
Fri Dec 22 14:37:16 2006
@@ -23,9 +23,7 @@
         throws Exception
     {
         // Enter values into Add Maven Two Project fields, and submit
-        addMavenTwoProject( TEST_POM_URL, TEST_POM_USERNAME, TEST_POM_PASSWORD, null );
-
-        assertProjectGroupsSummaryPage();
+        addMavenTwoProject( TEST_POM_URL, TEST_POM_USERNAME, TEST_POM_PASSWORD, null, true
);
 
         clickLinkWithText( DEFAULT_PROJ_GRP_NAME );
     }
@@ -35,7 +33,7 @@
     {
         addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
 
-        addMavenTwoProject( TEST_POM_URL, TEST_POM_USERNAME, TEST_POM_PASSWORD, TEST_PROJ_GRP_NAME
);
+        addMavenTwoProject( TEST_POM_URL, TEST_POM_USERNAME, TEST_POM_PASSWORD, TEST_PROJ_GRP_NAME,
true );
 
         assertCellValueFromTable( "1", "ec_table", 2, 2 );
     }

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java?view=diff&rev=489788&r1=489787&r2=489788
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenTwoProjectTestCase.java
Fri Dec 22 14:37:16 2006
@@ -37,7 +37,7 @@
         throws Exception
     {
         super.setUp();
-        clickLinkWithText( "Maven 2.0.x Project" );
+        goToAddMavenProjectPage();
     }
 
     /**
@@ -47,19 +47,14 @@
      * @param m2PomFile
      * @param validPom
      */
-    public void submitAddMavenTwoProjectPage( String m2PomUrl, String m2PomFile, boolean
validPom )
+    public void submitAddMavenTwoProjectPage( String m2PomUrl, boolean validPom )
     {
-        getSelenium().type( "m2PomUrl", m2PomUrl );
-        getSelenium().type( "m2PomFile", m2PomFile );
-
-        getSelenium().click( "//input[@type='submit']" );
-        waitPage();
+        addMavenTwoProject( m2PomUrl, "", "", null, false );
 
         if ( validPom )
         {
-            assertPage( "Continuum - Group Summary" );
-            assertTextPresent( "Project Groups" );
             assertTextPresent( "Default Project Group" );
+            //TODO: Add more tests
         }
     }
 
@@ -68,10 +63,8 @@
      */
     public void testNoPomSpecified()
     {
-        submitAddMavenTwoProjectPage( "", "", false );
+        submitAddMavenTwoProjectPage( "", false );
         assertTextPresent( "Either POM URL or Upload POM is required." );
-        assertElementPresent( "m2PomUrl" );
-        assertElementPresent( "m2PomFile" );
     }
 
     /**
@@ -79,12 +72,9 @@
      */
     public void testMissingScmElementPom()
     {
-        File pomFile =
-            new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml"
);
-        submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
+        String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-scm-element-pom.xml";
+        submitAddMavenTwoProjectPage( pomUrl, false );
         assertTextPresent( "Missing scm element in the POM." );
-        assertElementPresent( "m2PomUrl" );
-        assertElementPresent( "m2PomFile" );
     }
 
     /**
@@ -92,12 +82,10 @@
      */
     public void testCannotAccessResource()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-two-projects/valid-pom.xml"
);
-        submitAddMavenTwoProjectPage( "file://" + pomFile.getAbsolutePath(), "", false );
+        String pomUrl = "http://svn.apache.org/asf/maven/continuum/trunk/bad_url/pom.xml";
+        submitAddMavenTwoProjectPage( pomUrl, false );
         assertTextPresent(
             "The specified resource cannot be accessed. Please try again later or contact
your administrator." );
-        assertElementPresent( "m2PomUrl" );
-        assertElementPresent( "m2PomFile" );
     }
 
     /**
@@ -105,12 +93,9 @@
      */
     public void testMissingConnectionElement()
     {
-        File pomFile =
-            new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-connection-element-pom.xml"
);
-        submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
+        String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-connection-element-pom.xml";
+        submitAddMavenTwoProjectPage( pomUrl, false );
         assertTextPresent( "Missing connection sub-element in the scm element in the POM."
);
-        assertElementPresent( "m2PomUrl" );
-        assertElementPresent( "m2PomFile" );
     }
 
     /**
@@ -118,12 +103,10 @@
      */
     public void testMissingParentPom()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-parent-pom.xml"
);
-        submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
+        String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-parent-pom.xml";
+        submitAddMavenTwoProjectPage( pomUrl, false );
         assertTextPresent(
             "Missing artifact trying to build the POM. Check that its parent POM is available
or add it first in Continuum." );
-        assertElementPresent( "m2PomUrl" );
-        assertElementPresent( "m2PomFile" );
     }
 
     /**
@@ -131,10 +114,8 @@
      */
     public void testMissingModules()
     {
-        File pomFile = new File( getBasedir(), "src/test/resources/unit/maven-two-projects/missing-modules-pom.xml"
);
-        submitAddMavenTwoProjectPage( "file:/" + pomFile.getAbsolutePath(), "", false );
+        String pomUrl= "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-two-projects/missing-modules-pom.xml";
+        submitAddMavenTwoProjectPage( pomUrl, false );
         assertTextPresent( "Unknown error trying to build POM." );
-        assertElementPresent( "m2PomUrl" );
-        assertElementPresent( "m2PomFile" );
     }
 }

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java?view=diff&rev=489788&r1=489787&r2=489788
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/ProjectGroupTest.java
Fri Dec 22 14:37:16 2006
@@ -69,7 +69,7 @@
     {
         // Add a project group and a project to it
         addProjectGroup( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION
);
-        addMavenTwoProject( TEST_POM_URL, TEST_POM_USERNAME, TEST_POM_PASSWORD, TEST_PROJ_GRP_NAME
);
+        addMavenTwoProject( TEST_POM_URL, TEST_POM_USERNAME, TEST_POM_PASSWORD, TEST_PROJ_GRP_NAME,
true );
 
         // assert that the default project group has 0 projects while the test project group
has 1
         assertCellValueFromTable( "0", "ec_table", 1, 2 );



Mime
View raw message