Return-Path: Delivered-To: apmail-maven-continuum-commits-archive@www.apache.org Received: (qmail 12681 invoked from network); 23 Dec 2006 08:54:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Dec 2006 08:54:28 -0000 Received: (qmail 48678 invoked by uid 500); 23 Dec 2006 08:54:36 -0000 Delivered-To: apmail-maven-continuum-commits-archive@maven.apache.org Received: (qmail 48652 invoked by uid 500); 23 Dec 2006 08:54:36 -0000 Mailing-List: contact continuum-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: continuum-dev@maven.apache.org Delivered-To: mailing list continuum-commits@maven.apache.org Received: (qmail 48639 invoked by uid 99); 23 Dec 2006 08:54:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Dec 2006 00:54:36 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Dec 2006 00:54:28 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 001141A981A; Sat, 23 Dec 2006 00:53:37 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: continuum-commits@maven.apache.org From: evenisse@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061223085338.001141A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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." ); + } }