+++ /dev/null
-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
-
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-web</artifactId>
- <version>1.4-M4-SNAPSHOT</version>
- </parent>
- <artifactId>archiva-webapp-test-js</artifactId>
- <packaging>pom</packaging>
- <name>Archiva Web :: Javascript Application Tests</name>
-
- <properties>
- <webappDirectory>${project.build.directory}/tomcat7x/webapps/archiva</webappDirectory>
- <container.test.port>0</container.test.port>
- <tomcat.propertiesPortFilePath>${project.build.directory}/tomcat-port.properties</tomcat.propertiesPortFilePath>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.archiva</groupId>
- <artifactId>archiva-webapp</artifactId>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-slf4j-logging</artifactId>
- <exclusions>
- <exclusion>
- <artifactId>plexus-component-api</artifactId>
- <groupId>org.codehaus.plexus</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-java</artifactId>
- <version>${selenium-server.version}</version>
- </dependency>
- <dependency>
- <groupId>org.seleniumhq.selenium.client-drivers</groupId>
- <artifactId>selenium-java-client-driver</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.fluentlenium</groupId>
- <artifactId>fluentlenium-festassert</artifactId>
- <version>0.7.4</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.fluentlenium</groupId>
- <artifactId>fluentlenium-core</artifactId>
- <version>0.7.4</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Dependency for MavenConnectionTest -->
- <dependency>
- <groupId>jdom</groupId>
- <artifactId>jdom</artifactId>
- </dependency>
- <dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- </dependency>
-
- <!-- Dependencies below are provided by the appserver -->
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.easytesting</groupId>
- <artifactId>fest-assert-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.logging.log4j.adapters</groupId>
- <artifactId>log4j-jcl</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.logging.log4j.adapters</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.logging.log4j.adapters</groupId>
- <artifactId>log4j12-api</artifactId>
- </dependency>
-
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </testResource>
- </testResources>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-server</artifactId>
- <version>${selenium-server.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-remote-driver</artifactId>
- <version>${selenium-server.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-api</artifactId>
- <version>${selenium-server.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>src/test/resources/appserver-base/**</exclude>
- <exclude>src/test/resources/repository/**</exclude>
- <exclude>src/test/resources/local-repo/**</exclude>
- <exclude>src/test/resources/projects/**</exclude>
- <exclude>src/test/resources/snapshots/**</exclude>
- <exclude>src/test/tomcat*/conf/catalina.policy</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>testResources</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>testCompile</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <redirectTestOutputToFile>false</redirectTestOutputToFile>
- <runOrder>alphabetical</runOrder>
- </configuration>
- <executions>
- <execution>
- <id>integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <browser>${selenium.browser}</browser>
- <selenium.browser>${selenium.browser}</selenium.browser>
- <baseUrl>${baseUrl}</baseUrl>
- <maxWaitTimeInMs>${maxWaitTimeInMs}</maxWaitTimeInMs>
- <seleniumHost>${seleniumHost}</seleniumHost>
- <seleniumPort>${seleniumPort}</seleniumPort>
- <tomcat.propertiesPortFilePath>${tomcat.propertiesPortFilePath}</tomcat.propertiesPortFilePath>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>create-container</id>
- <activation>
- <property>
- <name>!container</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unzip-archiva-webapp</id>
- <phase>compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>archiva-webapp</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${webappDirectory}</outputDirectory>
- <overWriteSnapshots>true</overWriteSnapshots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <phase>process-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <copy overwrite="true" todir="${webappDirectory}/WEB-INF/classes">
- <fileset dir="src/test/resources/logging"/>
- </copy>
- <copy todir="${project.build.directory}/appserver-base">
- <fileset dir="src/test/resources/appserver-base"/>
- </copy>
- <copy todir="${project.build.directory}/repository">
- <fileset dir="src/test/resources/repository"/>
- </copy>
- <copy todir="${project.build.directory}/index">
- <fileset dir="src/test/resources/index"/>
- </copy>
- <copy todir="${project.build.directory}/snapshots">
- <fileset dir="src/test/resources/snapshots"/>
- </copy>
- <copy todir="${project.build.directory}/projects">
- <fileset dir="src/test/resources/projects"/>
- </copy>
- <copy todir="${project.build.directory}/local-repo">
- <fileset dir="src/test/resources/local-repo"/>
- </copy>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.tomcat.maven</groupId>
- <artifactId>tomcat7-maven-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>${derbyVersion}</version>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>${javaxMailVersion}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>tomcat-run</id>
- <goals>
- <goal>run-war-only</goal>
- </goals>
- <phase>pre-integration-test</phase>
- <configuration>
- <path>/archiva</path>
- <port>${container.test.port}</port>
- <uriEncoding>UTF-8</uriEncoding>
- <warDirectory>${webappDirectory}</warDirectory>
- <fork>true</fork>
- <ignorePackaging>true</ignorePackaging>
- <systemProperties>
- <appserver.base>${project.build.directory}/appserver-base</appserver.base>
- <appserver.home>${project.build.directory}/appserver-base</appserver.home>
- <derby.system.home>${project.build.directory}</derby.system.home>
- <archiva.devMode>true</archiva.devMode>
- </systemProperties>
- <contextFile>${project.build.testOutputDirectory}/archiva.xml</contextFile>
- <propertiesPortFilePath>${tomcat.propertiesPortFilePath}</propertiesPortFilePath>
- <useNaming>true</useNaming>
- </configuration>
- </execution>
- <execution>
- <id>tomcat-shutdown</id>
- <goals>
- <goal>shutdown</goal>
- </goals>
- <phase>post-integration-test</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>existing-container</id>
- <activation>
- <property>
- <name>!baseUrl</name>
- </property>
- </activation>
- <properties>
- <baseUrl>http://localhost:${container.test.port}/archiva/index.html?request_lang=en</baseUrl>
- </properties>
- </profile>
- <profile>
- <id>start-selenium</id>
- <activation>
- <property>
- <name>!seleniumHost</name>
- </property>
- </activation>
- <properties>
- <seleniumHost>localhost</seleniumHost>
- <seleniumPort>4444</seleniumPort>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start-server</goal>
- </goals>
- <configuration>
- <background>true</background>
- <port>${seleniumPort}</port>
- <logOutput>true</logOutput>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>firefox</id>
- <activation>
- <property>
- <name>!browser</name>
- </property>
- </activation>
- <properties>
- <selenium.browser>*firefox</selenium.browser>
- <excluded.groups/>
- </properties>
- </profile>
- <profile>
- <id>chrome</id>
- <activation>
- <property>
- <name>browser</name>
- <value>chrome</value>
- </property>
- </activation>
- <properties>
- <selenium.browser>*googlechrome</selenium.browser>
- <excluded.groups>requiresUpload</excluded.groups>
- </properties>
- </profile>
- <profile>
- <id>iexplore</id>
- <activation>
- <property>
- <name>browser</name>
- <value>iexplore</value>
- </property>
- </activation>
- <properties>
- <selenium.browser>*iexplore</selenium.browser>
- <excluded.groups>requiresUpload</excluded.groups>
- </properties>
- </profile>
- <profile>
- <id>safari</id>
- <activation>
- <property>
- <name>browser</name>
- <value>safari</value>
- </property>
- </activation>
- <properties>
- <selenium.browser>*safari</selenium.browser>
- <excluded.groups>requiresUpload</excluded.groups>
- </properties>
- </profile>
- <profile>
- <id>otherbrowser</id>
- <activation>
- <property>
- <name>browser</name>
- <value>other</value>
- </property>
- </activation>
- <properties>
- <selenium.browser>*custom ${browserPath}</selenium.browser>
- <excluded.groups>requiresUpload</excluded.groups>
- </properties>
- </profile>
- <profile>
- <id>headless</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>xvfb</id>
- <phase>validate</phase>
- <goals>
- <goal>xvfb</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>ci-server</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>cleanup-files</id>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <delete file="${user.home}/.m2/archiva.xml" quiet="true"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
+++ /dev/null
-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
+++ /dev/null
-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
+++ /dev/null
-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" ) ) );
- }
-}
+++ /dev/null
-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() );
- }
-}
+++ /dev/null
-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<FluentWebElement> 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();
-
- }
-}
+++ /dev/null
-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/<element> )
- 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
+++ /dev/null
-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
+++ /dev/null
-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 <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
- *
- */
-
-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<String> expected = Arrays.asList( options );
- List<String> 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<String, String> fieldMap )
- {
- Map.Entry<String, String> entry;
-
- for ( Iterator<Entry<String, String>> 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
+++ /dev/null
-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;
- }
-}
+++ /dev/null
-<configuration>
- <localRepository></localRepository>
- <webapp>
- <ui>
- <appletFindEnabled>false</appletFindEnabled>
- </ui>
- </webapp>
-</configuration>
+++ /dev/null
-<!--
- ~ 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.
- -->
-
-<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN"
- "http://jackrabbit.apache.org/dtd/repository-1.6.dtd">
-
-<Repository>
- <FileSystem class="org.apache.jackrabbit.core.fs.mem.MemoryFileSystem"/>
- <!--<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
- <param name="path" value="${rep.home}/repository"/>
-</FileSystem> -->
- <Security appName="Jackrabbit">
- <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="security"/>
- <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager"/>
- <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule"/>
- </Security>
- <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
- <Workspace name="${wsp.name}">
- <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
- <param name="path" value="${wsp.home}"/>
- </FileSystem>
- <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"/>
- <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
- <param name="path" value="${wsp.home}/index"/>
- </SearchIndex>
- </Workspace>
- <Versioning rootPath="${rep.home}/version">
- <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
- <param name="path" value="${rep.home}/version"/>
- </FileSystem>
- <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"/>
- </Versioning>
-</Repository>
+++ /dev/null
-<configuration />
+++ /dev/null
-ea7dea9244b2a0975cfa117dc34fe18e
\ No newline at end of file
+++ /dev/null
-1039566ff5361d07eccd1243c45929b96441c7d6
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>test</groupId>
- <artifactId>test</artifactId>
- <packaging>jar</packaging>
- <version>1.0</version>
- <name>test</name>
- <url>http://maven.apache.org</url>
-
- <licenses>
- <license>
- <name>Test License</name>
- <url>http://www.test.org/test.html</url>
- </license>
- </licenses>
-
- <mailingLists>
- <mailingList>
- <name>test user list</name>
- <subscribe>http://test.net/lists/listinfo/test-user</subscribe>
- <unsubscribe>http://test.net/lists/listinfo/test-user</unsubscribe>
- <archive>http://www.test-archive.com/test-user%40lists.test.net/</archive>
- </mailingList>
- <mailingList>
- <name>test developer list</name>
- <subscribe>http://test.net/lists/listinfo/test-dev</subscribe>
- <unsubscribe>http://test.net/lists/listinfo/test-dev</unsubscribe>
- <archive>http://www.test-archive.com/test-dev%40lists.test.net/</archive>
- </mailingList>
- </mailingLists>
-
- <dependencies>
- <dependency>
- <groupId>test.group.id</groupId>
- <artifactId>testArtifactId</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-<distributionManagement>
-<repository>
- <id>test</id>
-<url>file://localhost/Users/brett/scm/archiva/archiva/archiva-modules/archiva-web/archiva-webapp-test/src/test/it-resources/appserver-base/data/repositories/internal</url>
-</repository>
-</distributionManagement>
-</project>
-
+++ /dev/null
-f80c7c493716de649a99db00cd2ff34c
\ No newline at end of file
+++ /dev/null
-4b95c6fa09d1e02efdb69129f53f025e33bc8958
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>test</groupId>
- <artifactId>test</artifactId>
- <version>1.0</version>
- <versioning>
- <versions>
- <version>1.0</version>
- </versions>
- <lastUpdated>20100114015837</lastUpdated>
- </versioning>
-</metadata>
+++ /dev/null
-dab1b8c2475fe839f387ceaef0d82b30
\ No newline at end of file
+++ /dev/null
-4e5b414d5419121ef75131cb52235a9abbf2095a
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<Context path="/archiva"
- docBase="${webappDirectory}">
-
- <Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource"
- username="sa"
- password=""
- driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
- url="jdbc:derby:${project.build.directory}/database/users;create=true"
- />
-</Context>
+++ /dev/null
-<settings>
- <localRepository></localRepository>
- <servers>
- <server>
- <id>snapshots</id>
- <username>admin</username>
- <password>admin1</password>
- </server>
- </servers>
- <profiles>
- <profile>
- <id>repositories</id>
- <repositories>
- <repository>
- <id>snapshots</id>
- <name>snapshots-repository</name>
- <url>http://localhost:9696/archiva/repository/snapshots/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>snapshots</id>
- <name>snapshots-repository</name>
- <url>http://localhost:9696/archiva/repository/snapshot/</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
- </profile>
- </profiles>
- <activeProfiles>
- <activeProfile>repositories</activeProfile>
- </activeProfiles>
-</settings>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
- <appender name="console" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/>
- </layout>
- </appender>
-
-
- <logger name="org.springframework">
- <level value="ERROR"/>
- </logger>
-
- <root>
- <priority value ="info" />
- <appender-ref ref="console" />
- </root>
-
-</log4j:configuration>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-
-
-<configuration status="debug">
- <appenders>
- <Console name="console" target="SYSTEM_OUT">
- <PatternLayout pattern="%d [%t] %-5p %c %x - %m%n"/>
- </Console>
- </appenders>
- <loggers>
-
- <logger name="org.springframework" level="error"/>
-
- <root level="info">
- <appender-ref ref="console"/>
- </root>
- </loggers>
-</configuration>
-
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
- <appender name="console" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/>
- </layout>
- </appender>
-
- <logger name="JPOX">
- <level value="error"/>
- </logger>
-
- <logger name="org.apache.commons.configuration.DefaultConfigurationBuilder">
- <level value="error"/>
- </logger>
-
-
- <logger name="org.springframework">
- <level value="ERROR"/>
- </logger>
-
- <logger name="org.codehaus.plexus">
- <level value="ERROR"/>
- </logger>
-
- <logger name="org.codehaus.redback">
- <level value="ERROR"/>
- </logger>
-
- <logger name="org.apache.cxf">
- <level value="ERROR"/>
- </logger>
-
- <logger name="org.quartz">
- <level value="ERROR"/>
- </logger>
-
- <logger name="org.apache.archiva">
- <level value="INFO"/>
- </logger>
-
-
- <root>
- <priority value="ERROR" />
- <appender-ref ref="console" />
- </root>
-
-</log4j:configuration>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-
-
-<configuration status="debug">
- <appenders>
- <Console name="console" target="SYSTEM_OUT">
- <PatternLayout pattern="%d [%t] %-5p %c %x - %m%n"/>
- </Console>
- </appenders>
- <loggers>
-
- <logger name="JPOX" level="error"/>
-
-
- <logger name="org.apache.commons.configuration.DefaultConfigurationBuilder" level="error"/>
-
-
- <logger name="org.springframework" level="error"/>
-
- <logger name="org.codehaus.plexus" level="error"/>
-
- <logger name="org.apache.archiva.redback" level="error"/>
-
- <logger name="org.apache.cxf" level="error"/>
-
- <logger name="org.quartz" level="error"/>
-
- <logger name="org.apache.archiva" level="info"/>
-
- <root level="info">
- <appender-ref ref="console"/>
- </root>
- </loggers>
-</configuration>
-
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.archiva</groupId>
- <artifactId>bad-dependency</artifactId>
- <version>1.0</version>
- <packaging>jar</packaging>
- <name>Bad Dependency</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.archiva.web.test</groupId>
- <artifactId>bad-dependency</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.archiva.web.test</groupId>
- <artifactId>foo-bar</artifactId>
- <version>1.2-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.archiva</groupId>
- <artifactId>dependency-in-proxied</artifactId>
- <version>1.0</version>
- <packaging>jar</packaging>
- <name>Dependency In Proxied</name>
- <dependencies>
- <!--dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-jxr</artifactId>
- <version>2.1</version>
- </dependency-->
- <dependency>
- <groupId>com.lowagie</groupId>
- <artifactId>itext</artifactId>
- <version>1.3</version>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-#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
+++ /dev/null
-0360f14347d5502114ba7afe4ea2e07f
\ No newline at end of file
+++ /dev/null
-4a667b9923fb936409b96c8242bebc2f96f374f5
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-a</artifactId>
- <packaging>jar</packaging>
- <version>1.0</version>
- <name>artifact-a</name>
- <url>http://maven.apache.org</url>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-b</artifactId>
- <version>2.0</version>
- </dependency>
- </dependencies>
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav</artifactId>
- </extension>
- </extensions>
- </build>
-</project>
+++ /dev/null
-cdf69ffbcb888aacea6cfeaf479fefd1
\ No newline at end of file
+++ /dev/null
-f6a384b1ab62ed45ae7dee1a059815e94bbc7fa6
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?><metadata>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-a</artifactId>
- <version>1.0</version>
- <versioning>
- <versions>
- <version>1.0</version>
- </versions>
- <lastUpdated>20070417090928</lastUpdated>
- </versioning>
-</metadata>
\ No newline at end of file
+++ /dev/null
-bc87573a595a2c387b5baa4ad7d06743
\ No newline at end of file
+++ /dev/null
-e9ecaaa14a3c09b07206980c15749a631dbc986a
\ No newline at end of file
+++ /dev/null
-16a308257949f23afa5d1f1dec41aa44
\ No newline at end of file
+++ /dev/null
-36a3a9cc35b8ca0d73998d7b39d290b489800a22
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-b</artifactId>
- <packaging>jar</packaging>
- <version>2.0</version>
- <name>artifact-b</name>
- <url>http://maven.apache.org</url>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-c</artifactId>
- <version>3.0</version>
- </dependency>
- </dependencies>
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav</artifactId>
- </extension>
- </extensions>
- </build>
-</project>
+++ /dev/null
-be5b8f8539a62b5935793ebeb87215fd
\ No newline at end of file
+++ /dev/null
-012a658d4a4f70aa3e8dd4b2db67020817b7dfcc
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?><metadata>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-b</artifactId>
- <version>2.0</version>
- <versioning>
- <versions>
- <version>2.0</version>
- </versions>
- <lastUpdated>20070417090908</lastUpdated>
- </versioning>
-</metadata>
\ No newline at end of file
+++ /dev/null
-bedfccc27fc7dc262d5c99a7aa8b83d8
\ No newline at end of file
+++ /dev/null
-4902ea6b16838ff26f9136460c4394b0ad7cc7f5
\ No newline at end of file
+++ /dev/null
-853a10a201f8a296e37e856615c5349c
\ No newline at end of file
+++ /dev/null
-5155da8820ed77c43e983c1244d94a3b27bf08f7
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-c</artifactId>
- <packaging>jar</packaging>
- <version>3.0</version>
- <name>artifact-c</name>
- <url>http://maven.apache.org</url>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav</artifactId>
- </extension>
- </extensions>
- </build>
-</project>
+++ /dev/null
-4df0417579b1492f37da14316adb85af
\ No newline at end of file
+++ /dev/null
-c3b007acd9c17b80753b39a4121255965e7e2e65
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?><metadata>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-c</artifactId>
- <version>3.0</version>
- <versioning>
- <versions>
- <version>3.0</version>
- </versions>
- <lastUpdated>20070417090835</lastUpdated>
- </versioning>
-</metadata>
\ No newline at end of file
+++ /dev/null
-74d58d97e78d5e51cc02c489c5edba0d
\ No newline at end of file
+++ /dev/null
-5c7571eb35248be0f65758783b036e8f7899c146
\ No newline at end of file
+++ /dev/null
-55f498a518e1151ce2e54daa674691de
\ No newline at end of file
+++ /dev/null
-730551bde461564d3f8a7e0178ef9bc54a86d2dd
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-s</artifactId>
- <packaging>jar</packaging>
- <version>0.1</version>
- <name>artifact-s</name>
- <url>http://maven.apache.org</url>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-a</artifactId>
- <version>1.0</version>
- </dependency>
- </dependencies>
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav</artifactId>
- </extension>
- </extensions>
- </build>
-</project>
+++ /dev/null
-746ba2848229dbc1c9683ece0e7f02c8
\ No newline at end of file
+++ /dev/null
-0d068f63069a86d982075a1dca7fe74fd95a29df
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?><metadata>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>artifact-s</artifactId>
- <version>0.1</version>
- <versioning>
- <versions>
- <version>0.1</version>
- </versions>
- <lastUpdated>20070417090721</lastUpdated>
- </versioning>
-</metadata>
\ No newline at end of file
+++ /dev/null
-baa0ad0afaba9cee66ec262b38f796b6
\ No newline at end of file
+++ /dev/null
-dea84d579f673d2d87c7bd47e4318cdf8e59e4d0
\ No newline at end of file
+++ /dev/null
-#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
+++ /dev/null
-306d556e6e5e4d604dc854d09ddcdefd
\ No newline at end of file
+++ /dev/null
-afb6586f5eb4c63dd5735a0bed11c99c7fac6755
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?><project>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>foo-bar</artifactId>
- <version>1.0-SNAPSHOT</version>
- <distributionManagement>
- <status>deployed</status>
- </distributionManagement>
-</project>
\ No newline at end of file
+++ /dev/null
-8e896baea663a45d7bd2737f8e464481
\ No newline at end of file
+++ /dev/null
-e37897c617d78dedd978766a2db318d301e80105
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?><metadata>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>foo-bar</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20070425105840</lastUpdated>
- </versioning>
-</metadata>
\ No newline at end of file
+++ /dev/null
-add4f71a005137e9a296c5b192e900c2
\ No newline at end of file
+++ /dev/null
-b505e302169e04fc821bf571da7435b1e42ef8d7
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?><metadata>
- <groupId>org.apache.maven.archiva.web.test</groupId>
- <artifactId>foo-bar</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20070425105840</lastUpdated>
- </versioning>
-</metadata>
\ No newline at end of file
+++ /dev/null
-f3b657fb48d2e82fee5fada169756938
\ No newline at end of file
+++ /dev/null
-f4629e609deb95cefdcdddc6dd8c2942d1c3e47f
\ No newline at end of file
+++ /dev/null
-#
-# 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
-
-
--- /dev/null
+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
+
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-web</artifactId>
+ <version>1.4-M4-SNAPSHOT</version>
+ </parent>
+ <artifactId>archiva-webapp-test-js</artifactId>
+ <packaging>pom</packaging>
+ <name>Archiva Web :: Javascript Application Tests</name>
+
+ <properties>
+ <webappDirectory>${project.build.directory}/tomcat7x/webapps/archiva</webappDirectory>
+ <container.test.port>0</container.test.port>
+ <tomcat.propertiesPortFilePath>${project.build.directory}/tomcat-port.properties</tomcat.propertiesPortFilePath>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-webapp</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-slf4j-logging</artifactId>
+ <exclusions>
+ <exclusion>
+ <artifactId>plexus-component-api</artifactId>
+ <groupId>org.codehaus.plexus</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-java</artifactId>
+ <version>${selenium-server.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.seleniumhq.selenium.client-drivers</groupId>
+ <artifactId>selenium-java-client-driver</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.fluentlenium</groupId>
+ <artifactId>fluentlenium-festassert</artifactId>
+ <version>0.7.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.fluentlenium</groupId>
+ <artifactId>fluentlenium-core</artifactId>
+ <version>0.7.4</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Dependency for MavenConnectionTest -->
+ <dependency>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ </dependency>
+
+ <!-- Dependencies below are provided by the appserver -->
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-assert-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j.adapters</groupId>
+ <artifactId>log4j-jcl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j.adapters</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j.adapters</groupId>
+ <artifactId>log4j12-api</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </testResource>
+ </testResources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-server</artifactId>
+ <version>${selenium-server.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-remote-driver</artifactId>
+ <version>${selenium-server.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.seleniumhq.selenium</groupId>
+ <artifactId>selenium-api</artifactId>
+ <version>${selenium-server.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>src/test/resources/appserver-base/**</exclude>
+ <exclude>src/test/resources/repository/**</exclude>
+ <exclude>src/test/resources/local-repo/**</exclude>
+ <exclude>src/test/resources/projects/**</exclude>
+ <exclude>src/test/resources/snapshots/**</exclude>
+ <exclude>src/test/tomcat*/conf/catalina.policy</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>testResources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <redirectTestOutputToFile>false</redirectTestOutputToFile>
+ <runOrder>alphabetical</runOrder>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemPropertyVariables>
+ <browser>${selenium.browser}</browser>
+ <selenium.browser>${selenium.browser}</selenium.browser>
+ <baseUrl>${baseUrl}</baseUrl>
+ <maxWaitTimeInMs>${maxWaitTimeInMs}</maxWaitTimeInMs>
+ <seleniumHost>${seleniumHost}</seleniumHost>
+ <seleniumPort>${seleniumPort}</seleniumPort>
+ <tomcat.propertiesPortFilePath>${tomcat.propertiesPortFilePath}</tomcat.propertiesPortFilePath>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>create-container</id>
+ <activation>
+ <property>
+ <name>!container</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unzip-archiva-webapp</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>archiva-webapp</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${webappDirectory}</outputDirectory>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <copy overwrite="true" todir="${webappDirectory}/WEB-INF/classes">
+ <fileset dir="src/test/resources/logging"/>
+ </copy>
+ <copy todir="${project.build.directory}/appserver-base">
+ <fileset dir="src/test/resources/appserver-base"/>
+ </copy>
+ <copy todir="${project.build.directory}/repository">
+ <fileset dir="src/test/resources/repository"/>
+ </copy>
+ <copy todir="${project.build.directory}/index">
+ <fileset dir="src/test/resources/index"/>
+ </copy>
+ <copy todir="${project.build.directory}/snapshots">
+ <fileset dir="src/test/resources/snapshots"/>
+ </copy>
+ <copy todir="${project.build.directory}/projects">
+ <fileset dir="src/test/resources/projects"/>
+ </copy>
+ <copy todir="${project.build.directory}/local-repo">
+ <fileset dir="src/test/resources/local-repo"/>
+ </copy>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tomcat.maven</groupId>
+ <artifactId>tomcat7-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derbyVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>${javaxMailVersion}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>tomcat-run</id>
+ <goals>
+ <goal>run-war-only</goal>
+ </goals>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <path>/archiva</path>
+ <port>${container.test.port}</port>
+ <uriEncoding>UTF-8</uriEncoding>
+ <warDirectory>${webappDirectory}</warDirectory>
+ <fork>true</fork>
+ <ignorePackaging>true</ignorePackaging>
+ <systemProperties>
+ <appserver.base>${project.build.directory}/appserver-base</appserver.base>
+ <appserver.home>${project.build.directory}/appserver-base</appserver.home>
+ <derby.system.home>${project.build.directory}</derby.system.home>
+ <archiva.devMode>true</archiva.devMode>
+ </systemProperties>
+ <contextFile>${project.build.testOutputDirectory}/archiva.xml</contextFile>
+ <propertiesPortFilePath>${tomcat.propertiesPortFilePath}</propertiesPortFilePath>
+ <useNaming>true</useNaming>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tomcat-shutdown</id>
+ <goals>
+ <goal>shutdown</goal>
+ </goals>
+ <phase>post-integration-test</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>existing-container</id>
+ <activation>
+ <property>
+ <name>!baseUrl</name>
+ </property>
+ </activation>
+ <properties>
+ <baseUrl>http://localhost:${container.test.port}/archiva/index.html?request_lang=en</baseUrl>
+ </properties>
+ </profile>
+ <profile>
+ <id>start-selenium</id>
+ <activation>
+ <property>
+ <name>!seleniumHost</name>
+ </property>
+ </activation>
+ <properties>
+ <seleniumHost>localhost</seleniumHost>
+ <seleniumPort>4444</seleniumPort>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start-server</goal>
+ </goals>
+ <configuration>
+ <background>true</background>
+ <port>${seleniumPort}</port>
+ <logOutput>true</logOutput>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>firefox</id>
+ <activation>
+ <property>
+ <name>!browser</name>
+ </property>
+ </activation>
+ <properties>
+ <selenium.browser>*firefox</selenium.browser>
+ <excluded.groups/>
+ </properties>
+ </profile>
+ <profile>
+ <id>chrome</id>
+ <activation>
+ <property>
+ <name>browser</name>
+ <value>chrome</value>
+ </property>
+ </activation>
+ <properties>
+ <selenium.browser>*googlechrome</selenium.browser>
+ <excluded.groups>requiresUpload</excluded.groups>
+ </properties>
+ </profile>
+ <profile>
+ <id>iexplore</id>
+ <activation>
+ <property>
+ <name>browser</name>
+ <value>iexplore</value>
+ </property>
+ </activation>
+ <properties>
+ <selenium.browser>*iexplore</selenium.browser>
+ <excluded.groups>requiresUpload</excluded.groups>
+ </properties>
+ </profile>
+ <profile>
+ <id>safari</id>
+ <activation>
+ <property>
+ <name>browser</name>
+ <value>safari</value>
+ </property>
+ </activation>
+ <properties>
+ <selenium.browser>*safari</selenium.browser>
+ <excluded.groups>requiresUpload</excluded.groups>
+ </properties>
+ </profile>
+ <profile>
+ <id>otherbrowser</id>
+ <activation>
+ <property>
+ <name>browser</name>
+ <value>other</value>
+ </property>
+ </activation>
+ <properties>
+ <selenium.browser>*custom ${browserPath}</selenium.browser>
+ <excluded.groups>requiresUpload</excluded.groups>
+ </properties>
+ </profile>
+ <profile>
+ <id>headless</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>xvfb</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>xvfb</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>ci-server</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>cleanup-files</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <delete file="${user.home}/.m2/archiva.xml" quiet="true"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
--- /dev/null
+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
--- /dev/null
+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
--- /dev/null
+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" ) ) );
+ }
+}
--- /dev/null
+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() );
+ }
+}
--- /dev/null
+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<FluentWebElement> 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();
+
+ }
+}
--- /dev/null
+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/<element> )
+ 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
--- /dev/null
+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
--- /dev/null
+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 <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ *
+ */
+
+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<String> expected = Arrays.asList( options );
+ List<String> 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<String, String> fieldMap )
+ {
+ Map.Entry<String, String> entry;
+
+ for ( Iterator<Entry<String, String>> 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
--- /dev/null
+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;
+ }
+}
--- /dev/null
+<configuration>
+ <localRepository></localRepository>
+ <webapp>
+ <ui>
+ <appletFindEnabled>false</appletFindEnabled>
+ </ui>
+ </webapp>
+</configuration>
--- /dev/null
+<!--
+ ~ 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.
+ -->
+
+<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN"
+ "http://jackrabbit.apache.org/dtd/repository-1.6.dtd">
+
+<Repository>
+ <FileSystem class="org.apache.jackrabbit.core.fs.mem.MemoryFileSystem"/>
+ <!--<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${rep.home}/repository"/>
+</FileSystem> -->
+ <Security appName="Jackrabbit">
+ <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="security"/>
+ <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager"/>
+ <LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule"/>
+ </Security>
+ <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
+ <Workspace name="${wsp.name}">
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${wsp.home}"/>
+ </FileSystem>
+ <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"/>
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="path" value="${wsp.home}/index"/>
+ </SearchIndex>
+ </Workspace>
+ <Versioning rootPath="${rep.home}/version">
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${rep.home}/version"/>
+ </FileSystem>
+ <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager"/>
+ </Versioning>
+</Repository>
--- /dev/null
+<configuration />
--- /dev/null
+ea7dea9244b2a0975cfa117dc34fe18e
\ No newline at end of file
--- /dev/null
+1039566ff5361d07eccd1243c45929b96441c7d6
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>test</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0</version>
+ <name>test</name>
+ <url>http://maven.apache.org</url>
+
+ <licenses>
+ <license>
+ <name>Test License</name>
+ <url>http://www.test.org/test.html</url>
+ </license>
+ </licenses>
+
+ <mailingLists>
+ <mailingList>
+ <name>test user list</name>
+ <subscribe>http://test.net/lists/listinfo/test-user</subscribe>
+ <unsubscribe>http://test.net/lists/listinfo/test-user</unsubscribe>
+ <archive>http://www.test-archive.com/test-user%40lists.test.net/</archive>
+ </mailingList>
+ <mailingList>
+ <name>test developer list</name>
+ <subscribe>http://test.net/lists/listinfo/test-dev</subscribe>
+ <unsubscribe>http://test.net/lists/listinfo/test-dev</unsubscribe>
+ <archive>http://www.test-archive.com/test-dev%40lists.test.net/</archive>
+ </mailingList>
+ </mailingLists>
+
+ <dependencies>
+ <dependency>
+ <groupId>test.group.id</groupId>
+ <artifactId>testArtifactId</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+<distributionManagement>
+<repository>
+ <id>test</id>
+<url>file://localhost/Users/brett/scm/archiva/archiva/archiva-modules/archiva-web/archiva-webapp-test/src/test/it-resources/appserver-base/data/repositories/internal</url>
+</repository>
+</distributionManagement>
+</project>
+
--- /dev/null
+f80c7c493716de649a99db00cd2ff34c
\ No newline at end of file
--- /dev/null
+4b95c6fa09d1e02efdb69129f53f025e33bc8958
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>test</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0</version>
+ <versioning>
+ <versions>
+ <version>1.0</version>
+ </versions>
+ <lastUpdated>20100114015837</lastUpdated>
+ </versioning>
+</metadata>
--- /dev/null
+dab1b8c2475fe839f387ceaef0d82b30
\ No newline at end of file
--- /dev/null
+4e5b414d5419121ef75131cb52235a9abbf2095a
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<Context path="/archiva"
+ docBase="${webappDirectory}">
+
+ <Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource"
+ username="sa"
+ password=""
+ driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
+ url="jdbc:derby:${project.build.directory}/database/users;create=true"
+ />
+</Context>
--- /dev/null
+<settings>
+ <localRepository></localRepository>
+ <servers>
+ <server>
+ <id>snapshots</id>
+ <username>admin</username>
+ <password>admin1</password>
+ </server>
+ </servers>
+ <profiles>
+ <profile>
+ <id>repositories</id>
+ <repositories>
+ <repository>
+ <id>snapshots</id>
+ <name>snapshots-repository</name>
+ <url>http://localhost:9696/archiva/repository/snapshots/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>snapshots</id>
+ <name>snapshots-repository</name>
+ <url>http://localhost:9696/archiva/repository/snapshot/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+ <activeProfiles>
+ <activeProfile>repositories</activeProfile>
+ </activeProfiles>
+</settings>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ 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.
+ -->
+
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/>
+ </layout>
+ </appender>
+
+
+ <logger name="org.springframework">
+ <level value="ERROR"/>
+ </logger>
+
+ <root>
+ <priority value ="info" />
+ <appender-ref ref="console" />
+ </root>
+
+</log4j:configuration>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ 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.
+ -->
+
+
+<configuration status="debug">
+ <appenders>
+ <Console name="console" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d [%t] %-5p %c %x - %m%n"/>
+ </Console>
+ </appenders>
+ <loggers>
+
+ <logger name="org.springframework" level="error"/>
+
+ <root level="info">
+ <appender-ref ref="console"/>
+ </root>
+ </loggers>
+</configuration>
+
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ 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.
+ -->
+
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/>
+ </layout>
+ </appender>
+
+ <logger name="JPOX">
+ <level value="error"/>
+ </logger>
+
+ <logger name="org.apache.commons.configuration.DefaultConfigurationBuilder">
+ <level value="error"/>
+ </logger>
+
+
+ <logger name="org.springframework">
+ <level value="ERROR"/>
+ </logger>
+
+ <logger name="org.codehaus.plexus">
+ <level value="ERROR"/>
+ </logger>
+
+ <logger name="org.codehaus.redback">
+ <level value="ERROR"/>
+ </logger>
+
+ <logger name="org.apache.cxf">
+ <level value="ERROR"/>
+ </logger>
+
+ <logger name="org.quartz">
+ <level value="ERROR"/>
+ </logger>
+
+ <logger name="org.apache.archiva">
+ <level value="INFO"/>
+ </logger>
+
+
+ <root>
+ <priority value="ERROR" />
+ <appender-ref ref="console" />
+ </root>
+
+</log4j:configuration>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ 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.
+ -->
+
+
+<configuration status="debug">
+ <appenders>
+ <Console name="console" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d [%t] %-5p %c %x - %m%n"/>
+ </Console>
+ </appenders>
+ <loggers>
+
+ <logger name="JPOX" level="error"/>
+
+
+ <logger name="org.apache.commons.configuration.DefaultConfigurationBuilder" level="error"/>
+
+
+ <logger name="org.springframework" level="error"/>
+
+ <logger name="org.codehaus.plexus" level="error"/>
+
+ <logger name="org.apache.archiva.redback" level="error"/>
+
+ <logger name="org.apache.cxf" level="error"/>
+
+ <logger name="org.quartz" level="error"/>
+
+ <logger name="org.apache.archiva" level="info"/>
+
+ <root level="info">
+ <appender-ref ref="console"/>
+ </root>
+ </loggers>
+</configuration>
+
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>bad-dependency</artifactId>
+ <version>1.0</version>
+ <packaging>jar</packaging>
+ <name>Bad Dependency</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.archiva.web.test</groupId>
+ <artifactId>bad-dependency</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.web.test</groupId>
+ <artifactId>foo-bar</artifactId>
+ <version>1.2-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>dependency-in-proxied</artifactId>
+ <version>1.0</version>
+ <packaging>jar</packaging>
+ <name>Dependency In Proxied</name>
+ <dependencies>
+ <!--dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-jxr</artifactId>
+ <version>2.1</version>
+ </dependency-->
+ <dependency>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext</artifactId>
+ <version>1.3</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+#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
--- /dev/null
+0360f14347d5502114ba7afe4ea2e07f
\ No newline at end of file
--- /dev/null
+4a667b9923fb936409b96c8242bebc2f96f374f5
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-a</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0</version>
+ <name>artifact-a</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-b</artifactId>
+ <version>2.0</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ </extension>
+ </extensions>
+ </build>
+</project>
--- /dev/null
+cdf69ffbcb888aacea6cfeaf479fefd1
\ No newline at end of file
--- /dev/null
+f6a384b1ab62ed45ae7dee1a059815e94bbc7fa6
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-a</artifactId>
+ <version>1.0</version>
+ <versioning>
+ <versions>
+ <version>1.0</version>
+ </versions>
+ <lastUpdated>20070417090928</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
--- /dev/null
+bc87573a595a2c387b5baa4ad7d06743
\ No newline at end of file
--- /dev/null
+e9ecaaa14a3c09b07206980c15749a631dbc986a
\ No newline at end of file
--- /dev/null
+16a308257949f23afa5d1f1dec41aa44
\ No newline at end of file
--- /dev/null
+36a3a9cc35b8ca0d73998d7b39d290b489800a22
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-b</artifactId>
+ <packaging>jar</packaging>
+ <version>2.0</version>
+ <name>artifact-b</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-c</artifactId>
+ <version>3.0</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ </extension>
+ </extensions>
+ </build>
+</project>
--- /dev/null
+be5b8f8539a62b5935793ebeb87215fd
\ No newline at end of file
--- /dev/null
+012a658d4a4f70aa3e8dd4b2db67020817b7dfcc
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-b</artifactId>
+ <version>2.0</version>
+ <versioning>
+ <versions>
+ <version>2.0</version>
+ </versions>
+ <lastUpdated>20070417090908</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
--- /dev/null
+bedfccc27fc7dc262d5c99a7aa8b83d8
\ No newline at end of file
--- /dev/null
+4902ea6b16838ff26f9136460c4394b0ad7cc7f5
\ No newline at end of file
--- /dev/null
+853a10a201f8a296e37e856615c5349c
\ No newline at end of file
--- /dev/null
+5155da8820ed77c43e983c1244d94a3b27bf08f7
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-c</artifactId>
+ <packaging>jar</packaging>
+ <version>3.0</version>
+ <name>artifact-c</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ </extension>
+ </extensions>
+ </build>
+</project>
--- /dev/null
+4df0417579b1492f37da14316adb85af
\ No newline at end of file
--- /dev/null
+c3b007acd9c17b80753b39a4121255965e7e2e65
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-c</artifactId>
+ <version>3.0</version>
+ <versioning>
+ <versions>
+ <version>3.0</version>
+ </versions>
+ <lastUpdated>20070417090835</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
--- /dev/null
+74d58d97e78d5e51cc02c489c5edba0d
\ No newline at end of file
--- /dev/null
+5c7571eb35248be0f65758783b036e8f7899c146
\ No newline at end of file
--- /dev/null
+55f498a518e1151ce2e54daa674691de
\ No newline at end of file
--- /dev/null
+730551bde461564d3f8a7e0178ef9bc54a86d2dd
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-s</artifactId>
+ <packaging>jar</packaging>
+ <version>0.1</version>
+ <name>artifact-s</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-a</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ </extension>
+ </extensions>
+ </build>
+</project>
--- /dev/null
+746ba2848229dbc1c9683ece0e7f02c8
\ No newline at end of file
--- /dev/null
+0d068f63069a86d982075a1dca7fe74fd95a29df
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>artifact-s</artifactId>
+ <version>0.1</version>
+ <versioning>
+ <versions>
+ <version>0.1</version>
+ </versions>
+ <lastUpdated>20070417090721</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
--- /dev/null
+baa0ad0afaba9cee66ec262b38f796b6
\ No newline at end of file
--- /dev/null
+dea84d579f673d2d87c7bd47e4318cdf8e59e4d0
\ No newline at end of file
--- /dev/null
+#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
--- /dev/null
+306d556e6e5e4d604dc854d09ddcdefd
\ No newline at end of file
--- /dev/null
+afb6586f5eb4c63dd5735a0bed11c99c7fac6755
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>foo-bar</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <distributionManagement>
+ <status>deployed</status>
+ </distributionManagement>
+</project>
\ No newline at end of file
--- /dev/null
+8e896baea663a45d7bd2737f8e464481
\ No newline at end of file
--- /dev/null
+e37897c617d78dedd978766a2db318d301e80105
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>foo-bar</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <versioning>
+ <snapshot>
+ <buildNumber>1</buildNumber>
+ </snapshot>
+ <lastUpdated>20070425105840</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
--- /dev/null
+add4f71a005137e9a296c5b192e900c2
\ No newline at end of file
--- /dev/null
+b505e302169e04fc821bf571da7435b1e42ef8d7
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>org.apache.maven.archiva.web.test</groupId>
+ <artifactId>foo-bar</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <versioning>
+ <versions>
+ <version>1.0-SNAPSHOT</version>
+ </versions>
+ <lastUpdated>20070425105840</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
--- /dev/null
+f3b657fb48d2e82fee5fada169756938
\ No newline at end of file
--- /dev/null
+f4629e609deb95cefdcdddc6dd8c2942d1c3e47f
\ No newline at end of file
--- /dev/null
+#
+# 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
+
+