From: Olivier Lamy Date: Thu, 27 Dec 2012 14:59:52 +0000 (+0000) Subject: rename archiva-webapp-test-js module too X-Git-Tag: archiva-1.4-M4~374 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=39095445d3bca5be3268b66f5f30051c9090a7da;p=archiva.git rename archiva-webapp-test-js module too git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1426216 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/ReadMe.txt b/archiva-modules/archiva-web/archiva-webapp-test-js/ReadMe.txt deleted file mode 100644 index 21fb72940..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/ReadMe.txt +++ /dev/null @@ -1,34 +0,0 @@ -ReadMe ----------- -Run selenium tests in src/test/testng with Maven and TestNG - - mvn clean install - -Run Selenium tests in src/test/testng against an existing Archiva instance - - Start Archiva - - Configure admin user for archiva (match values in src/test/resources/testng.properties ) - - modify src/test/resources/testng.properties as needed - - mvn clean install -Dcontainer-existing - -The Cargo installations are stored outside of target to avoid multiple downloads. -To remove the Cargo installations and re-download them next run, use: - - mvn -Pclean-cargo clean - -Internet Explorer and Safari users must disable their popup blockers. Using *iexplore as -the browser requires running as an Administrator on Windows 7/Vista, or alternatively you -can use *iexploreproxy. - - - - -IMPORTANT: - -When writing Selenium tests for artifact upload, please avoid using the "test" syllable/word for -the groupId or artifactId (ex. test.group:testAddArtifactValidValues:1.0) as this is used for the -search tests. The tests explicitly assert the returned number of hits for searching an artifact with -a groupId or artifactId containing the word "test", so if you upload or add a new artifact which has -the term "test", the number of hits will be different and the search tests will fail. - -See org.apache.archiva.web.test.SearchTest.java or read the related thread discussion at -http://old.nabble.com/Selenium-tests-failure-in-trunk-td27830786.html - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/pom.xml deleted file mode 100644 index 30deb637a..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/pom.xml +++ /dev/null @@ -1,529 +0,0 @@ - - - - 4.0.0 - - org.apache.archiva - archiva-web - 1.4-M4-SNAPSHOT - - archiva-webapp-test-js - pom - Archiva Web :: Javascript Application Tests - - - ${project.build.directory}/tomcat7x/webapps/archiva - 0 - ${project.build.directory}/tomcat-port.properties - - - - - - commons-io - commons-io - - - org.apache.archiva - archiva-webapp - war - - - org.codehaus.plexus - plexus-utils - - - org.codehaus.plexus - plexus-slf4j-logging - - - plexus-component-api - org.codehaus.plexus - - - - - org.seleniumhq.selenium - selenium-java - ${selenium-server.version} - - - org.seleniumhq.selenium.client-drivers - selenium-java-client-driver - test - - - commons-logging - commons-logging - - - - - - org.fluentlenium - fluentlenium-festassert - 0.7.4 - test - - - - org.fluentlenium - fluentlenium-core - 0.7.4 - test - - - - - jdom - jdom - - - jaxen - jaxen - - - - - org.apache.derby - derby - - - javax.mail - mail - - - javax.activation - activation - - - commons-lang - commons-lang - - - - org.easytesting - fest-assert-core - test - - - - org.apache.logging.log4j.adapters - log4j-jcl - - - - org.apache.logging.log4j.adapters - log4j-slf4j-impl - - - - org.apache.logging.log4j.adapters - log4j12-api - - - - - - - - src/test/resources - true - - **/* - - - - - - - org.codehaus.mojo - selenium-maven-plugin - - - org.seleniumhq.selenium - selenium-server - ${selenium-server.version} - - - - org.seleniumhq.selenium - selenium-remote-driver - ${selenium-server.version} - - - - org.seleniumhq.selenium - selenium-api - ${selenium-server.version} - - - - - org.apache.rat - apache-rat-plugin - - - src/test/resources/appserver-base/** - src/test/resources/repository/** - src/test/resources/local-repo/** - src/test/resources/projects/** - src/test/resources/snapshots/** - src/test/tomcat*/conf/catalina.policy - - - - - - - - maven-resources-plugin - - - - testResources - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - testCompile - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - alphabetical - - - - integration-tests - integration-test - - test - - - - ${selenium.browser} - ${selenium.browser} - ${baseUrl} - ${maxWaitTimeInMs} - ${seleniumHost} - ${seleniumPort} - ${tomcat.propertiesPortFilePath} - - - - - - - - - - - create-container - - - !container - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unzip-archiva-webapp - compile - - unpack - - - - - ${project.groupId} - archiva-webapp - ${project.version} - war - - - ${webappDirectory} - true - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - process-classes - - run - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.apache.tomcat.maven - tomcat7-maven-plugin - - - org.apache.derby - derby - ${derbyVersion} - - - javax.mail - mail - ${javaxMailVersion} - - - - - tomcat-run - - run-war-only - - pre-integration-test - - /archiva - ${container.test.port} - UTF-8 - ${webappDirectory} - true - true - - ${project.build.directory}/appserver-base - ${project.build.directory}/appserver-base - ${project.build.directory} - true - - ${project.build.testOutputDirectory}/archiva.xml - ${tomcat.propertiesPortFilePath} - true - - - - tomcat-shutdown - - shutdown - - post-integration-test - - - - - - - - existing-container - - - !baseUrl - - - - http://localhost:${container.test.port}/archiva/index.html?request_lang=en - - - - start-selenium - - - !seleniumHost - - - - localhost - 4444 - - - - - org.codehaus.mojo - selenium-maven-plugin - - - pre-integration-test - - start-server - - - true - ${seleniumPort} - true - - - - - - - - - firefox - - - !browser - - - - *firefox - - - - - chrome - - - browser - chrome - - - - *googlechrome - requiresUpload - - - - iexplore - - - browser - iexplore - - - - *iexplore - requiresUpload - - - - safari - - - browser - safari - - - - *safari - requiresUpload - - - - otherbrowser - - - browser - other - - - - *custom ${browserPath} - requiresUpload - - - - headless - - - - org.codehaus.mojo - selenium-maven-plugin - - - xvfb - validate - - xvfb - - - - - - - - - - ci-server - - - - org.apache.maven.plugins - maven-antrun-plugin - - - cleanup-files - - run - - - - - - - - - - - - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java deleted file mode 100644 index 8be57aa14..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.apache.archiva.web.test; - -/* - * 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 - * - * 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. - */ - -import org.apache.archiva.web.test.parent.AbstractArchivaTest; -import org.junit.Test; - -public class ArchivaAdminTest - extends AbstractArchivaTest -{ - - @Test - public void testHome() - { - getSelenium().open( baseUrl ); - assertPage( "Apache Archiva" ); - } -} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/LoginTest.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/LoginTest.java deleted file mode 100644 index d0f50fb1d..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/LoginTest.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.apache.archiva.web.test; - -/* - * 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 - * - * 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. - */ - -import org.apache.archiva.web.test.parent.AbstractArchivaTest; -import org.junit.Test; - -/** - * Based on LoginTest of Emmanuel Venisse test. - * - * @author José Morales Martínez - * - */ - - -public class LoginTest - extends AbstractArchivaTest -{ - - @Test - public void testWithBadUsername() - { - goToLoginPage(); - setFieldValue( "user-login-form-username", "badUsername" ); - clickLinkWithLocator( "modal-login-ok", true ); - assertTextPresent( "This field is required." ); - - } - - @Test - public void testWithBadPassword() - { - goToLoginPage(); - setFieldValue( "user-login-form-username", getProperty( "ADMIN_USERNAME" ) ); - setFieldValue( "user-login-form-password", "badPassword" ); - clickLinkWithLocator( "modal-login-ok", true ); - assertTextPresent( "You have entered an incorrect username and/or password" ); - } - - @Test - public void testWithEmptyUsername() - { - goToLoginPage(); - setFieldValue( "user-login-form-password", "password" ); - clickLinkWithLocator( "modal-login-ok", true ); - assertTextPresent( "This field is required." ); - } - - @Test - public void testWithEmptyPassword() - { - goToLoginPage(); - setFieldValue( "user-login-form-username", getProperty( "ADMIN_USERNAME" ) ); - clickLinkWithLocator( "modal-login-ok", true ); - assertTextPresent( "This field is required." ); - } - - @Test - public void testWithCorrectUsernamePassword() - { - goToLoginPage(); - setFieldValue( "user-login-form-username", getProperty( "ADMIN_USERNAME" ) ); - setFieldValue( "user-login-form-password", getProperty( "ADMIN_PASSWORD" ) ); - clickLinkWithLocator( "modal-login-ok", true ); - - assertUserLoggedIn( getProperty( "ADMIN_USERNAME" ) ); - } - - -} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/RolesManagementTest.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/RolesManagementTest.java deleted file mode 100644 index 1a13488a0..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/RolesManagementTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.apache.archiva.web.test; -/* - * 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 - * - * 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. - */ - -import org.apache.archiva.web.test.parent.AbstractArchivaTest; -import org.apache.commons.lang.StringUtils; -import org.junit.Assert; -import org.junit.Test; - - -/** - * @author Olivier Lamy - */ -public class RolesManagementTest - extends AbstractArchivaTest -{ - - @Test - public void testReadRolesAndUpdateDescription() - throws Exception - { - login( getAdminUsername(), getAdminPassword() ); - clickLinkWithLocator( "menu-roles-list-a", true ); - assertTextPresent( "Archiva System Administrator " ); - Assert.assertTrue( StringUtils.isEmpty( getText( "role-description-Guest" ) ) ); - clickLinkWithLocator( "edit-role-Guest" ); - String desc = "The guest description"; - setFieldValue( "role-edit-description", desc ); - clickButtonWithLocator( "role-edit-description-save" ); - clickLinkWithLocator( "roles-view-tabs-a-roles-grid" ); - Assert.assertTrue( StringUtils.equals( desc, getText( "role-description-Guest" ) ) ); - } -} diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/UserManagementTest.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/UserManagementTest.java deleted file mode 100644 index 720e9ba19..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/UserManagementTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.apache.archiva.web.test; -/* - * 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 - * - * 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. - */ - -import org.apache.archiva.web.test.parent.AbstractArchivaTest; -import org.junit.Test; - -/** - * @author Olivier Lamy - */ - -public class UserManagementTest - extends AbstractArchivaTest -{ - @Test - public void testBasicAddDeleteUser() - { - username = getProperty( "GUEST_USERNAME" ); - fullname = getProperty( "GUEST_FULLNAME" ); - - createUser( username, fullname, getUserEmail(), getUserRolePassword(), true ); - deleteUser( username, fullname, getUserEmail() ); - logout(); - login( getAdminUsername(), getAdminPassword() ); - } -} diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/WebDriverTest.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/WebDriverTest.java deleted file mode 100644 index 94c7f393b..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/WebDriverTest.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.apache.archiva.web.test; -/* - * 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 - * - * 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. - */ - -import junit.framework.Assert; -import org.apache.commons.lang3.StringUtils; -import org.fluentlenium.adapter.FluentTest; -import org.fluentlenium.core.domain.FluentList; -import org.fluentlenium.core.domain.FluentWebElement; -import org.junit.Test; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.firefox.FirefoxDriver; -import org.openqa.selenium.ie.InternetExplorerDriver; -import org.openqa.selenium.safari.SafariDriver; - -import java.io.File; -import java.io.FileInputStream; -import java.util.Properties; - -/** - * @author Olivier Lamy - */ -public class WebDriverTest - extends FluentTest -{ - - @Test - public void simpletest() - throws Exception - { - - Properties tomcatPortProperties = new Properties(); - tomcatPortProperties.load( - new FileInputStream( new File( System.getProperty( "tomcat.propertiesPortFilePath" ) ) ) ); - - int tomcatPort = Integer.parseInt( tomcatPortProperties.getProperty( "tomcat.maven.http.port" ) ); - - goTo( "http://localhost:" + tomcatPort + "/archiva/index.html?request_lang=en" ); - - FluentList elements = find( "#create-admin-link-a" ); - - if ( !elements.isEmpty() && elements.get( 0 ).isDisplayed() ) - { - WebElement webElement = elements.get( 0 ).getElement(); - Assert.assertEquals( "Create Admin User", webElement.getText() ); - } - else - { - elements = find( "#login-link-a" ); - WebElement webElement = elements.get( 0 ).getElement(); - Assert.assertEquals( "LOGIN", webElement.getText() ); - } - - } - - @Override - public WebDriver getDefaultDriver() - { - String seleniumBrowser = System.getProperty( "selenium.browser" ); - - if ( StringUtils.contains( seleniumBrowser, "chrome" ) ) - { - return new ChromeDriver(); - } - - if ( StringUtils.contains( seleniumBrowser, "safari" ) ) - { - return new SafariDriver(); - } - - if ( StringUtils.contains( seleniumBrowser, "iexplore" ) ) - { - return new InternetExplorerDriver(); - } - - return new FirefoxDriver(); - - } -} diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/XPathExpressionUtil.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/XPathExpressionUtil.java deleted file mode 100644 index 5dd77ca83..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/XPathExpressionUtil.java +++ /dev/null @@ -1,242 +0,0 @@ -package org.apache.archiva.web.test; - -/* - * 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 - * - * 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. - */ - -/** - * Utility class for creating xpath expressions - */ -public class XPathExpressionUtil -{ - public static final String CONTAINS = "contains"; - - public static final String AND = " and "; - - public static final String CURRENT_NODE = "./"; - - public static final String PARENT_NODE = "../"; - - public static final String GRANDPARENT_NODE = "../../"; - - public static final String ELEMENT_ANY_LEVEL = "//"; - - public static final String TABLE_COLUMN = "td"; - - public static final String TABLE_ROW = "tr"; - - public static final String START_NODE_TEST = "["; - - public static final String END_NODE_TEST = "]"; - - public static final String ANCHOR = "a"; - - public static final String IMG = "img"; - - public static final String LIST = "ul"; - - public static final String LINE = "li"; - - public static String getList( String[] values ) - { - String xpathExpression = ""; - - if ( values.length > 0 ) - { - xpathExpression += ELEMENT_ANY_LEVEL; - xpathExpression += LIST; - xpathExpression += START_NODE_TEST; - - for ( int nIndex = 0; nIndex < values.length; nIndex++ ) - { - xpathExpression += ( ( nIndex > 0 ) ? AND : "" ); - xpathExpression += contains( LINE + position( nIndex + 1 ), values[nIndex] ); - } - - xpathExpression += END_NODE_TEST; - } - - return xpathExpression; - } - - /** - * expression for acquiring an element in one of the table columns - * - * @param element the node element - * @param elementIndex column index of the element, used for skipping - * @param columnValues the values to be matched in each column, element column is included - * @return - */ - public static String getColumnElement( String element, int elementIndex, String[] columnValues ) - { - return getColumnElement( element, elementIndex, null, columnValues ); - } - - /** - * expression for acquiring an element in one of the table columns - * - * @param element the node element - * @param elementIndex column index of the element, used for skipping - * @param elementValue the matched element value - * @param columnValues the values to be matched in each column, element column is included - * @return - */ - public static String getColumnElement( String element, int elementIndex, String elementValue, String[] columnValues ) - { - return getColumnElement( element, elementIndex, elementValue, "TEXT", columnValues ); - } - - /** - * expression for acquiring an element in one of the table columns - * - * @param element the node element - * @param elementIndex column index of the element, used for skipping - * @param imageName the matched image name - * @param columnValues the values to be matched in each column, element column is included - * @return - */ - public static String getImgColumnElement( String element, int elementIndex, String imageName, String[] columnValues ) - { - return getColumnElement( element, elementIndex, imageName, IMG, columnValues ); - } - - /** - * expression for acquiring an element in one of the table columns - * - * @param element the node element - * @param elementIndex column index of the element, used for skipping - * @param imageName the matched image name - * @param columnValues the values to be matched in each column, element column is included - * @return - */ - private static String getColumnElement( String element, int elementIndex, String elementValue, - String elementValueType, String[] columnValues ) - { - String xpathExpression = null; - - if ( ( columnValues != null ) && ( columnValues.length > 0 ) ) - { - xpathExpression = ELEMENT_ANY_LEVEL + element; - xpathExpression += START_NODE_TEST; - - if ( elementValue != null ) - { - if ( "TEXT".equals( elementValueType ) ) - { - xpathExpression += contains( elementValue ); - xpathExpression += ( columnValues.length > 0 ) ? AND : ""; - } - } - - // we are two levels below the table row element ( tr/td/ ) - xpathExpression += matchColumns( GRANDPARENT_NODE, columnValues, elementIndex ); - - xpathExpression += END_NODE_TEST; - } - - if ( IMG.equals( elementValueType ) ) - { - xpathExpression += "/img[contains(@src, '" + elementValue + "')]"; - } - - return xpathExpression; - } - - /** - * expression for acquiring the table row that matches all column values with the same order as the list - * - * @param columnValues the matched list of columnValues - * @return - */ - public static String getTableRow( String[] columnValues ) - { - String xpathExpression = null; - - if ( ( columnValues != null ) && ( columnValues.length > 0 ) ) - { - xpathExpression = new String( ELEMENT_ANY_LEVEL + TABLE_ROW + START_NODE_TEST ); - xpathExpression += matchColumns( columnValues ); - xpathExpression += END_NODE_TEST; - } - - return xpathExpression; - } - - private static String matchColumns( String[] columnValues ) - { - return matchColumns( columnValues, -1 ); - } - - private static String matchColumns( String[] columnValues, int skipIndex ) - { - return matchColumns( null, columnValues, skipIndex ); - } - - private static String matchColumns( String parent, String[] columnValues, int skipIndex ) - { - String xpathExpression = ""; - - for ( int nIndex = 0; nIndex < columnValues.length; nIndex++ ) - { - if ( ( skipIndex != nIndex ) || ( skipIndex == -1 ) ) - { - // prepend "and" if index > 0 - xpathExpression += ( ( nIndex > 0 ) ? AND : "" ); - xpathExpression += contains( parent, TABLE_COLUMN + position( nIndex + 1 ), columnValues[nIndex] ); - } - } - - return xpathExpression; - } - - private static String position( int nIndex ) - { - return new String( "[" + nIndex + "]" ); - } - - private static String contains( String parent, String element, String matchedString ) - { - String finalElement = ( parent != null ) ? parent : ""; - finalElement += element; - - return contains( finalElement, matchedString ); - } - - private static String contains( String matchedString ) - { - return contains( ".", matchedString ); - } - - private static String contains( String axis, String matchedString ) - { - return new String( CONTAINS + "(" + axis + "," + "'" + matchedString + "')" ); - } - - private static String equals( String parent, String element, String matchedString ) - { - String finalElement = ( parent != null ) ? parent : ""; - finalElement += element; - - return equals( finalElement, matchedString ); - } - - private static String equals( String axis, String matchedString ) - { - return new String( axis + "==" + "'" + matchedString + "'" ); - } -} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java deleted file mode 100644 index 57fd5fd3e..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java +++ /dev/null @@ -1,188 +0,0 @@ -package org.apache.archiva.web.test.parent; - -import org.junit.runner.RunWith; -import org.junit.runners.BlockJUnit4ClassRunner; - -import java.io.File; -import java.io.IOException; - -/* - * 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 - * - * 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. - */ - -@RunWith( BlockJUnit4ClassRunner.class ) -public abstract class AbstractArchivaTest - extends AbstractSeleniumTest -{ - - protected String username; - - protected String fullname; - - public String getUserEmail() - { - String email = getProperty( "USERROLE_EMAIL" ); - return email; - } - - public String getUserRolePassword() - { - String password = getProperty( "USERROLE_PASSWORD" ); - return password; - } - - public String getUserRoleNewPassword() - { - String password_new = getProperty( "NEW_USERROLE_PASSWORD" ); - return password_new; - } - - public String getBasedir() - { - String basedir = System.getProperty( "basedir" ); - - if ( basedir == null ) - { - basedir = new File( "" ).getAbsolutePath(); - } - - return basedir; - } - - - public void submitUserData( String username, String password, boolean rememberme, boolean success ) - { - - setFieldValue( "username", username ); - setFieldValue( "password", password ); - if ( rememberme ) - { - checkField( "rememberMe" ); - } - - submit(); - if ( success ) - { - assertUserLoggedIn( username ); - } - else - { - assertLoginModal(); - } - } - - // User Management - - public void createUser( String userName, String fullName, String email, String password, boolean valid ) - { - createUser( userName, fullName, email, password, password, valid ); - } - - private void createUser( String userName, String fullName, String emailAd, String password, String confirmPassword, - boolean valid ) - { - - clickLinkWithLocator( "menu-users-list-a", true ); - clickLinkWithLocator( "users-view-tabs-li-user-edit-a", true ); - - assertCreateUserPage(); - setFieldValue( "username", userName ); - setFieldValue( "fullname", fullName ); - setFieldValue( "email", emailAd ); - setFieldValue( "password", password ); - setFieldValue( "confirmPassword", confirmPassword ); - - clickLinkWithLocator( "user-create-form-register-button", true ); - - assertTextPresent( "User " + userName + " created." ); - assertElementPresent( "users-grid-user-id-" + userName ); - - if ( valid ) - { - //String[] columnValues = { userName, fullName, emailAd }; - //assertElementPresent( XPathExpressionUtil.getTableRow( columnValues ) ); - - } - else - { - assertCreateUserPage(); - } - } - - public void deleteUser( String userName, String fullName, String emailAdd ) - { - deleteUser( userName, fullName, emailAdd, false, false ); - } - - public void deleteUser( String userName, String fullName, String emailAd, boolean validated, boolean locked ) - { - clickLinkWithLocator( "menu-users-list-a", true ); - assertTextPresent( userName ); - assertTextPresent( fullName ); - - clickLinkWithLocator( "users-grid-delete-" + userName ); - - clickLinkWithLocator( "dialog-confirm-modal-ok" ); - assertTextPresent( "User " + userName + " deleted." ); - - clickLinkWithLocator( "alert-message-success-close-a" ); - - assertElementNotPresent( "users-grid-user-id-" + userName ); - assertTextNotPresent( fullName ); - - - } - - // User Roles - - - public void assertCreateUserPage() - { - assertTextPresent( "Username" ); - assertElementPresent( "username" ); - assertTextPresent( "Full Name" ); - assertElementPresent( "fullname" ); - assertTextPresent( "Email Address" ); - assertElementPresent( "email" ); - assertTextPresent( "Password" ); - assertElementPresent( "password" ); - assertTextPresent( "Confirm Password" ); - assertElementPresent( "confirmPassword" ); - assertButtonWithIdPresent( "user-create-form-register-button" ); - - } - - public void goToHomePage() - { - getSelenium().open( baseUrl ); - } - - protected void logout() - { - clickLinkWithText( "Logout" ); - assertTextNotPresent( "Current User:" ); - assertLinkNotVisible( "Edit Details" ); - assertLinkNotVisible( "Logout" ); - assertLinkVisible( "Login" ); - } - - protected String getAdminUserName() - { - return getProperty( "ADMIN_FULLNAME" ); - } -} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java deleted file mode 100644 index 0ee53aac4..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java +++ /dev/null @@ -1,694 +0,0 @@ -package org.apache.archiva.web.test.parent; - -/* - * 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 - * - * 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. - */ - -import com.thoughtworks.selenium.DefaultSelenium; -import com.thoughtworks.selenium.Selenium; -import org.apache.archiva.web.test.tools.ArchivaSeleniumExecutionRule; -import org.junit.Assert; -import org.junit.Rule; - -import java.io.File; -import java.io.FileInputStream; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Properties; - -/** - * @author Emmanuel Venisse - * - */ - -public abstract class AbstractSeleniumTest -{ - - @Rule - public ArchivaSeleniumExecutionRule archivaSeleniumExecutionRule = new ArchivaSeleniumExecutionRule(); - - public String browser = System.getProperty( "browser" ); - - public String baseUrl = - "http://localhost:" + System.getProperty( "tomcat.maven.http.port" ) + "/archiva/index.html?request_lang=en"; - - public int maxWaitTimeInMs = Integer.getInteger( "maxWaitTimeInMs" ); - - public String seleniumHost = System.getProperty( "seleniumHost", "localhost" ); - - public int seleniumPort = Integer.getInteger( "seleniumPort", 4444 ); - - private Selenium selenium = null; - - public Properties p; - - /** - * this method is called by the Rule before executing a test - * - * @throws Exception - */ - public void open() - throws Exception - { - p = new Properties(); - p.load( this.getClass().getClassLoader().getResourceAsStream( "test.properties" ) ); - - Properties tomcatPortProperties = new Properties(); - tomcatPortProperties.load( - new FileInputStream( new File( System.getProperty( "tomcat.propertiesPortFilePath" ) ) ) ); - - int tomcatPort = Integer.parseInt( tomcatPortProperties.getProperty( "tomcat.maven.http.port" ) ); - - baseUrl = "http://localhost:" + tomcatPort + "/archiva/index.html?request_lang=en"; - - open( baseUrl, browser, seleniumHost, seleniumPort, maxWaitTimeInMs ); - archivaSeleniumExecutionRule.selenium = selenium; - assertAdminCreated(); - } - - /** - * this method is called by the Rule after executing a tests - */ - public void close() - { - if ( getSelenium() != null ) - { - getSelenium().stop(); - } - } - - /** - * Initialize selenium - */ - public void open( String baseUrl, String browser, String seleniumHost, int seleniumPort, int maxWaitTimeInMs ) - throws Exception - { - try - { - if ( getSelenium() == null ) - { - selenium = new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl ); - selenium.start(); - selenium.setTimeout( Integer.toString( maxWaitTimeInMs ) ); - } - } - catch ( Exception e ) - { - // yes - System.out.print( e.getMessage() ); - e.printStackTrace(); - } - } - - public void assertAdminCreated() - throws Exception - { - initializeArchiva( baseUrl, browser, maxWaitTimeInMs, seleniumHost, seleniumPort ); - } - - public void initializeArchiva( String baseUrl, String browser, int maxWaitTimeInMs, String seleniumHost, - int seleniumPort ) - throws Exception - { - - open( baseUrl, browser, seleniumHost, seleniumPort, maxWaitTimeInMs ); - - getSelenium().open( baseUrl ); - - waitPage(); - - // if not admin user created create one - if ( isElementVisible( "create-admin-link" ) ) - { - Assert.assertFalse( getSelenium().isVisible( "login-link-a" ) ); - Assert.assertFalse( getSelenium().isVisible( "register-link-a" ) ); - clickLinkWithLocator( "create-admin-link-a", false ); - assertCreateAdmin(); - String fullname = getProperty( "ADMIN_FULLNAME" ); - String username = getAdminUsername(); - String mail = getProperty( "ADMIN_EMAIL" ); - String password = getProperty( "ADMIN_PASSWORD" ); - submitAdminData( fullname, mail, password ); - assertUserLoggedIn( username ); - clickLinkWithLocator( "logout-link-a" ); - } - else - { - Assert.assertTrue( getSelenium().isVisible( "login-link-a" ) ); - Assert.assertTrue( getSelenium().isVisible( "register-link-a" ) ); - login( getAdminUsername(), getAdminPassword() ); - } - - } - - public Selenium getSelenium() - { - return selenium; - } - - protected String getProperty( String key ) - { - return p.getProperty( key ); - } - - public String getAdminUsername() - { - String adminUsername = getProperty( "ADMIN_USERNAME" ); - return adminUsername; - } - - public String getAdminPassword() - { - String adminPassword = getProperty( "ADMIN_PASSWORD" ); - return adminPassword; - } - - public void submitAdminData( String fullname, String email, String password ) - { - setFieldValue( "fullname", fullname ); - setFieldValue( "email", email ); - setFieldValue( "password", password ); - setFieldValue( "confirmPassword", password ); - clickButtonWithLocator( "user-create-form-register-button" ); - } - - public void login( String username, String password ) - { - login( username, password, true, "Login Page" ); - } - - public void login( String username, String password, boolean valid, String assertReturnPage ) - { - if ( isElementVisible( "login-link-a" ) )//isElementPresent( "loginLink" ) ) - { - goToLoginPage(); - - submitLoginPage( username, password, false, valid, assertReturnPage ); - } - if ( valid ) - { - assertUserLoggedIn( username ); - } - } - - // Go to Login Page - public void goToLoginPage() - { - getSelenium().open( baseUrl ); - waitPage(); - // are we already logged in ? - if ( isElementVisible( "logout-link" ) ) //isElementPresent( "logoutLink" ) ) - { - // so logout - clickLinkWithLocator( "logout-link-a", false ); - clickLinkWithLocator( "login-link-a" ); - } - else if ( isElementVisible( "login-link-a" ) ) - { - clickLinkWithLocator( "login-link-a" ); - } - assertLoginModal(); - } - - - public void assertLoginModal() - { - assertElementPresent( "user-login-form" ); - Assert.assertTrue( isElementVisible( "register-link" ) ); - assertElementPresent( "user-login-form-username" ); - assertElementPresent( "user-login-form-password" ); - assertButtonWithIdPresent( "modal-login-ok" ); - } - - - public void submitLoginPage( String username, String password ) - { - submitLoginPage( username, password, false, true, "Login Page" ); - } - - public void submitLoginPage( String username, String password, boolean validUsernamePassword ) - { - submitLoginPage( username, password, false, validUsernamePassword, "Login Page" ); - } - - public void submitLoginPage( String username, String password, boolean rememberMe, boolean validUsernamePassword, - String assertReturnPage ) - { - clickLinkWithLocator( "login-link-a", false ); - setFieldValue( "user-login-form-username", username ); - setFieldValue( "user-login-form-password", password ); - /* - if ( rememberMe ) - { - checkField( "rememberMe" ); - }*/ - - clickButtonWithLocator( "modal-login-ok" ); - if ( validUsernamePassword ) - { - assertUserLoggedIn( username ); - } - /* - else - { - if ( "Login Page".equals( assertReturnPage ) ) - { - assertLoginPage(); - } - else - { - assertPage( assertReturnPage ); - } - }*/ - } - - // ******************************************************* - // Auxiliar methods. This method help us and simplify test. - // ******************************************************* - - protected void assertUserLoggedIn( String username ) - { - Assert.assertFalse( isElementVisible( "login-link" ) ); - Assert.assertTrue( isElementVisible( "logout-link" ) ); - Assert.assertFalse( isElementVisible( "register-link" ) ); - Assert.assertFalse( isElementVisible( "create-admin-link" ) ); - } - - public void assertCreateAdmin() - { - assertElementPresent( "user-create" ); - assertFieldValue( "admin", "username" ); - assertElementPresent( "fullname" ); - assertElementPresent( "password" ); - assertElementPresent( "confirmPassword" ); - assertElementPresent( "email" ); - } - - public void assertFieldValue( String fieldValue, String fieldName ) - { - assertElementPresent( fieldName ); - Assert.assertEquals( fieldValue, getSelenium().getValue( fieldName ) ); - } - - public void assertPage( String title ) - { - Assert.assertEquals( getTitle(), title ); - } - - public String getTitle() - { - // Collapse spaces - return getSelenium().getTitle().replaceAll( "[ \n\r]+", " " ); - } - - public String getHtmlContent() - { - return getSelenium().getHtmlSource(); - } - - public String getText( String locator ) - { - return getSelenium().getText( locator ); - } - - public void assertTextPresent( String text ) - { - Assert.assertTrue( "'" + text + "' isn't present.", getSelenium().isTextPresent( text ) ); - } - - /** - * one of text args must be in the page so use en and fr text (olamy use en locale :-) ) - * - * @param texts - */ - public void assertTextPresent( String... texts ) - { - boolean present = false; - StringBuilder sb = new StringBuilder(); - for ( String text : texts ) - { - present = present || getSelenium().isTextPresent( text ); - sb.append( " " + text + " " ); - } - Assert.assertTrue( "'one of the following test " + sb.toString() + "' isn't present.", present ); - } - - public void assertTextNotPresent( String text ) - { - Assert.assertFalse( "'" + text + "' is present.", getSelenium().isTextPresent( text ) ); - } - - public void assertElementPresent( String elementLocator ) - { - Assert.assertTrue( "'" + elementLocator + "' isn't present.", isElementPresent( elementLocator ) ); - } - - public void assertElementNotPresent( String elementLocator ) - { - Assert.assertFalse( "'" + elementLocator + "' is present.", isElementPresent( elementLocator ) ); - } - - public void assertLinkPresent( String text ) - { - Assert.assertTrue( "The link '" + text + "' isn't present.", isElementPresent( "link=" + text ) ); - } - - public void assertLinkNotPresent( String text ) - { - Assert.assertFalse( "The link('" + text + "' is present.", isElementPresent( "link=" + text ) ); - } - - public void assertLinkNotVisible( String text ) - { - Assert.assertFalse( "The link('" + text + "' is visible.", isElementVisible( "link=" + text ) ); - } - - public void assertLinkVisible( String text ) - { - Assert.assertTrue( "The link('" + text + "' is not visible.", isElementVisible( "link=" + text ) ); - } - - public void assertImgWithAlt( String alt ) - { - assertElementPresent( "/¯img[@alt='" + alt + "']" ); - } - - public void assertImgWithAltAtRowCol( boolean isALink, String alt, int row, int column ) - { - String locator = "//tr[" + row + "]/td[" + column + "]/"; - locator += isALink ? "a/" : ""; - locator += "img[@alt='" + alt + "']"; - - assertElementPresent( locator ); - } - - public void assertImgWithAltNotPresent( String alt ) - { - assertElementNotPresent( "/¯img[@alt='" + alt + "']" ); - } - - public void assertCellValueFromTable( String expected, String tableElement, int row, int column ) - { - Assert.assertEquals( expected, getCellValueFromTable( tableElement, row, column ) ); - } - - public boolean isTextPresent( String text ) - { - return getSelenium().isTextPresent( text ); - } - - public boolean isLinkPresent( String text ) - { - return isElementPresent( "link=" + text ); - } - - public boolean isElementPresent( String locator ) - { - return getSelenium().isElementPresent( locator ); - } - - public boolean isElementVisible( String locator ) - { - return getSelenium().isVisible( locator ); - } - - - public void waitPage() - { - // TODO define a smaller maxWaitTimeJsInMs for wait javascript response for browser side validation - //getSelenium().w .wait( Long.parseLong( maxWaitTimeInMs ) ); - //getSelenium().waitForPageToLoad( maxWaitTimeInMs ); - // http://jira.openqa.org/browse/SRC-302 - // those hack looks to break some tests :-( - // getSelenium().waitForCondition( "selenium.isElementPresent('document.body');", maxWaitTimeInMs ); - //getSelenium().waitForCondition( "selenium.isElementPresent('footer');", maxWaitTimeInMs ); - //getSelenium().waitForCondition( "selenium.browserbot.getCurrentWindow().document.getElementById('footer')", - // maxWaitTimeInMs ); - // so the only hack is to not use a too small wait time - - try - { - Thread.sleep( maxWaitTimeInMs ); - } - catch ( InterruptedException e ) - { - throw new RuntimeException( "issue on Thread.sleep : " + e.getMessage(), e ); - } - } - - public String getFieldValue( String fieldName ) - { - return getSelenium().getValue( fieldName ); - } - - public String getCellValueFromTable( String tableElement, int row, int column ) - { - return getSelenium().getTable( tableElement + "." + row + "." + column ); - } - - public void selectValue( String locator, String value ) - { - getSelenium().select( locator, "label=" + value ); - } - - - public void assertOptionPresent( String selectField, String[] options ) - { - assertElementPresent( selectField ); - String[] optionsPresent = getSelenium().getSelectOptions( selectField ); - List expected = Arrays.asList( options ); - List present = Arrays.asList( optionsPresent ); - Assert.assertTrue( "Options expected are not included in present options", present.containsAll( expected ) ); - } - - public void assertSelectedValue( String value, String fieldName ) - { - assertElementPresent( fieldName ); - String optionsPresent = getSelenium().getSelectedLabel( value ); - Assert.assertEquals( optionsPresent, value ); - } - - public void submit() - { - clickLinkWithXPath( "//input[@type='submit']" ); - } - - public void assertButtonWithValuePresent( String text ) - { - Assert.assertTrue( "'" + text + "' button isn't present", isButtonWithValuePresent( text ) ); - } - - public void assertButtonWithIdPresent( String id ) - { - Assert.assertTrue( "'Button with id =" + id + "' isn't present", isButtonWithIdPresent( id ) ); - } - - public void assertButtonWithValueNotPresent( String text ) - { - Assert.assertFalse( "'" + text + "' button is present", isButtonWithValuePresent( text ) ); - } - - public boolean isButtonWithValuePresent( String text ) - { - return isElementPresent( "//button[@value='" + text + "']" ) || isElementPresent( - "//input[@value='" + text + "']" ); - } - - public boolean isButtonWithIdPresent( String text ) - { - return isElementPresent( "//button[@id='" + text + "']" ) || isElementPresent( "//input[@id='" + text + "']" ); - } - - public void clickButtonWithName( String text, boolean wait ) - { - clickLinkWithXPath( "//input[@name='" + text + "']", wait ); - } - - public void clickButtonWithValue( String text ) - { - clickButtonWithValue( text, true ); - } - - public void clickButtonWithValue( String text, boolean wait ) - { - assertButtonWithValuePresent( text ); - - if ( isElementPresent( "//button[@value='" + text + "']" ) ) - { - clickLinkWithXPath( "//button[@value='" + text + "']", wait ); - } - else - { - clickLinkWithXPath( "//input[@value='" + text + "']", wait ); - } - } - - public void clickSubmitWithLocator( String locator ) - { - clickLinkWithLocator( locator ); - } - - public void clickSubmitWithLocator( String locator, boolean wait ) - { - clickLinkWithLocator( locator, wait ); - } - - public void clickImgWithAlt( String alt ) - { - clickLinkWithLocator( "//img[@alt='" + alt + "']" ); - } - - public void clickLinkWithText( String text ) - { - clickLinkWithText( text, true ); - } - - public void clickLinkWithText( String text, boolean wait ) - { - clickLinkWithLocator( "link=" + text, wait ); - } - - public void clickLinkWithXPath( String xpath ) - { - clickLinkWithXPath( xpath, true ); - } - - public void clickLinkWithXPath( String xpath, boolean wait ) - { - clickLinkWithLocator( "xpath=" + xpath, wait ); - } - - public void clickLinkWithLocator( String locator ) - { - clickLinkWithLocator( locator, true ); - } - - public void clickLinkWithLocator( String locator, boolean wait ) - { - assertElementPresent( locator ); - getSelenium().click( locator ); - if ( wait ) - { - waitPage(); - } - } - - public void clickButtonWithLocator( String locator ) - { - clickButtonWithLocator( locator, true ); - } - - public void clickButtonWithLocator( String locator, boolean wait ) - { - assertElementPresent( locator ); - getSelenium().click( locator ); - if ( wait ) - { - waitPage(); - } - } - - public void setFieldValues( Map fieldMap ) - { - Map.Entry entry; - - for ( Iterator> entries = fieldMap.entrySet().iterator(); entries.hasNext(); ) - { - entry = entries.next(); - - getSelenium().type( entry.getKey(), entry.getValue() ); - } - } - - public void setFieldValue( String fieldName, String value ) - { - getSelenium().type( fieldName, value ); - } - - public void checkField( String locator ) - { - getSelenium().check( locator ); - } - - public void uncheckField( String locator ) - { - getSelenium().uncheck( locator ); - } - - public boolean isChecked( String locator ) - { - return getSelenium().isChecked( locator ); - } - - public void assertIsChecked( String locator ) - { - Assert.assertTrue( getSelenium().isChecked( locator ) ); - } - - public void assertIsNotChecked( String locator ) - { - Assert.assertFalse( getSelenium().isChecked( locator ) ); - } - - public void assertXpathCount( String locator, int expectedCount ) - { - int count = getSelenium().getXpathCount( locator ).intValue(); - Assert.assertEquals( count, expectedCount ); - } - - public void assertElementValue( String locator, String expectedValue ) - { - Assert.assertEquals( getSelenium().getValue( locator ), expectedValue ); - } - - public String captureScreenShotOnFailure( Throwable failure, String methodName, String className ) - { - SimpleDateFormat sdf = new SimpleDateFormat( "yyyy.MM.dd-HH_mm_ss" ); - String time = sdf.format( new Date() ); - File targetPath = new File( "target", "screenshots" ); - - int lineNumber = 0; - - for ( StackTraceElement stackTrace : failure.getStackTrace() ) - { - if ( stackTrace.getClassName().equals( this.getClass().getName() ) ) - { - lineNumber = stackTrace.getLineNumber(); - break; - } - } - - targetPath.mkdirs(); - Selenium selenium = getSelenium(); - String fileBaseName = methodName + "_" + className + ".java_" + lineNumber + "-" + time; - - selenium.windowMaximize(); - - File fileName = new File( targetPath, fileBaseName + ".png" ); - - selenium.captureEntirePageScreenshot( fileName.getAbsolutePath(), "background=#FFFFFF" ); - - return fileName.getAbsolutePath(); - } - -} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java deleted file mode 100644 index b113ccf4e..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.apache.archiva.web.test.tools; -/* - * 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 - * - * 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. - */ - -import com.thoughtworks.selenium.Selenium; -import org.apache.archiva.web.test.parent.AbstractSeleniumTest; -import org.junit.rules.MethodRule; -import org.junit.runner.Description; -import org.junit.runners.model.FrameworkMethod; -import org.junit.runners.model.Statement; - -/** - * @author Olivier Lamy - */ -public class ArchivaSeleniumExecutionRule - implements MethodRule //TestRule -{ - // FIXME cerate a separate TestRule for open and close calls ? - public Selenium selenium; - - public Statement apply( Statement base, FrameworkMethod method, Object target ) - { - try - { - ( (AbstractSeleniumTest) target ).open(); - method.getMethod().invoke( target ); - } - catch ( Throwable e ) - { - String fileName = - ( (AbstractSeleniumTest) target ).captureScreenShotOnFailure( e, method.getMethod().getName(), - target.getClass().getName() ); - - throw new RuntimeException( e.getMessage() + " see screenShot file:" + fileName, e ); - } - finally - { - ( (AbstractSeleniumTest) target ).close(); - } - return new Statement() - { - @Override - public void evaluate() - throws Throwable - { - // no op - } - }; - } - - public Statement apply( Statement base, Description description ) - { - return base; - } -} diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/conf/archiva.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/conf/archiva.xml deleted file mode 100644 index a95ad86e2..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/conf/archiva.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - false - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/conf/repository.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/conf/repository.xml deleted file mode 100644 index 0be86ebbd..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/conf/repository.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/conf/shared.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/conf/shared.xml deleted file mode 100644 index 9afb83352..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/conf/shared.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar deleted file mode 100644 index d98bcfb34..000000000 Binary files a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar and /dev/null differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.md5 deleted file mode 100644 index 7359be6f9..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -ea7dea9244b2a0975cfa117dc34fe18e \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.sha1 deleted file mode 100644 index 45ec67894..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -1039566ff5361d07eccd1243c45929b96441c7d6 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom deleted file mode 100644 index 606e1b194..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom +++ /dev/null @@ -1,54 +0,0 @@ - - 4.0.0 - test - test - jar - 1.0 - test - http://maven.apache.org - - - - Test License - http://www.test.org/test.html - - - - - - test user list - http://test.net/lists/listinfo/test-user - http://test.net/lists/listinfo/test-user - http://www.test-archive.com/test-user%40lists.test.net/ - - - test developer list - http://test.net/lists/listinfo/test-dev - http://test.net/lists/listinfo/test-dev - http://www.test-archive.com/test-dev%40lists.test.net/ - - - - - - test.group.id - testArtifactId - 1.0 - - - junit - junit - 3.8.1 - test - - - - - - test -file://localhost/Users/brett/scm/archiva/archiva/archiva-modules/archiva-web/archiva-webapp-test/src/test/it-resources/appserver-base/data/repositories/internal - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.md5 deleted file mode 100644 index 3b20276cd..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -f80c7c493716de649a99db00cd2ff34c \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.sha1 deleted file mode 100644 index d7c09225e..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -4b95c6fa09d1e02efdb69129f53f025e33bc8958 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml deleted file mode 100644 index 68287fd4e..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - test - test - 1.0 - - - 1.0 - - 20100114015837 - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.md5 deleted file mode 100644 index 4bb9667e4..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -dab1b8c2475fe839f387ceaef0d82b30 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.sha1 deleted file mode 100644 index f00268387..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -4e5b414d5419121ef75131cb52235a9abbf2095a \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/archiva.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/archiva.xml deleted file mode 100644 index 57dc7f860..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/archiva.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/index/_7.cfs b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/index/_7.cfs deleted file mode 100644 index e95ea7eb8..000000000 Binary files a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/index/_7.cfs and /dev/null differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/index/deletable b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/index/deletable deleted file mode 100644 index 593f4708d..000000000 Binary files a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/index/deletable and /dev/null differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/index/segments b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/index/segments deleted file mode 100644 index d9d4f014f..000000000 Binary files a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/index/segments and /dev/null differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/local-repo/settings.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/local-repo/settings.xml deleted file mode 100644 index 23b66a9db..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/local-repo/settings.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - snapshots - admin - admin1 - - - - - repositories - - - snapshots - snapshots-repository - http://localhost:9696/archiva/repository/snapshots/ - - false - - - true - - - - - - snapshots - snapshots-repository - http://localhost:9696/archiva/repository/snapshot/ - - false - - - true - - - - - - - repositories - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/log4j.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/log4j.xml deleted file mode 100644 index 4957e2d89..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/log4j.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/log4j2-test.xml deleted file mode 100644 index 9294964db..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/log4j2-test.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/logging/log4j.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/logging/log4j.xml deleted file mode 100644 index 8ddcde5e9..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/logging/log4j.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/logging/log4j2-test.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/logging/log4j2-test.xml deleted file mode 100644 index e9a65a586..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/logging/log4j2-test.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/bad-dependency/bad-dependency.log b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/bad-dependency/bad-dependency.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/bad-dependency/bad-dependency2.log b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/bad-dependency/bad-dependency2.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/bad-dependency/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/bad-dependency/pom.xml deleted file mode 100644 index 24fc2aa46..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/bad-dependency/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - 4.0.0 - org.apache.archiva - bad-dependency - 1.0 - jar - Bad Dependency - - - org.apache.archiva.web.test - bad-dependency - 1.0 - - - org.apache.archiva.web.test - foo-bar - 1.2-SNAPSHOT - - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/dependency-in-proxied/dependency-in-proxied.log b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/dependency-in-proxied/dependency-in-proxied.log deleted file mode 100644 index e69de29bb..000000000 diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/dependency-in-proxied/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/dependency-in-proxied/pom.xml deleted file mode 100644 index 82606837b..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/projects/dependency-in-proxied/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - 4.0.0 - org.apache.archiva - dependency-in-proxied - 1.0 - jar - Dependency In Proxied - - - - com.lowagie - itext - 1.3 - - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/.datarefresh b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/.datarefresh deleted file mode 100644 index c53a40aad..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/.datarefresh +++ /dev/null @@ -1,7 +0,0 @@ -#Last Scan Information, managed by Archiva. DO NOT EDIT -#Thu Apr 19 17:04:36 PHT 2007 -scan.included.files=12 -scan.skipped.files=0 -scan.finished.timestamp=1176973476967 -scan.consumed.files=20 -scan.started.timestamp=1176973467414 diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.md5 deleted file mode 100644 index 158138e09..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -0360f14347d5502114ba7afe4ea2e07f \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.sha1 deleted file mode 100644 index c9524a069..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -4a667b9923fb936409b96c8242bebc2f96f374f5 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom deleted file mode 100644 index 9d419ea6d..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom +++ /dev/null @@ -1,25 +0,0 @@ - - 4.0.0 - org.apache.maven.archiva.web.test - artifact-a - jar - 1.0 - artifact-a - http://maven.apache.org - - - org.apache.maven.archiva.web.test - artifact-b - 2.0 - - - - - - org.apache.maven.wagon - wagon-webdav - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.md5 deleted file mode 100644 index 93cdd6f43..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -cdf69ffbcb888aacea6cfeaf479fefd1 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.sha1 deleted file mode 100644 index 293b6c1f4..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6a384b1ab62ed45ae7dee1a059815e94bbc7fa6 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml deleted file mode 100644 index 113676922..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml +++ /dev/null @@ -1,11 +0,0 @@ - - org.apache.maven.archiva.web.test - artifact-a - 1.0 - - - 1.0 - - 20070417090928 - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.md5 deleted file mode 100644 index a02aa88a4..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -bc87573a595a2c387b5baa4ad7d06743 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.sha1 deleted file mode 100644 index 11bee708c..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -e9ecaaa14a3c09b07206980c15749a631dbc986a \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.md5 deleted file mode 100644 index 3bb4fd4e6..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -16a308257949f23afa5d1f1dec41aa44 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.sha1 deleted file mode 100644 index e5d0934b1..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -36a3a9cc35b8ca0d73998d7b39d290b489800a22 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom deleted file mode 100644 index 218543673..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom +++ /dev/null @@ -1,25 +0,0 @@ - - 4.0.0 - org.apache.maven.archiva.web.test - artifact-b - jar - 2.0 - artifact-b - http://maven.apache.org - - - org.apache.maven.archiva.web.test - artifact-c - 3.0 - - - - - - org.apache.maven.wagon - wagon-webdav - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.md5 deleted file mode 100644 index 5fabe5807..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -be5b8f8539a62b5935793ebeb87215fd \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.sha1 deleted file mode 100644 index 6eb9715a0..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -012a658d4a4f70aa3e8dd4b2db67020817b7dfcc \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml deleted file mode 100644 index 60b171df5..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml +++ /dev/null @@ -1,11 +0,0 @@ - - org.apache.maven.archiva.web.test - artifact-b - 2.0 - - - 2.0 - - 20070417090908 - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.md5 deleted file mode 100644 index 80c703319..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -bedfccc27fc7dc262d5c99a7aa8b83d8 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.sha1 deleted file mode 100644 index 42390adcc..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -4902ea6b16838ff26f9136460c4394b0ad7cc7f5 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.md5 deleted file mode 100644 index edc258a75..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -853a10a201f8a296e37e856615c5349c \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.sha1 deleted file mode 100644 index aafda15fa..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -5155da8820ed77c43e983c1244d94a3b27bf08f7 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom deleted file mode 100644 index 8299fbf11..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - org.apache.maven.archiva.web.test - artifact-c - jar - 3.0 - artifact-c - http://maven.apache.org - - - junit - junit - 3.8.1 - test - - - - - - org.apache.maven.wagon - wagon-webdav - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.md5 deleted file mode 100644 index d225acc75..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -4df0417579b1492f37da14316adb85af \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.sha1 deleted file mode 100644 index 1f2435ee6..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -c3b007acd9c17b80753b39a4121255965e7e2e65 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml deleted file mode 100644 index 1d7394c7a..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml +++ /dev/null @@ -1,11 +0,0 @@ - - org.apache.maven.archiva.web.test - artifact-c - 3.0 - - - 3.0 - - 20070417090835 - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.md5 deleted file mode 100644 index 8c0378271..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -74d58d97e78d5e51cc02c489c5edba0d \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.sha1 deleted file mode 100644 index 535860369..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -5c7571eb35248be0f65758783b036e8f7899c146 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.md5 deleted file mode 100644 index 9d902f06e..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -55f498a518e1151ce2e54daa674691de \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.sha1 deleted file mode 100644 index b351a034e..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -730551bde461564d3f8a7e0178ef9bc54a86d2dd \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom deleted file mode 100644 index 478f8fd50..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom +++ /dev/null @@ -1,25 +0,0 @@ - - 4.0.0 - org.apache.maven.archiva.web.test - artifact-s - jar - 0.1 - artifact-s - http://maven.apache.org - - - org.apache.maven.archiva.web.test - artifact-a - 1.0 - - - - - - org.apache.maven.wagon - wagon-webdav - - - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.md5 deleted file mode 100644 index b49dc167a..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -746ba2848229dbc1c9683ece0e7f02c8 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.sha1 deleted file mode 100644 index ae029df5c..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -0d068f63069a86d982075a1dca7fe74fd95a29df \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml deleted file mode 100644 index ddcad75d9..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml +++ /dev/null @@ -1,11 +0,0 @@ - - org.apache.maven.archiva.web.test - artifact-s - 0.1 - - - 0.1 - - 20070417090721 - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.md5 deleted file mode 100644 index f6bd69743..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -baa0ad0afaba9cee66ec262b38f796b6 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.sha1 deleted file mode 100644 index c341e6296..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -dea84d579f673d2d87c7bd47e4318cdf8e59e4d0 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/.datarefresh b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/.datarefresh deleted file mode 100644 index c53a40aad..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/.datarefresh +++ /dev/null @@ -1,7 +0,0 @@ -#Last Scan Information, managed by Archiva. DO NOT EDIT -#Thu Apr 19 17:04:36 PHT 2007 -scan.included.files=12 -scan.skipped.files=0 -scan.finished.timestamp=1176973476967 -scan.consumed.files=20 -scan.started.timestamp=1176973467414 diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar deleted file mode 100644 index 033956d43..000000000 Binary files a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar and /dev/null differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.md5 deleted file mode 100644 index 0a3eeb690..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -306d556e6e5e4d604dc854d09ddcdefd \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.sha1 deleted file mode 100644 index 39c5c3061..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -afb6586f5eb4c63dd5735a0bed11c99c7fac6755 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom deleted file mode 100644 index d580176ff..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom +++ /dev/null @@ -1,9 +0,0 @@ - - 4.0.0 - org.apache.maven.archiva.web.test - foo-bar - 1.0-SNAPSHOT - - deployed - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.md5 deleted file mode 100644 index 6caf8be40..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -8e896baea663a45d7bd2737f8e464481 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.sha1 deleted file mode 100644 index a3bbc7ea1..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -e37897c617d78dedd978766a2db318d301e80105 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml deleted file mode 100644 index ab1eb426d..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml +++ /dev/null @@ -1,11 +0,0 @@ - - org.apache.maven.archiva.web.test - foo-bar - 1.0-SNAPSHOT - - - 1 - - 20070425105840 - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.md5 deleted file mode 100644 index 76ef1e4b3..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -add4f71a005137e9a296c5b192e900c2 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.sha1 deleted file mode 100644 index ebe7cf339..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -b505e302169e04fc821bf571da7435b1e42ef8d7 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml deleted file mode 100644 index 8f00ecefa..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml +++ /dev/null @@ -1,11 +0,0 @@ - - org.apache.maven.archiva.web.test - foo-bar - 1.0-SNAPSHOT - - - 1.0-SNAPSHOT - - 20070425105840 - - \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.md5 deleted file mode 100644 index f6270d9c8..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -f3b657fb48d2e82fee5fada169756938 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.sha1 deleted file mode 100644 index 7f4812f9f..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -f4629e609deb95cefdcdddc6dd8c2942d1c3e47f \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/test.properties b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/test.properties deleted file mode 100644 index 1913b032f..000000000 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/resources/test.properties +++ /dev/null @@ -1,143 +0,0 @@ -# -# 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 -# -# 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. -# - -# properties for integration tests - -ADMIN_USERNAME=admin -ADMIN_FULLNAME=Administrator -ADMIN_EMAIL=admin@localhost.fr -ADMIN_PASSWORD=admin1 - -SELENIUM_HOST=localhost -SELENIUM_PORT=4444 -SELENIUM_BROWSER=*firefox - -# Search, Artifact Management -SEARCH_BAD_ARTIFACT=asdf -# Existing Artifact -ARTIFACT_GROUPID=test -ARTIFACT_ARTIFACTID=test -ARTIFACT_VERSION=1.0 -ARTIFACT_PACKAGING=jar -ARTIFACT_CLASSNAME=test.App - -# Artifact for testing add artifact with valid values -VALIDARTIFACT_GROUPID=addArtifactValidValues -VALIDARTIFACT_ARTIFACTID=addArtifactValidValues-artifact - -# Artifact for upload action in audit log report - MRM-1304 -AUDITLOGARTIFACT_GROUPID=group.auditLogUpload -AUDITLOGARTIFACT_ARTIFACTID=auditLogUpload-artifact -AUDITLOG_EXPECTED_ARTIFACT=group/auditLogUpload/auditLogUpload-artifact/1.0/auditLogUpload-artifact-1.0.jar - -# Reports -REPOSITORY_NAME=internal -START_DATE=05/01/2009 -END_DATE=05/30/2009 - -# User Management -# For password and new password -USERROLE_EMAIL=admin@localhost.fr -USERROLE_PASSWORD=password1 -NEW_USERROLE_PASSWORD=password123 - -# Guest Role -GUEST_USERNAME=guest_user -GUEST_FULLNAME=The Test Guest -# Registered User Role -REGISTERED_USERNAME=reg_user -REGISTERED_FULLNAME=Registered User -# System Administrator -SYSAD_USERNAME=sys_admin -SYSAD_FULLNAME=System Administrator -# User Administrator -USERADMIN_USERNAME=user_admin -USERADMIN_FULLNAME=User Administrator -# Global Repository Manager -GLOBALREPOMANAGER_USERNAME=globalrepo_manager -GLOBALREPOMANAGER_FULLNAME=Global Repository Manager -# Global Repository Observer -GLOBALREPOOBSERVER_USERNAME=globalrepo_observer -GLOBALREPOOBSERVER_FULLNAME=Global Repository Observer -# Repository Manager - internal -REPOMANAGER_INTERNAL_USERNAME=repomanager_internal -REPOMANAGER_INTERNAL_FULLNAME=Repository Manager - internal -# Repository Manager - snapshots -REPOMANAGER_SNAPSHOTS_USERNAME=repomanager_snapshots -REPOMANAGER_SNAPSHOTS_FULLNAME=Repository Manager - snapshots -# Repository Observer - internal -REPOOBSERVER_INTERNAL_USERNAME=repoobserver_internal -REPOOBSERVER_INTERNAL_FULLNAME=Repository Observer - internal -# Repository Observer - snapshots -REPOOBSERVER_SNAPSHOTS_USERNAME=repoobserver_snapshots -REPOOBSERVER_SNAPSHOTS_FULLNAME=Repository Observer - snapshots - -# Add Artifact -GROUPID=test -ARTIFACTID=test -VERSION=1.0 -PACKAGING=jar -ARTIFACTFILEPATH=test -REPOSITORYID=internal - -GROUPID1=delete -ARTIFACTID1=delete -VERSION1=1.0 -PACKAGING1=jar -ARTIFACTFILEPATH1=test -REPOSITORYID1=internal - -GROUPID_DOTNETARTIFACT=dotNetTypes -ARTIFACTID_DOTNETARTIFACT=dotNetTypes -PACKAGING_DOTNETARTIFACT=library - -SNAPSHOT_GROUPID=org.apache.archiva -SNAPSHOT_ARTIFACTID=archiva-test -SNAPSHOT_VERSION=1.0-SNAPSHOT -SNAPSHOT_PACKAGING=jar -SNAPSHOT_ARTIFACTFILEPATH=src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar -SNAPSHOT_REPOSITORYID=snapshots - -ADD_REMOVE_GROUPID=artifact.dummy -ADD_REMOVE_ARTIFACTID=artifact-dummy - -# REPOSITORIES -# Manage Repositories -MANAGED_IDENTIFIER=testing1 -MANAGED_NAME=Testing Managed Repository -MANAGED_DIRECTORY= -MANAGED_INDEX_DIRECTORY= -MANAGED_TYPE= -MANAGED_CRON= -MANAGED_REPOPURGE_DAYSOLDERTHAN= -MANAGED_REPOPURGE_RETENTIONCOUNT= - -# Network Proxies -NETWORKPROXY_IDENTIFIER=networkproxytest -NETWORKPROXY_PROTOCOL=http -NETWORKPROXY_HOSTNAME= -NETWORKPROXY_PORT=8080 -NETWORKPROXY_USERNAME=admin -NETWORKPROXY_PASSWORD=admin123 - -# Browse - MRM-1278 test -SNAPSHOTS_REPOSITORY=snapshots -RELEASES_REPOSITORY=releases - - diff --git a/archiva-modules/archiva-web/archiva-webapp-test/ReadMe.txt b/archiva-modules/archiva-web/archiva-webapp-test/ReadMe.txt new file mode 100644 index 000000000..21fb72940 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/ReadMe.txt @@ -0,0 +1,34 @@ +ReadMe +---------- +Run selenium tests in src/test/testng with Maven and TestNG + - mvn clean install + +Run Selenium tests in src/test/testng against an existing Archiva instance + - Start Archiva + - Configure admin user for archiva (match values in src/test/resources/testng.properties ) + - modify src/test/resources/testng.properties as needed + - mvn clean install -Dcontainer-existing + +The Cargo installations are stored outside of target to avoid multiple downloads. +To remove the Cargo installations and re-download them next run, use: + - mvn -Pclean-cargo clean + +Internet Explorer and Safari users must disable their popup blockers. Using *iexplore as +the browser requires running as an Administrator on Windows 7/Vista, or alternatively you +can use *iexploreproxy. + + + + +IMPORTANT: + +When writing Selenium tests for artifact upload, please avoid using the "test" syllable/word for +the groupId or artifactId (ex. test.group:testAddArtifactValidValues:1.0) as this is used for the +search tests. The tests explicitly assert the returned number of hits for searching an artifact with +a groupId or artifactId containing the word "test", so if you upload or add a new artifact which has +the term "test", the number of hits will be different and the search tests will fail. + +See org.apache.archiva.web.test.SearchTest.java or read the related thread discussion at +http://old.nabble.com/Selenium-tests-failure-in-trunk-td27830786.html + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml new file mode 100644 index 000000000..30deb637a --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml @@ -0,0 +1,529 @@ + + + + 4.0.0 + + org.apache.archiva + archiva-web + 1.4-M4-SNAPSHOT + + archiva-webapp-test-js + pom + Archiva Web :: Javascript Application Tests + + + ${project.build.directory}/tomcat7x/webapps/archiva + 0 + ${project.build.directory}/tomcat-port.properties + + + + + + commons-io + commons-io + + + org.apache.archiva + archiva-webapp + war + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-slf4j-logging + + + plexus-component-api + org.codehaus.plexus + + + + + org.seleniumhq.selenium + selenium-java + ${selenium-server.version} + + + org.seleniumhq.selenium.client-drivers + selenium-java-client-driver + test + + + commons-logging + commons-logging + + + + + + org.fluentlenium + fluentlenium-festassert + 0.7.4 + test + + + + org.fluentlenium + fluentlenium-core + 0.7.4 + test + + + + + jdom + jdom + + + jaxen + jaxen + + + + + org.apache.derby + derby + + + javax.mail + mail + + + javax.activation + activation + + + commons-lang + commons-lang + + + + org.easytesting + fest-assert-core + test + + + + org.apache.logging.log4j.adapters + log4j-jcl + + + + org.apache.logging.log4j.adapters + log4j-slf4j-impl + + + + org.apache.logging.log4j.adapters + log4j12-api + + + + + + + + src/test/resources + true + + **/* + + + + + + + org.codehaus.mojo + selenium-maven-plugin + + + org.seleniumhq.selenium + selenium-server + ${selenium-server.version} + + + + org.seleniumhq.selenium + selenium-remote-driver + ${selenium-server.version} + + + + org.seleniumhq.selenium + selenium-api + ${selenium-server.version} + + + + + org.apache.rat + apache-rat-plugin + + + src/test/resources/appserver-base/** + src/test/resources/repository/** + src/test/resources/local-repo/** + src/test/resources/projects/** + src/test/resources/snapshots/** + src/test/tomcat*/conf/catalina.policy + + + + + + + + maven-resources-plugin + + + + testResources + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + testCompile + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + alphabetical + + + + integration-tests + integration-test + + test + + + + ${selenium.browser} + ${selenium.browser} + ${baseUrl} + ${maxWaitTimeInMs} + ${seleniumHost} + ${seleniumPort} + ${tomcat.propertiesPortFilePath} + + + + + + + + + + + create-container + + + !container + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unzip-archiva-webapp + compile + + unpack + + + + + ${project.groupId} + archiva-webapp + ${project.version} + war + + + ${webappDirectory} + true + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + process-classes + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + + + org.apache.derby + derby + ${derbyVersion} + + + javax.mail + mail + ${javaxMailVersion} + + + + + tomcat-run + + run-war-only + + pre-integration-test + + /archiva + ${container.test.port} + UTF-8 + ${webappDirectory} + true + true + + ${project.build.directory}/appserver-base + ${project.build.directory}/appserver-base + ${project.build.directory} + true + + ${project.build.testOutputDirectory}/archiva.xml + ${tomcat.propertiesPortFilePath} + true + + + + tomcat-shutdown + + shutdown + + post-integration-test + + + + + + + + existing-container + + + !baseUrl + + + + http://localhost:${container.test.port}/archiva/index.html?request_lang=en + + + + start-selenium + + + !seleniumHost + + + + localhost + 4444 + + + + + org.codehaus.mojo + selenium-maven-plugin + + + pre-integration-test + + start-server + + + true + ${seleniumPort} + true + + + + + + + + + firefox + + + !browser + + + + *firefox + + + + + chrome + + + browser + chrome + + + + *googlechrome + requiresUpload + + + + iexplore + + + browser + iexplore + + + + *iexplore + requiresUpload + + + + safari + + + browser + safari + + + + *safari + requiresUpload + + + + otherbrowser + + + browser + other + + + + *custom ${browserPath} + requiresUpload + + + + headless + + + + org.codehaus.mojo + selenium-maven-plugin + + + xvfb + validate + + xvfb + + + + + + + + + + ci-server + + + + org.apache.maven.plugins + maven-antrun-plugin + + + cleanup-files + + run + + + + + + + + + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java new file mode 100644 index 000000000..8be57aa14 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java @@ -0,0 +1,35 @@ +package org.apache.archiva.web.test; + +/* + * 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 + * + * 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. + */ + +import org.apache.archiva.web.test.parent.AbstractArchivaTest; +import org.junit.Test; + +public class ArchivaAdminTest + extends AbstractArchivaTest +{ + + @Test + public void testHome() + { + getSelenium().open( baseUrl ); + assertPage( "Apache Archiva" ); + } +} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java new file mode 100644 index 000000000..d0f50fb1d --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/LoginTest.java @@ -0,0 +1,87 @@ +package org.apache.archiva.web.test; + +/* + * 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 + * + * 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. + */ + +import org.apache.archiva.web.test.parent.AbstractArchivaTest; +import org.junit.Test; + +/** + * Based on LoginTest of Emmanuel Venisse test. + * + * @author José Morales Martínez + * + */ + + +public class LoginTest + extends AbstractArchivaTest +{ + + @Test + public void testWithBadUsername() + { + goToLoginPage(); + setFieldValue( "user-login-form-username", "badUsername" ); + clickLinkWithLocator( "modal-login-ok", true ); + assertTextPresent( "This field is required." ); + + } + + @Test + public void testWithBadPassword() + { + goToLoginPage(); + setFieldValue( "user-login-form-username", getProperty( "ADMIN_USERNAME" ) ); + setFieldValue( "user-login-form-password", "badPassword" ); + clickLinkWithLocator( "modal-login-ok", true ); + assertTextPresent( "You have entered an incorrect username and/or password" ); + } + + @Test + public void testWithEmptyUsername() + { + goToLoginPage(); + setFieldValue( "user-login-form-password", "password" ); + clickLinkWithLocator( "modal-login-ok", true ); + assertTextPresent( "This field is required." ); + } + + @Test + public void testWithEmptyPassword() + { + goToLoginPage(); + setFieldValue( "user-login-form-username", getProperty( "ADMIN_USERNAME" ) ); + clickLinkWithLocator( "modal-login-ok", true ); + assertTextPresent( "This field is required." ); + } + + @Test + public void testWithCorrectUsernamePassword() + { + goToLoginPage(); + setFieldValue( "user-login-form-username", getProperty( "ADMIN_USERNAME" ) ); + setFieldValue( "user-login-form-password", getProperty( "ADMIN_PASSWORD" ) ); + clickLinkWithLocator( "modal-login-ok", true ); + + assertUserLoggedIn( getProperty( "ADMIN_USERNAME" ) ); + } + + +} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RolesManagementTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RolesManagementTest.java new file mode 100644 index 000000000..1a13488a0 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RolesManagementTest.java @@ -0,0 +1,49 @@ +package org.apache.archiva.web.test; +/* + * 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 + * + * 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. + */ + +import org.apache.archiva.web.test.parent.AbstractArchivaTest; +import org.apache.commons.lang.StringUtils; +import org.junit.Assert; +import org.junit.Test; + + +/** + * @author Olivier Lamy + */ +public class RolesManagementTest + extends AbstractArchivaTest +{ + + @Test + public void testReadRolesAndUpdateDescription() + throws Exception + { + login( getAdminUsername(), getAdminPassword() ); + clickLinkWithLocator( "menu-roles-list-a", true ); + assertTextPresent( "Archiva System Administrator " ); + Assert.assertTrue( StringUtils.isEmpty( getText( "role-description-Guest" ) ) ); + clickLinkWithLocator( "edit-role-Guest" ); + String desc = "The guest description"; + setFieldValue( "role-edit-description", desc ); + clickButtonWithLocator( "role-edit-description-save" ); + clickLinkWithLocator( "roles-view-tabs-a-roles-grid" ); + Assert.assertTrue( StringUtils.equals( desc, getText( "role-description-Guest" ) ) ); + } +} diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/UserManagementTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/UserManagementTest.java new file mode 100644 index 000000000..720e9ba19 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/UserManagementTest.java @@ -0,0 +1,42 @@ +package org.apache.archiva.web.test; +/* + * 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 + * + * 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. + */ + +import org.apache.archiva.web.test.parent.AbstractArchivaTest; +import org.junit.Test; + +/** + * @author Olivier Lamy + */ + +public class UserManagementTest + extends AbstractArchivaTest +{ + @Test + public void testBasicAddDeleteUser() + { + username = getProperty( "GUEST_USERNAME" ); + fullname = getProperty( "GUEST_FULLNAME" ); + + createUser( username, fullname, getUserEmail(), getUserRolePassword(), true ); + deleteUser( username, fullname, getUserEmail() ); + logout(); + login( getAdminUsername(), getAdminPassword() ); + } +} diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java new file mode 100644 index 000000000..94c7f393b --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java @@ -0,0 +1,97 @@ +package org.apache.archiva.web.test; +/* + * 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 + * + * 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. + */ + +import junit.framework.Assert; +import org.apache.commons.lang3.StringUtils; +import org.fluentlenium.adapter.FluentTest; +import org.fluentlenium.core.domain.FluentList; +import org.fluentlenium.core.domain.FluentWebElement; +import org.junit.Test; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.ie.InternetExplorerDriver; +import org.openqa.selenium.safari.SafariDriver; + +import java.io.File; +import java.io.FileInputStream; +import java.util.Properties; + +/** + * @author Olivier Lamy + */ +public class WebDriverTest + extends FluentTest +{ + + @Test + public void simpletest() + throws Exception + { + + Properties tomcatPortProperties = new Properties(); + tomcatPortProperties.load( + new FileInputStream( new File( System.getProperty( "tomcat.propertiesPortFilePath" ) ) ) ); + + int tomcatPort = Integer.parseInt( tomcatPortProperties.getProperty( "tomcat.maven.http.port" ) ); + + goTo( "http://localhost:" + tomcatPort + "/archiva/index.html?request_lang=en" ); + + FluentList elements = find( "#create-admin-link-a" ); + + if ( !elements.isEmpty() && elements.get( 0 ).isDisplayed() ) + { + WebElement webElement = elements.get( 0 ).getElement(); + Assert.assertEquals( "Create Admin User", webElement.getText() ); + } + else + { + elements = find( "#login-link-a" ); + WebElement webElement = elements.get( 0 ).getElement(); + Assert.assertEquals( "LOGIN", webElement.getText() ); + } + + } + + @Override + public WebDriver getDefaultDriver() + { + String seleniumBrowser = System.getProperty( "selenium.browser" ); + + if ( StringUtils.contains( seleniumBrowser, "chrome" ) ) + { + return new ChromeDriver(); + } + + if ( StringUtils.contains( seleniumBrowser, "safari" ) ) + { + return new SafariDriver(); + } + + if ( StringUtils.contains( seleniumBrowser, "iexplore" ) ) + { + return new InternetExplorerDriver(); + } + + return new FirefoxDriver(); + + } +} diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/XPathExpressionUtil.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/XPathExpressionUtil.java new file mode 100644 index 000000000..5dd77ca83 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/XPathExpressionUtil.java @@ -0,0 +1,242 @@ +package org.apache.archiva.web.test; + +/* + * 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 + * + * 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. + */ + +/** + * Utility class for creating xpath expressions + */ +public class XPathExpressionUtil +{ + public static final String CONTAINS = "contains"; + + public static final String AND = " and "; + + public static final String CURRENT_NODE = "./"; + + public static final String PARENT_NODE = "../"; + + public static final String GRANDPARENT_NODE = "../../"; + + public static final String ELEMENT_ANY_LEVEL = "//"; + + public static final String TABLE_COLUMN = "td"; + + public static final String TABLE_ROW = "tr"; + + public static final String START_NODE_TEST = "["; + + public static final String END_NODE_TEST = "]"; + + public static final String ANCHOR = "a"; + + public static final String IMG = "img"; + + public static final String LIST = "ul"; + + public static final String LINE = "li"; + + public static String getList( String[] values ) + { + String xpathExpression = ""; + + if ( values.length > 0 ) + { + xpathExpression += ELEMENT_ANY_LEVEL; + xpathExpression += LIST; + xpathExpression += START_NODE_TEST; + + for ( int nIndex = 0; nIndex < values.length; nIndex++ ) + { + xpathExpression += ( ( nIndex > 0 ) ? AND : "" ); + xpathExpression += contains( LINE + position( nIndex + 1 ), values[nIndex] ); + } + + xpathExpression += END_NODE_TEST; + } + + return xpathExpression; + } + + /** + * expression for acquiring an element in one of the table columns + * + * @param element the node element + * @param elementIndex column index of the element, used for skipping + * @param columnValues the values to be matched in each column, element column is included + * @return + */ + public static String getColumnElement( String element, int elementIndex, String[] columnValues ) + { + return getColumnElement( element, elementIndex, null, columnValues ); + } + + /** + * expression for acquiring an element in one of the table columns + * + * @param element the node element + * @param elementIndex column index of the element, used for skipping + * @param elementValue the matched element value + * @param columnValues the values to be matched in each column, element column is included + * @return + */ + public static String getColumnElement( String element, int elementIndex, String elementValue, String[] columnValues ) + { + return getColumnElement( element, elementIndex, elementValue, "TEXT", columnValues ); + } + + /** + * expression for acquiring an element in one of the table columns + * + * @param element the node element + * @param elementIndex column index of the element, used for skipping + * @param imageName the matched image name + * @param columnValues the values to be matched in each column, element column is included + * @return + */ + public static String getImgColumnElement( String element, int elementIndex, String imageName, String[] columnValues ) + { + return getColumnElement( element, elementIndex, imageName, IMG, columnValues ); + } + + /** + * expression for acquiring an element in one of the table columns + * + * @param element the node element + * @param elementIndex column index of the element, used for skipping + * @param imageName the matched image name + * @param columnValues the values to be matched in each column, element column is included + * @return + */ + private static String getColumnElement( String element, int elementIndex, String elementValue, + String elementValueType, String[] columnValues ) + { + String xpathExpression = null; + + if ( ( columnValues != null ) && ( columnValues.length > 0 ) ) + { + xpathExpression = ELEMENT_ANY_LEVEL + element; + xpathExpression += START_NODE_TEST; + + if ( elementValue != null ) + { + if ( "TEXT".equals( elementValueType ) ) + { + xpathExpression += contains( elementValue ); + xpathExpression += ( columnValues.length > 0 ) ? AND : ""; + } + } + + // we are two levels below the table row element ( tr/td/ ) + xpathExpression += matchColumns( GRANDPARENT_NODE, columnValues, elementIndex ); + + xpathExpression += END_NODE_TEST; + } + + if ( IMG.equals( elementValueType ) ) + { + xpathExpression += "/img[contains(@src, '" + elementValue + "')]"; + } + + return xpathExpression; + } + + /** + * expression for acquiring the table row that matches all column values with the same order as the list + * + * @param columnValues the matched list of columnValues + * @return + */ + public static String getTableRow( String[] columnValues ) + { + String xpathExpression = null; + + if ( ( columnValues != null ) && ( columnValues.length > 0 ) ) + { + xpathExpression = new String( ELEMENT_ANY_LEVEL + TABLE_ROW + START_NODE_TEST ); + xpathExpression += matchColumns( columnValues ); + xpathExpression += END_NODE_TEST; + } + + return xpathExpression; + } + + private static String matchColumns( String[] columnValues ) + { + return matchColumns( columnValues, -1 ); + } + + private static String matchColumns( String[] columnValues, int skipIndex ) + { + return matchColumns( null, columnValues, skipIndex ); + } + + private static String matchColumns( String parent, String[] columnValues, int skipIndex ) + { + String xpathExpression = ""; + + for ( int nIndex = 0; nIndex < columnValues.length; nIndex++ ) + { + if ( ( skipIndex != nIndex ) || ( skipIndex == -1 ) ) + { + // prepend "and" if index > 0 + xpathExpression += ( ( nIndex > 0 ) ? AND : "" ); + xpathExpression += contains( parent, TABLE_COLUMN + position( nIndex + 1 ), columnValues[nIndex] ); + } + } + + return xpathExpression; + } + + private static String position( int nIndex ) + { + return new String( "[" + nIndex + "]" ); + } + + private static String contains( String parent, String element, String matchedString ) + { + String finalElement = ( parent != null ) ? parent : ""; + finalElement += element; + + return contains( finalElement, matchedString ); + } + + private static String contains( String matchedString ) + { + return contains( ".", matchedString ); + } + + private static String contains( String axis, String matchedString ) + { + return new String( CONTAINS + "(" + axis + "," + "'" + matchedString + "')" ); + } + + private static String equals( String parent, String element, String matchedString ) + { + String finalElement = ( parent != null ) ? parent : ""; + finalElement += element; + + return equals( finalElement, matchedString ); + } + + private static String equals( String axis, String matchedString ) + { + return new String( axis + "==" + "'" + matchedString + "'" ); + } +} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java new file mode 100644 index 000000000..57fd5fd3e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractArchivaTest.java @@ -0,0 +1,188 @@ +package org.apache.archiva.web.test.parent; + +import org.junit.runner.RunWith; +import org.junit.runners.BlockJUnit4ClassRunner; + +import java.io.File; +import java.io.IOException; + +/* + * 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 + * + * 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. + */ + +@RunWith( BlockJUnit4ClassRunner.class ) +public abstract class AbstractArchivaTest + extends AbstractSeleniumTest +{ + + protected String username; + + protected String fullname; + + public String getUserEmail() + { + String email = getProperty( "USERROLE_EMAIL" ); + return email; + } + + public String getUserRolePassword() + { + String password = getProperty( "USERROLE_PASSWORD" ); + return password; + } + + public String getUserRoleNewPassword() + { + String password_new = getProperty( "NEW_USERROLE_PASSWORD" ); + return password_new; + } + + public String getBasedir() + { + String basedir = System.getProperty( "basedir" ); + + if ( basedir == null ) + { + basedir = new File( "" ).getAbsolutePath(); + } + + return basedir; + } + + + public void submitUserData( String username, String password, boolean rememberme, boolean success ) + { + + setFieldValue( "username", username ); + setFieldValue( "password", password ); + if ( rememberme ) + { + checkField( "rememberMe" ); + } + + submit(); + if ( success ) + { + assertUserLoggedIn( username ); + } + else + { + assertLoginModal(); + } + } + + // User Management + + public void createUser( String userName, String fullName, String email, String password, boolean valid ) + { + createUser( userName, fullName, email, password, password, valid ); + } + + private void createUser( String userName, String fullName, String emailAd, String password, String confirmPassword, + boolean valid ) + { + + clickLinkWithLocator( "menu-users-list-a", true ); + clickLinkWithLocator( "users-view-tabs-li-user-edit-a", true ); + + assertCreateUserPage(); + setFieldValue( "username", userName ); + setFieldValue( "fullname", fullName ); + setFieldValue( "email", emailAd ); + setFieldValue( "password", password ); + setFieldValue( "confirmPassword", confirmPassword ); + + clickLinkWithLocator( "user-create-form-register-button", true ); + + assertTextPresent( "User " + userName + " created." ); + assertElementPresent( "users-grid-user-id-" + userName ); + + if ( valid ) + { + //String[] columnValues = { userName, fullName, emailAd }; + //assertElementPresent( XPathExpressionUtil.getTableRow( columnValues ) ); + + } + else + { + assertCreateUserPage(); + } + } + + public void deleteUser( String userName, String fullName, String emailAdd ) + { + deleteUser( userName, fullName, emailAdd, false, false ); + } + + public void deleteUser( String userName, String fullName, String emailAd, boolean validated, boolean locked ) + { + clickLinkWithLocator( "menu-users-list-a", true ); + assertTextPresent( userName ); + assertTextPresent( fullName ); + + clickLinkWithLocator( "users-grid-delete-" + userName ); + + clickLinkWithLocator( "dialog-confirm-modal-ok" ); + assertTextPresent( "User " + userName + " deleted." ); + + clickLinkWithLocator( "alert-message-success-close-a" ); + + assertElementNotPresent( "users-grid-user-id-" + userName ); + assertTextNotPresent( fullName ); + + + } + + // User Roles + + + public void assertCreateUserPage() + { + assertTextPresent( "Username" ); + assertElementPresent( "username" ); + assertTextPresent( "Full Name" ); + assertElementPresent( "fullname" ); + assertTextPresent( "Email Address" ); + assertElementPresent( "email" ); + assertTextPresent( "Password" ); + assertElementPresent( "password" ); + assertTextPresent( "Confirm Password" ); + assertElementPresent( "confirmPassword" ); + assertButtonWithIdPresent( "user-create-form-register-button" ); + + } + + public void goToHomePage() + { + getSelenium().open( baseUrl ); + } + + protected void logout() + { + clickLinkWithText( "Logout" ); + assertTextNotPresent( "Current User:" ); + assertLinkNotVisible( "Edit Details" ); + assertLinkNotVisible( "Logout" ); + assertLinkVisible( "Login" ); + } + + protected String getAdminUserName() + { + return getProperty( "ADMIN_FULLNAME" ); + } +} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java new file mode 100644 index 000000000..0ee53aac4 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java @@ -0,0 +1,694 @@ +package org.apache.archiva.web.test.parent; + +/* + * 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 + * + * 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. + */ + +import com.thoughtworks.selenium.DefaultSelenium; +import com.thoughtworks.selenium.Selenium; +import org.apache.archiva.web.test.tools.ArchivaSeleniumExecutionRule; +import org.junit.Assert; +import org.junit.Rule; + +import java.io.File; +import java.io.FileInputStream; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; + +/** + * @author Emmanuel Venisse + * + */ + +public abstract class AbstractSeleniumTest +{ + + @Rule + public ArchivaSeleniumExecutionRule archivaSeleniumExecutionRule = new ArchivaSeleniumExecutionRule(); + + public String browser = System.getProperty( "browser" ); + + public String baseUrl = + "http://localhost:" + System.getProperty( "tomcat.maven.http.port" ) + "/archiva/index.html?request_lang=en"; + + public int maxWaitTimeInMs = Integer.getInteger( "maxWaitTimeInMs" ); + + public String seleniumHost = System.getProperty( "seleniumHost", "localhost" ); + + public int seleniumPort = Integer.getInteger( "seleniumPort", 4444 ); + + private Selenium selenium = null; + + public Properties p; + + /** + * this method is called by the Rule before executing a test + * + * @throws Exception + */ + public void open() + throws Exception + { + p = new Properties(); + p.load( this.getClass().getClassLoader().getResourceAsStream( "test.properties" ) ); + + Properties tomcatPortProperties = new Properties(); + tomcatPortProperties.load( + new FileInputStream( new File( System.getProperty( "tomcat.propertiesPortFilePath" ) ) ) ); + + int tomcatPort = Integer.parseInt( tomcatPortProperties.getProperty( "tomcat.maven.http.port" ) ); + + baseUrl = "http://localhost:" + tomcatPort + "/archiva/index.html?request_lang=en"; + + open( baseUrl, browser, seleniumHost, seleniumPort, maxWaitTimeInMs ); + archivaSeleniumExecutionRule.selenium = selenium; + assertAdminCreated(); + } + + /** + * this method is called by the Rule after executing a tests + */ + public void close() + { + if ( getSelenium() != null ) + { + getSelenium().stop(); + } + } + + /** + * Initialize selenium + */ + public void open( String baseUrl, String browser, String seleniumHost, int seleniumPort, int maxWaitTimeInMs ) + throws Exception + { + try + { + if ( getSelenium() == null ) + { + selenium = new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl ); + selenium.start(); + selenium.setTimeout( Integer.toString( maxWaitTimeInMs ) ); + } + } + catch ( Exception e ) + { + // yes + System.out.print( e.getMessage() ); + e.printStackTrace(); + } + } + + public void assertAdminCreated() + throws Exception + { + initializeArchiva( baseUrl, browser, maxWaitTimeInMs, seleniumHost, seleniumPort ); + } + + public void initializeArchiva( String baseUrl, String browser, int maxWaitTimeInMs, String seleniumHost, + int seleniumPort ) + throws Exception + { + + open( baseUrl, browser, seleniumHost, seleniumPort, maxWaitTimeInMs ); + + getSelenium().open( baseUrl ); + + waitPage(); + + // if not admin user created create one + if ( isElementVisible( "create-admin-link" ) ) + { + Assert.assertFalse( getSelenium().isVisible( "login-link-a" ) ); + Assert.assertFalse( getSelenium().isVisible( "register-link-a" ) ); + clickLinkWithLocator( "create-admin-link-a", false ); + assertCreateAdmin(); + String fullname = getProperty( "ADMIN_FULLNAME" ); + String username = getAdminUsername(); + String mail = getProperty( "ADMIN_EMAIL" ); + String password = getProperty( "ADMIN_PASSWORD" ); + submitAdminData( fullname, mail, password ); + assertUserLoggedIn( username ); + clickLinkWithLocator( "logout-link-a" ); + } + else + { + Assert.assertTrue( getSelenium().isVisible( "login-link-a" ) ); + Assert.assertTrue( getSelenium().isVisible( "register-link-a" ) ); + login( getAdminUsername(), getAdminPassword() ); + } + + } + + public Selenium getSelenium() + { + return selenium; + } + + protected String getProperty( String key ) + { + return p.getProperty( key ); + } + + public String getAdminUsername() + { + String adminUsername = getProperty( "ADMIN_USERNAME" ); + return adminUsername; + } + + public String getAdminPassword() + { + String adminPassword = getProperty( "ADMIN_PASSWORD" ); + return adminPassword; + } + + public void submitAdminData( String fullname, String email, String password ) + { + setFieldValue( "fullname", fullname ); + setFieldValue( "email", email ); + setFieldValue( "password", password ); + setFieldValue( "confirmPassword", password ); + clickButtonWithLocator( "user-create-form-register-button" ); + } + + public void login( String username, String password ) + { + login( username, password, true, "Login Page" ); + } + + public void login( String username, String password, boolean valid, String assertReturnPage ) + { + if ( isElementVisible( "login-link-a" ) )//isElementPresent( "loginLink" ) ) + { + goToLoginPage(); + + submitLoginPage( username, password, false, valid, assertReturnPage ); + } + if ( valid ) + { + assertUserLoggedIn( username ); + } + } + + // Go to Login Page + public void goToLoginPage() + { + getSelenium().open( baseUrl ); + waitPage(); + // are we already logged in ? + if ( isElementVisible( "logout-link" ) ) //isElementPresent( "logoutLink" ) ) + { + // so logout + clickLinkWithLocator( "logout-link-a", false ); + clickLinkWithLocator( "login-link-a" ); + } + else if ( isElementVisible( "login-link-a" ) ) + { + clickLinkWithLocator( "login-link-a" ); + } + assertLoginModal(); + } + + + public void assertLoginModal() + { + assertElementPresent( "user-login-form" ); + Assert.assertTrue( isElementVisible( "register-link" ) ); + assertElementPresent( "user-login-form-username" ); + assertElementPresent( "user-login-form-password" ); + assertButtonWithIdPresent( "modal-login-ok" ); + } + + + public void submitLoginPage( String username, String password ) + { + submitLoginPage( username, password, false, true, "Login Page" ); + } + + public void submitLoginPage( String username, String password, boolean validUsernamePassword ) + { + submitLoginPage( username, password, false, validUsernamePassword, "Login Page" ); + } + + public void submitLoginPage( String username, String password, boolean rememberMe, boolean validUsernamePassword, + String assertReturnPage ) + { + clickLinkWithLocator( "login-link-a", false ); + setFieldValue( "user-login-form-username", username ); + setFieldValue( "user-login-form-password", password ); + /* + if ( rememberMe ) + { + checkField( "rememberMe" ); + }*/ + + clickButtonWithLocator( "modal-login-ok" ); + if ( validUsernamePassword ) + { + assertUserLoggedIn( username ); + } + /* + else + { + if ( "Login Page".equals( assertReturnPage ) ) + { + assertLoginPage(); + } + else + { + assertPage( assertReturnPage ); + } + }*/ + } + + // ******************************************************* + // Auxiliar methods. This method help us and simplify test. + // ******************************************************* + + protected void assertUserLoggedIn( String username ) + { + Assert.assertFalse( isElementVisible( "login-link" ) ); + Assert.assertTrue( isElementVisible( "logout-link" ) ); + Assert.assertFalse( isElementVisible( "register-link" ) ); + Assert.assertFalse( isElementVisible( "create-admin-link" ) ); + } + + public void assertCreateAdmin() + { + assertElementPresent( "user-create" ); + assertFieldValue( "admin", "username" ); + assertElementPresent( "fullname" ); + assertElementPresent( "password" ); + assertElementPresent( "confirmPassword" ); + assertElementPresent( "email" ); + } + + public void assertFieldValue( String fieldValue, String fieldName ) + { + assertElementPresent( fieldName ); + Assert.assertEquals( fieldValue, getSelenium().getValue( fieldName ) ); + } + + public void assertPage( String title ) + { + Assert.assertEquals( getTitle(), title ); + } + + public String getTitle() + { + // Collapse spaces + return getSelenium().getTitle().replaceAll( "[ \n\r]+", " " ); + } + + public String getHtmlContent() + { + return getSelenium().getHtmlSource(); + } + + public String getText( String locator ) + { + return getSelenium().getText( locator ); + } + + public void assertTextPresent( String text ) + { + Assert.assertTrue( "'" + text + "' isn't present.", getSelenium().isTextPresent( text ) ); + } + + /** + * one of text args must be in the page so use en and fr text (olamy use en locale :-) ) + * + * @param texts + */ + public void assertTextPresent( String... texts ) + { + boolean present = false; + StringBuilder sb = new StringBuilder(); + for ( String text : texts ) + { + present = present || getSelenium().isTextPresent( text ); + sb.append( " " + text + " " ); + } + Assert.assertTrue( "'one of the following test " + sb.toString() + "' isn't present.", present ); + } + + public void assertTextNotPresent( String text ) + { + Assert.assertFalse( "'" + text + "' is present.", getSelenium().isTextPresent( text ) ); + } + + public void assertElementPresent( String elementLocator ) + { + Assert.assertTrue( "'" + elementLocator + "' isn't present.", isElementPresent( elementLocator ) ); + } + + public void assertElementNotPresent( String elementLocator ) + { + Assert.assertFalse( "'" + elementLocator + "' is present.", isElementPresent( elementLocator ) ); + } + + public void assertLinkPresent( String text ) + { + Assert.assertTrue( "The link '" + text + "' isn't present.", isElementPresent( "link=" + text ) ); + } + + public void assertLinkNotPresent( String text ) + { + Assert.assertFalse( "The link('" + text + "' is present.", isElementPresent( "link=" + text ) ); + } + + public void assertLinkNotVisible( String text ) + { + Assert.assertFalse( "The link('" + text + "' is visible.", isElementVisible( "link=" + text ) ); + } + + public void assertLinkVisible( String text ) + { + Assert.assertTrue( "The link('" + text + "' is not visible.", isElementVisible( "link=" + text ) ); + } + + public void assertImgWithAlt( String alt ) + { + assertElementPresent( "/¯img[@alt='" + alt + "']" ); + } + + public void assertImgWithAltAtRowCol( boolean isALink, String alt, int row, int column ) + { + String locator = "//tr[" + row + "]/td[" + column + "]/"; + locator += isALink ? "a/" : ""; + locator += "img[@alt='" + alt + "']"; + + assertElementPresent( locator ); + } + + public void assertImgWithAltNotPresent( String alt ) + { + assertElementNotPresent( "/¯img[@alt='" + alt + "']" ); + } + + public void assertCellValueFromTable( String expected, String tableElement, int row, int column ) + { + Assert.assertEquals( expected, getCellValueFromTable( tableElement, row, column ) ); + } + + public boolean isTextPresent( String text ) + { + return getSelenium().isTextPresent( text ); + } + + public boolean isLinkPresent( String text ) + { + return isElementPresent( "link=" + text ); + } + + public boolean isElementPresent( String locator ) + { + return getSelenium().isElementPresent( locator ); + } + + public boolean isElementVisible( String locator ) + { + return getSelenium().isVisible( locator ); + } + + + public void waitPage() + { + // TODO define a smaller maxWaitTimeJsInMs for wait javascript response for browser side validation + //getSelenium().w .wait( Long.parseLong( maxWaitTimeInMs ) ); + //getSelenium().waitForPageToLoad( maxWaitTimeInMs ); + // http://jira.openqa.org/browse/SRC-302 + // those hack looks to break some tests :-( + // getSelenium().waitForCondition( "selenium.isElementPresent('document.body');", maxWaitTimeInMs ); + //getSelenium().waitForCondition( "selenium.isElementPresent('footer');", maxWaitTimeInMs ); + //getSelenium().waitForCondition( "selenium.browserbot.getCurrentWindow().document.getElementById('footer')", + // maxWaitTimeInMs ); + // so the only hack is to not use a too small wait time + + try + { + Thread.sleep( maxWaitTimeInMs ); + } + catch ( InterruptedException e ) + { + throw new RuntimeException( "issue on Thread.sleep : " + e.getMessage(), e ); + } + } + + public String getFieldValue( String fieldName ) + { + return getSelenium().getValue( fieldName ); + } + + public String getCellValueFromTable( String tableElement, int row, int column ) + { + return getSelenium().getTable( tableElement + "." + row + "." + column ); + } + + public void selectValue( String locator, String value ) + { + getSelenium().select( locator, "label=" + value ); + } + + + public void assertOptionPresent( String selectField, String[] options ) + { + assertElementPresent( selectField ); + String[] optionsPresent = getSelenium().getSelectOptions( selectField ); + List expected = Arrays.asList( options ); + List present = Arrays.asList( optionsPresent ); + Assert.assertTrue( "Options expected are not included in present options", present.containsAll( expected ) ); + } + + public void assertSelectedValue( String value, String fieldName ) + { + assertElementPresent( fieldName ); + String optionsPresent = getSelenium().getSelectedLabel( value ); + Assert.assertEquals( optionsPresent, value ); + } + + public void submit() + { + clickLinkWithXPath( "//input[@type='submit']" ); + } + + public void assertButtonWithValuePresent( String text ) + { + Assert.assertTrue( "'" + text + "' button isn't present", isButtonWithValuePresent( text ) ); + } + + public void assertButtonWithIdPresent( String id ) + { + Assert.assertTrue( "'Button with id =" + id + "' isn't present", isButtonWithIdPresent( id ) ); + } + + public void assertButtonWithValueNotPresent( String text ) + { + Assert.assertFalse( "'" + text + "' button is present", isButtonWithValuePresent( text ) ); + } + + public boolean isButtonWithValuePresent( String text ) + { + return isElementPresent( "//button[@value='" + text + "']" ) || isElementPresent( + "//input[@value='" + text + "']" ); + } + + public boolean isButtonWithIdPresent( String text ) + { + return isElementPresent( "//button[@id='" + text + "']" ) || isElementPresent( "//input[@id='" + text + "']" ); + } + + public void clickButtonWithName( String text, boolean wait ) + { + clickLinkWithXPath( "//input[@name='" + text + "']", wait ); + } + + public void clickButtonWithValue( String text ) + { + clickButtonWithValue( text, true ); + } + + public void clickButtonWithValue( String text, boolean wait ) + { + assertButtonWithValuePresent( text ); + + if ( isElementPresent( "//button[@value='" + text + "']" ) ) + { + clickLinkWithXPath( "//button[@value='" + text + "']", wait ); + } + else + { + clickLinkWithXPath( "//input[@value='" + text + "']", wait ); + } + } + + public void clickSubmitWithLocator( String locator ) + { + clickLinkWithLocator( locator ); + } + + public void clickSubmitWithLocator( String locator, boolean wait ) + { + clickLinkWithLocator( locator, wait ); + } + + public void clickImgWithAlt( String alt ) + { + clickLinkWithLocator( "//img[@alt='" + alt + "']" ); + } + + public void clickLinkWithText( String text ) + { + clickLinkWithText( text, true ); + } + + public void clickLinkWithText( String text, boolean wait ) + { + clickLinkWithLocator( "link=" + text, wait ); + } + + public void clickLinkWithXPath( String xpath ) + { + clickLinkWithXPath( xpath, true ); + } + + public void clickLinkWithXPath( String xpath, boolean wait ) + { + clickLinkWithLocator( "xpath=" + xpath, wait ); + } + + public void clickLinkWithLocator( String locator ) + { + clickLinkWithLocator( locator, true ); + } + + public void clickLinkWithLocator( String locator, boolean wait ) + { + assertElementPresent( locator ); + getSelenium().click( locator ); + if ( wait ) + { + waitPage(); + } + } + + public void clickButtonWithLocator( String locator ) + { + clickButtonWithLocator( locator, true ); + } + + public void clickButtonWithLocator( String locator, boolean wait ) + { + assertElementPresent( locator ); + getSelenium().click( locator ); + if ( wait ) + { + waitPage(); + } + } + + public void setFieldValues( Map fieldMap ) + { + Map.Entry entry; + + for ( Iterator> entries = fieldMap.entrySet().iterator(); entries.hasNext(); ) + { + entry = entries.next(); + + getSelenium().type( entry.getKey(), entry.getValue() ); + } + } + + public void setFieldValue( String fieldName, String value ) + { + getSelenium().type( fieldName, value ); + } + + public void checkField( String locator ) + { + getSelenium().check( locator ); + } + + public void uncheckField( String locator ) + { + getSelenium().uncheck( locator ); + } + + public boolean isChecked( String locator ) + { + return getSelenium().isChecked( locator ); + } + + public void assertIsChecked( String locator ) + { + Assert.assertTrue( getSelenium().isChecked( locator ) ); + } + + public void assertIsNotChecked( String locator ) + { + Assert.assertFalse( getSelenium().isChecked( locator ) ); + } + + public void assertXpathCount( String locator, int expectedCount ) + { + int count = getSelenium().getXpathCount( locator ).intValue(); + Assert.assertEquals( count, expectedCount ); + } + + public void assertElementValue( String locator, String expectedValue ) + { + Assert.assertEquals( getSelenium().getValue( locator ), expectedValue ); + } + + public String captureScreenShotOnFailure( Throwable failure, String methodName, String className ) + { + SimpleDateFormat sdf = new SimpleDateFormat( "yyyy.MM.dd-HH_mm_ss" ); + String time = sdf.format( new Date() ); + File targetPath = new File( "target", "screenshots" ); + + int lineNumber = 0; + + for ( StackTraceElement stackTrace : failure.getStackTrace() ) + { + if ( stackTrace.getClassName().equals( this.getClass().getName() ) ) + { + lineNumber = stackTrace.getLineNumber(); + break; + } + } + + targetPath.mkdirs(); + Selenium selenium = getSelenium(); + String fileBaseName = methodName + "_" + className + ".java_" + lineNumber + "-" + time; + + selenium.windowMaximize(); + + File fileName = new File( targetPath, fileBaseName + ".png" ); + + selenium.captureEntirePageScreenshot( fileName.getAbsolutePath(), "background=#FFFFFF" ); + + return fileName.getAbsolutePath(); + } + +} \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java new file mode 100644 index 000000000..b113ccf4e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java @@ -0,0 +1,71 @@ +package org.apache.archiva.web.test.tools; +/* + * 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 + * + * 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. + */ + +import com.thoughtworks.selenium.Selenium; +import org.apache.archiva.web.test.parent.AbstractSeleniumTest; +import org.junit.rules.MethodRule; +import org.junit.runner.Description; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.Statement; + +/** + * @author Olivier Lamy + */ +public class ArchivaSeleniumExecutionRule + implements MethodRule //TestRule +{ + // FIXME cerate a separate TestRule for open and close calls ? + public Selenium selenium; + + public Statement apply( Statement base, FrameworkMethod method, Object target ) + { + try + { + ( (AbstractSeleniumTest) target ).open(); + method.getMethod().invoke( target ); + } + catch ( Throwable e ) + { + String fileName = + ( (AbstractSeleniumTest) target ).captureScreenShotOnFailure( e, method.getMethod().getName(), + target.getClass().getName() ); + + throw new RuntimeException( e.getMessage() + " see screenShot file:" + fileName, e ); + } + finally + { + ( (AbstractSeleniumTest) target ).close(); + } + return new Statement() + { + @Override + public void evaluate() + throws Throwable + { + // no op + } + }; + } + + public Statement apply( Statement base, Description description ) + { + return base; + } +} diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/archiva.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/archiva.xml new file mode 100644 index 000000000..a95ad86e2 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/archiva.xml @@ -0,0 +1,8 @@ + + + + + false + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/repository.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/repository.xml new file mode 100644 index 000000000..0be86ebbd --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/repository.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/shared.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/shared.xml new file mode 100644 index 000000000..9afb83352 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/shared.xml @@ -0,0 +1 @@ + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar new file mode 100644 index 000000000..d98bcfb34 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.md5 new file mode 100644 index 000000000..7359be6f9 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.md5 @@ -0,0 +1 @@ +ea7dea9244b2a0975cfa117dc34fe18e \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.sha1 new file mode 100644 index 000000000..45ec67894 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.jar.sha1 @@ -0,0 +1 @@ +1039566ff5361d07eccd1243c45929b96441c7d6 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom new file mode 100644 index 000000000..606e1b194 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom @@ -0,0 +1,54 @@ + + 4.0.0 + test + test + jar + 1.0 + test + http://maven.apache.org + + + + Test License + http://www.test.org/test.html + + + + + + test user list + http://test.net/lists/listinfo/test-user + http://test.net/lists/listinfo/test-user + http://www.test-archive.com/test-user%40lists.test.net/ + + + test developer list + http://test.net/lists/listinfo/test-dev + http://test.net/lists/listinfo/test-dev + http://www.test-archive.com/test-dev%40lists.test.net/ + + + + + + test.group.id + testArtifactId + 1.0 + + + junit + junit + 3.8.1 + test + + + + + + test +file://localhost/Users/brett/scm/archiva/archiva/archiva-modules/archiva-web/archiva-webapp-test/src/test/it-resources/appserver-base/data/repositories/internal + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.md5 new file mode 100644 index 000000000..3b20276cd --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.md5 @@ -0,0 +1 @@ +f80c7c493716de649a99db00cd2ff34c \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.sha1 new file mode 100644 index 000000000..d7c09225e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/1.0/test-1.0.pom.sha1 @@ -0,0 +1 @@ +4b95c6fa09d1e02efdb69129f53f025e33bc8958 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml new file mode 100644 index 000000000..68287fd4e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml @@ -0,0 +1,12 @@ + + + test + test + 1.0 + + + 1.0 + + 20100114015837 + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.md5 new file mode 100644 index 000000000..4bb9667e4 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.md5 @@ -0,0 +1 @@ +dab1b8c2475fe839f387ceaef0d82b30 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.sha1 new file mode 100644 index 000000000..f00268387 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/data/repositories/internal/test/test/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +4e5b414d5419121ef75131cb52235a9abbf2095a \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/archiva.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/archiva.xml new file mode 100644 index 000000000..57dc7f860 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/archiva.xml @@ -0,0 +1,30 @@ + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/_7.cfs b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/_7.cfs new file mode 100644 index 000000000..e95ea7eb8 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/_7.cfs differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/deletable b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/deletable new file mode 100644 index 000000000..593f4708d Binary files /dev/null and b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/deletable differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/segments b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/segments new file mode 100644 index 000000000..d9d4f014f Binary files /dev/null and b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/segments differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/local-repo/settings.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/local-repo/settings.xml new file mode 100644 index 000000000..23b66a9db --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/local-repo/settings.xml @@ -0,0 +1,44 @@ + + + + + snapshots + admin + admin1 + + + + + repositories + + + snapshots + snapshots-repository + http://localhost:9696/archiva/repository/snapshots/ + + false + + + true + + + + + + snapshots + snapshots-repository + http://localhost:9696/archiva/repository/snapshot/ + + false + + + true + + + + + + + repositories + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/log4j.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/log4j.xml new file mode 100644 index 000000000..4957e2d89 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/log4j.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/log4j2-test.xml new file mode 100644 index 000000000..9294964db --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/log4j2-test.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/logging/log4j.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/logging/log4j.xml new file mode 100644 index 000000000..8ddcde5e9 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/logging/log4j.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/logging/log4j2-test.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/logging/log4j2-test.xml new file mode 100644 index 000000000..e9a65a586 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/logging/log4j2-test.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/bad-dependency.log b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/bad-dependency.log new file mode 100644 index 000000000..e69de29bb diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/bad-dependency2.log b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/bad-dependency2.log new file mode 100644 index 000000000..e69de29bb diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/pom.xml new file mode 100644 index 000000000..24fc2aa46 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/pom.xml @@ -0,0 +1,41 @@ + + + + + 4.0.0 + org.apache.archiva + bad-dependency + 1.0 + jar + Bad Dependency + + + org.apache.archiva.web.test + bad-dependency + 1.0 + + + org.apache.archiva.web.test + foo-bar + 1.2-SNAPSHOT + + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/dependency-in-proxied.log b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/dependency-in-proxied.log new file mode 100644 index 000000000..e69de29bb diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/pom.xml new file mode 100644 index 000000000..82606837b --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/pom.xml @@ -0,0 +1,41 @@ + + + + + 4.0.0 + org.apache.archiva + dependency-in-proxied + 1.0 + jar + Dependency In Proxied + + + + com.lowagie + itext + 1.3 + + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/.datarefresh b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/.datarefresh new file mode 100644 index 000000000..c53a40aad --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/.datarefresh @@ -0,0 +1,7 @@ +#Last Scan Information, managed by Archiva. DO NOT EDIT +#Thu Apr 19 17:04:36 PHT 2007 +scan.included.files=12 +scan.skipped.files=0 +scan.finished.timestamp=1176973476967 +scan.consumed.files=20 +scan.started.timestamp=1176973467414 diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.md5 new file mode 100644 index 000000000..158138e09 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.md5 @@ -0,0 +1 @@ +0360f14347d5502114ba7afe4ea2e07f \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.sha1 new file mode 100644 index 000000000..c9524a069 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.sha1 @@ -0,0 +1 @@ +4a667b9923fb936409b96c8242bebc2f96f374f5 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom new file mode 100644 index 000000000..9d419ea6d --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom @@ -0,0 +1,25 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + artifact-a + jar + 1.0 + artifact-a + http://maven.apache.org + + + org.apache.maven.archiva.web.test + artifact-b + 2.0 + + + + + + org.apache.maven.wagon + wagon-webdav + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.md5 new file mode 100644 index 000000000..93cdd6f43 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.md5 @@ -0,0 +1 @@ +cdf69ffbcb888aacea6cfeaf479fefd1 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.sha1 new file mode 100644 index 000000000..293b6c1f4 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.sha1 @@ -0,0 +1 @@ +f6a384b1ab62ed45ae7dee1a059815e94bbc7fa6 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml new file mode 100644 index 000000000..113676922 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + artifact-a + 1.0 + + + 1.0 + + 20070417090928 + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.md5 new file mode 100644 index 000000000..a02aa88a4 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.md5 @@ -0,0 +1 @@ +bc87573a595a2c387b5baa4ad7d06743 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.sha1 new file mode 100644 index 000000000..11bee708c --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +e9ecaaa14a3c09b07206980c15749a631dbc986a \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.md5 new file mode 100644 index 000000000..3bb4fd4e6 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.md5 @@ -0,0 +1 @@ +16a308257949f23afa5d1f1dec41aa44 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.sha1 new file mode 100644 index 000000000..e5d0934b1 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.sha1 @@ -0,0 +1 @@ +36a3a9cc35b8ca0d73998d7b39d290b489800a22 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom new file mode 100644 index 000000000..218543673 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom @@ -0,0 +1,25 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + artifact-b + jar + 2.0 + artifact-b + http://maven.apache.org + + + org.apache.maven.archiva.web.test + artifact-c + 3.0 + + + + + + org.apache.maven.wagon + wagon-webdav + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.md5 new file mode 100644 index 000000000..5fabe5807 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.md5 @@ -0,0 +1 @@ +be5b8f8539a62b5935793ebeb87215fd \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.sha1 new file mode 100644 index 000000000..6eb9715a0 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.sha1 @@ -0,0 +1 @@ +012a658d4a4f70aa3e8dd4b2db67020817b7dfcc \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml new file mode 100644 index 000000000..60b171df5 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + artifact-b + 2.0 + + + 2.0 + + 20070417090908 + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.md5 new file mode 100644 index 000000000..80c703319 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.md5 @@ -0,0 +1 @@ +bedfccc27fc7dc262d5c99a7aa8b83d8 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.sha1 new file mode 100644 index 000000000..42390adcc --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +4902ea6b16838ff26f9136460c4394b0ad7cc7f5 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.md5 new file mode 100644 index 000000000..edc258a75 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.md5 @@ -0,0 +1 @@ +853a10a201f8a296e37e856615c5349c \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.sha1 new file mode 100644 index 000000000..aafda15fa --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.sha1 @@ -0,0 +1 @@ +5155da8820ed77c43e983c1244d94a3b27bf08f7 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom new file mode 100644 index 000000000..8299fbf11 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom @@ -0,0 +1,26 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + artifact-c + jar + 3.0 + artifact-c + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.wagon + wagon-webdav + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.md5 new file mode 100644 index 000000000..d225acc75 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.md5 @@ -0,0 +1 @@ +4df0417579b1492f37da14316adb85af \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.sha1 new file mode 100644 index 000000000..1f2435ee6 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.sha1 @@ -0,0 +1 @@ +c3b007acd9c17b80753b39a4121255965e7e2e65 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml new file mode 100644 index 000000000..1d7394c7a --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + artifact-c + 3.0 + + + 3.0 + + 20070417090835 + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.md5 new file mode 100644 index 000000000..8c0378271 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.md5 @@ -0,0 +1 @@ +74d58d97e78d5e51cc02c489c5edba0d \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.sha1 new file mode 100644 index 000000000..535860369 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +5c7571eb35248be0f65758783b036e8f7899c146 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.md5 new file mode 100644 index 000000000..9d902f06e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.md5 @@ -0,0 +1 @@ +55f498a518e1151ce2e54daa674691de \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.sha1 new file mode 100644 index 000000000..b351a034e --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.sha1 @@ -0,0 +1 @@ +730551bde461564d3f8a7e0178ef9bc54a86d2dd \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom new file mode 100644 index 000000000..478f8fd50 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom @@ -0,0 +1,25 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + artifact-s + jar + 0.1 + artifact-s + http://maven.apache.org + + + org.apache.maven.archiva.web.test + artifact-a + 1.0 + + + + + + org.apache.maven.wagon + wagon-webdav + + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.md5 new file mode 100644 index 000000000..b49dc167a --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.md5 @@ -0,0 +1 @@ +746ba2848229dbc1c9683ece0e7f02c8 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.sha1 new file mode 100644 index 000000000..ae029df5c --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.sha1 @@ -0,0 +1 @@ +0d068f63069a86d982075a1dca7fe74fd95a29df \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml new file mode 100644 index 000000000..ddcad75d9 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + artifact-s + 0.1 + + + 0.1 + + 20070417090721 + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.md5 new file mode 100644 index 000000000..f6bd69743 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.md5 @@ -0,0 +1 @@ +baa0ad0afaba9cee66ec262b38f796b6 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.sha1 new file mode 100644 index 000000000..c341e6296 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +dea84d579f673d2d87c7bd47e4318cdf8e59e4d0 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/.datarefresh b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/.datarefresh new file mode 100644 index 000000000..c53a40aad --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/.datarefresh @@ -0,0 +1,7 @@ +#Last Scan Information, managed by Archiva. DO NOT EDIT +#Thu Apr 19 17:04:36 PHT 2007 +scan.included.files=12 +scan.skipped.files=0 +scan.finished.timestamp=1176973476967 +scan.consumed.files=20 +scan.started.timestamp=1176973467414 diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar new file mode 100644 index 000000000..033956d43 Binary files /dev/null and b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar differ diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.md5 new file mode 100644 index 000000000..0a3eeb690 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.md5 @@ -0,0 +1 @@ +306d556e6e5e4d604dc854d09ddcdefd \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.sha1 new file mode 100644 index 000000000..39c5c3061 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.sha1 @@ -0,0 +1 @@ +afb6586f5eb4c63dd5735a0bed11c99c7fac6755 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..d580176ff --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom @@ -0,0 +1,9 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + foo-bar + 1.0-SNAPSHOT + + deployed + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.md5 new file mode 100644 index 000000000..6caf8be40 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.md5 @@ -0,0 +1 @@ +8e896baea663a45d7bd2737f8e464481 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.sha1 new file mode 100644 index 000000000..a3bbc7ea1 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.sha1 @@ -0,0 +1 @@ +e37897c617d78dedd978766a2db318d301e80105 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..ab1eb426d --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + foo-bar + 1.0-SNAPSHOT + + + 1 + + 20070425105840 + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.md5 new file mode 100644 index 000000000..76ef1e4b3 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.md5 @@ -0,0 +1 @@ +add4f71a005137e9a296c5b192e900c2 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.sha1 new file mode 100644 index 000000000..ebe7cf339 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +b505e302169e04fc821bf571da7435b1e42ef8d7 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml new file mode 100644 index 000000000..8f00ecefa --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + foo-bar + 1.0-SNAPSHOT + + + 1.0-SNAPSHOT + + 20070425105840 + + \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.md5 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.md5 new file mode 100644 index 000000000..f6270d9c8 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.md5 @@ -0,0 +1 @@ +f3b657fb48d2e82fee5fada169756938 \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.sha1 b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.sha1 new file mode 100644 index 000000000..7f4812f9f --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +f4629e609deb95cefdcdddc6dd8c2942d1c3e47f \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/test.properties b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/test.properties new file mode 100644 index 000000000..1913b032f --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/test.properties @@ -0,0 +1,143 @@ +# +# 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 +# +# 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. +# + +# properties for integration tests + +ADMIN_USERNAME=admin +ADMIN_FULLNAME=Administrator +ADMIN_EMAIL=admin@localhost.fr +ADMIN_PASSWORD=admin1 + +SELENIUM_HOST=localhost +SELENIUM_PORT=4444 +SELENIUM_BROWSER=*firefox + +# Search, Artifact Management +SEARCH_BAD_ARTIFACT=asdf +# Existing Artifact +ARTIFACT_GROUPID=test +ARTIFACT_ARTIFACTID=test +ARTIFACT_VERSION=1.0 +ARTIFACT_PACKAGING=jar +ARTIFACT_CLASSNAME=test.App + +# Artifact for testing add artifact with valid values +VALIDARTIFACT_GROUPID=addArtifactValidValues +VALIDARTIFACT_ARTIFACTID=addArtifactValidValues-artifact + +# Artifact for upload action in audit log report - MRM-1304 +AUDITLOGARTIFACT_GROUPID=group.auditLogUpload +AUDITLOGARTIFACT_ARTIFACTID=auditLogUpload-artifact +AUDITLOG_EXPECTED_ARTIFACT=group/auditLogUpload/auditLogUpload-artifact/1.0/auditLogUpload-artifact-1.0.jar + +# Reports +REPOSITORY_NAME=internal +START_DATE=05/01/2009 +END_DATE=05/30/2009 + +# User Management +# For password and new password +USERROLE_EMAIL=admin@localhost.fr +USERROLE_PASSWORD=password1 +NEW_USERROLE_PASSWORD=password123 + +# Guest Role +GUEST_USERNAME=guest_user +GUEST_FULLNAME=The Test Guest +# Registered User Role +REGISTERED_USERNAME=reg_user +REGISTERED_FULLNAME=Registered User +# System Administrator +SYSAD_USERNAME=sys_admin +SYSAD_FULLNAME=System Administrator +# User Administrator +USERADMIN_USERNAME=user_admin +USERADMIN_FULLNAME=User Administrator +# Global Repository Manager +GLOBALREPOMANAGER_USERNAME=globalrepo_manager +GLOBALREPOMANAGER_FULLNAME=Global Repository Manager +# Global Repository Observer +GLOBALREPOOBSERVER_USERNAME=globalrepo_observer +GLOBALREPOOBSERVER_FULLNAME=Global Repository Observer +# Repository Manager - internal +REPOMANAGER_INTERNAL_USERNAME=repomanager_internal +REPOMANAGER_INTERNAL_FULLNAME=Repository Manager - internal +# Repository Manager - snapshots +REPOMANAGER_SNAPSHOTS_USERNAME=repomanager_snapshots +REPOMANAGER_SNAPSHOTS_FULLNAME=Repository Manager - snapshots +# Repository Observer - internal +REPOOBSERVER_INTERNAL_USERNAME=repoobserver_internal +REPOOBSERVER_INTERNAL_FULLNAME=Repository Observer - internal +# Repository Observer - snapshots +REPOOBSERVER_SNAPSHOTS_USERNAME=repoobserver_snapshots +REPOOBSERVER_SNAPSHOTS_FULLNAME=Repository Observer - snapshots + +# Add Artifact +GROUPID=test +ARTIFACTID=test +VERSION=1.0 +PACKAGING=jar +ARTIFACTFILEPATH=test +REPOSITORYID=internal + +GROUPID1=delete +ARTIFACTID1=delete +VERSION1=1.0 +PACKAGING1=jar +ARTIFACTFILEPATH1=test +REPOSITORYID1=internal + +GROUPID_DOTNETARTIFACT=dotNetTypes +ARTIFACTID_DOTNETARTIFACT=dotNetTypes +PACKAGING_DOTNETARTIFACT=library + +SNAPSHOT_GROUPID=org.apache.archiva +SNAPSHOT_ARTIFACTID=archiva-test +SNAPSHOT_VERSION=1.0-SNAPSHOT +SNAPSHOT_PACKAGING=jar +SNAPSHOT_ARTIFACTFILEPATH=src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar +SNAPSHOT_REPOSITORYID=snapshots + +ADD_REMOVE_GROUPID=artifact.dummy +ADD_REMOVE_ARTIFACTID=artifact-dummy + +# REPOSITORIES +# Manage Repositories +MANAGED_IDENTIFIER=testing1 +MANAGED_NAME=Testing Managed Repository +MANAGED_DIRECTORY= +MANAGED_INDEX_DIRECTORY= +MANAGED_TYPE= +MANAGED_CRON= +MANAGED_REPOPURGE_DAYSOLDERTHAN= +MANAGED_REPOPURGE_RETENTIONCOUNT= + +# Network Proxies +NETWORKPROXY_IDENTIFIER=networkproxytest +NETWORKPROXY_PROTOCOL=http +NETWORKPROXY_HOSTNAME= +NETWORKPROXY_PORT=8080 +NETWORKPROXY_USERNAME=admin +NETWORKPROXY_PASSWORD=admin123 + +# Browse - MRM-1278 test +SNAPSHOTS_REPOSITORY=snapshots +RELEASES_REPOSITORY=releases + +