Author: epunzalan
Date: Sat Dec 23 20:21:10 2006
New Revision: 489977

URL: http://svn.apache.org/viewvc?view=rev&rev=489977
Log:
- updated the license headers
- replaced Continuum specific method to a more generic one

Modified:
    
maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/AbstractSeleniumTestCase.java
    
maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/XPathExpressionUtil.java

Modified: 
maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/AbstractSeleniumTestCase.java
URL: 
http://svn.apache.org/viewvc/maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/AbstractSeleniumTestCase.java?view=diff&rev=489977&r1=489976&r2=489977
==============================================================================
--- 
maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/AbstractSeleniumTestCase.java
 (original)
+++ 
maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/AbstractSeleniumTestCase.java
 Sat Dec 23 20:21:10 2006
@@ -1,19 +1,22 @@
 package org.apache.maven.shared.web.test;
 
 /*
- * Copyright 2005-2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 
 import com.thoughtworks.selenium.DefaultSelenium;
@@ -34,12 +37,6 @@
 public abstract class AbstractSeleniumTestCase
     extends TestCase
 {
-    private static final int ONE_SECOND = 1000;
-
-    private static final int ONE_MINUTE = 60 * ONE_SECOND;
-
-    private static final int LONG_WAIT = 5 * ONE_MINUTE;
-
     public static final String CHECKBOX_CHECK = "on";
 
     public static final String CHECKBOX_UNCHECK = "off";
@@ -50,9 +47,9 @@
 
     protected String adminPassword = "admin1";
 
-    protected String adminFullName = "Continuum Admin";
+    protected String adminFullName = getApplicationName() + " Admin";
 
-    protected String adminEmail = "[EMAIL PROTECTED]";
+    protected String adminEmail = "[EMAIL PROTECTED]";
 
     public void setUp()
         throws Exception
@@ -86,10 +83,9 @@
      */
     protected void initialize()
     {
-        getSelenium().setTimeout( String.valueOf( 5 * ONE_MINUTE ) );
-        open( "/continuum" );
+        open( getWebContext() );
 
-        if ( "Create Admin User".equals( getTitle() ) )
+        if ( getTitle().endsWith( "Create Admin User" ) )
         {
             assertCreateAdminUserPage();
             submitCreateAdminUserPage( adminFullName, adminEmail, 
adminPassword, adminPassword );
@@ -100,14 +96,32 @@
         }
     }
 
+    /**
+     * where webapp initial configurations can be done
+     */
     protected void postAdminUserCreation()
     {
     }
 
     protected abstract String getApplicationName();
 
+    /**
+     * some webapps have
+     *
+     * @return the page prefix set by the webapp
+     */
+    protected String getTitlePrefix()
+    {
+        return "";
+    }
+
     protected abstract String getInceptionYear();
 
+    protected String getWebContext()
+    {
+        return "/";
+    }
+
     public void open( String url )
     {
         sel.open( url );
@@ -199,7 +213,7 @@
 
     public void assertPage( String title )
     {
-        assertEquals( title, getTitle() );
+        assertEquals( getTitlePrefix() + title, getTitle() );
         assertHeader();
         assertFooter();
     }

Modified: 
maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/XPathExpressionUtil.java
URL: 
http://svn.apache.org/viewvc/maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/XPathExpressionUtil.java?view=diff&rev=489977&r1=489976&r2=489977
==============================================================================
--- 
maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/XPathExpressionUtil.java
 (original)
+++ 
maven/shared/trunk/maven-web-ui-tests/src/main/java/org/apache/maven/shared/web/test/XPathExpressionUtil.java
 Sat Dec 23 20:21:10 2006
@@ -1,19 +1,22 @@
 package org.apache.maven.shared.web.test;
 
 /*
- * Copyright 2005-2006 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 
 /**
@@ -54,19 +57,19 @@
         String xpathExpression = "";
 
         if ( values.length > 0 )
-        {        
-            xpathExpression += ELEMENT_ANY_LEVEL; 
+        {
+            xpathExpression += ELEMENT_ANY_LEVEL;
             xpathExpression += LIST;
             xpathExpression += START_NODE_TEST;
 
             for (int nIndex = 0; nIndex < values.length; nIndex++ )
             {
-                xpathExpression += ( ( nIndex > 0 ) ? AND : "" );              
  
+                xpathExpression += ( ( nIndex > 0 ) ? AND : "" );
                 xpathExpression += contains( LINE + position( nIndex + 1 ), 
values[nIndex] );
             }
 
             xpathExpression += END_NODE_TEST;
-        }    
+        }
 
         return xpathExpression;
     }


Reply via email to