continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r489870 - in /maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test: AddMavenOneProjectTestCase.java AddMavenTwoProjectTest.java AddMavenTwoProjectTestCase.java
Date Sat, 23 Dec 2006 08:53:37 GMT
Author: evenisse
Date: Sat Dec 23 00:53:37 2006
New Revision: 489870

URL: http://svn.apache.org/viewvc?view=rev&rev=489870
Log: (empty)

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

Modified: maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java?view=diff&rev=489870&r1=489869&r2=489870
==============================================================================
--- maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java
(original)
+++ maven/continuum/trunk/continuum-webapp-test/src/test/it/org/apache/continuum/web/test/AddMavenOneProjectTestCase.java
Sat Dec 23 00:53:37 2006
@@ -85,7 +85,7 @@
     {
         String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/missing-repository-element-project.xml";
         submitAddMavenOneProjectPage( pomUrl, false );
-        assertTextPresent( "Missing repository element in the POM." );
+        assertTextPresent( "Missing 'repository' element in the POM." );
     }
 
 
@@ -96,7 +96,7 @@
     {
         String pomUrl = "http://svn.apache.org/repos/asf/maven/continuum/trunk/continuum-webapp-test/src/test/resources/unit/maven-one-projects/extend-element-project.xml";
         submitAddMavenOneProjectPage( pomUrl, false );
-        assertTextPresent( "Cannot use a POM with an extend element." );
+        assertTextPresent( "Cannot use a POM with an 'extend' element." );
     }
 
     /**

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=489870&r1=489869&r2=489870
==============================================================================
--- 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
Sat Dec 23 00:53:37 2006
@@ -37,4 +37,103 @@
 
         assertCellValueFromTable( "1", "ec_table", 1, 2 );
     }
+
+    /**
+     * submit the page
+     *
+     * @param m2PomUrl
+     * @param validPom
+     */
+    public void submitAddMavenTwoProjectPage( String m2PomUrl, boolean validPom )
+    {
+        addMavenTwoProject( m2PomUrl, "", "", null, validPom );
+
+        if ( validPom )
+        {
+            assertTextPresent( "Default Project Group" );
+            //TODO: Add more tests
+        }
+    }
+
+    /**
+     * Test invalid pom url
+     */
+    public void testNoPomSpecified()
+    {
+        submitAddMavenTwoProjectPage( "", false );
+        assertTextPresent( "Either POM URL or Upload POM is required." );
+    }
+
+    /**
+     * Test when scm element is missing from pom
+     */
+    public void testMissingScmElementPom()
+    {
+        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." );
+    }
+
+    /**
+     * Test when the specified pom url is invalid
+     */
+    public void testCannotAccessResource()
+    {
+        String pomUrl = "http://svn.apache.org/asf/maven/continuum/trunk/bad_url/pom.xml";
+        submitAddMavenTwoProjectPage( pomUrl, false );
+        assertTextPresent(
+            "POM file does not exist. Either the POM you specified or one of its modules
does not exist." );
+    }
+
+    /**
+     * test with a malformed pom url
+     */
+    public void testMalformedPomUrl()
+    {
+        String pomUrl = "aaa";
+        submitAddMavenTwoProjectPage( pomUrl, false );
+        assertTextPresent(
+            "The specified resource cannot be accessed. Please try again later or contact
your administrator." );
+    }
+
+    /**
+     * Test when the connection element is missing from the scm tag
+     */
+    public void testMissingConnectionElement()
+    {
+        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." );
+    }
+
+    /**
+     * Test when the parent pom is missing or not yet added in continuum
+     */
+    public void testMissingParentPom()
+    {
+        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." );
+    }
+
+    /**
+     * Test when the modules/subprojects specified in the pom are not found
+     */
+    public void testMissingModules()
+    {
+        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." );
+    }
+
+    /**
+     * test wiht an inaccessible pom url
+     */
+    public void testInaccessiblePomUrl()
+    {
+        String pomUrl = "http://www.google.com";
+        submitAddMavenTwoProjectPage( pomUrl, false );
+        assertTextPresent( "The specified resource isn't a file or the protocol used isn't
allowed." );
+    }
 }



Mime
View raw message