diff options
2 files changed, 18 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test-js/pom.xml index 1a36d93a3..cc81ea119 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp-test-js/pom.xml @@ -31,6 +31,8 @@ <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> @@ -201,6 +203,7 @@ <maxWaitTimeInMs>${maxWaitTimeInMs}</maxWaitTimeInMs> <seleniumHost>${seleniumHost}</seleniumHost> <seleniumPort>${seleniumPort}</seleniumPort> + <tomcat.propertiesPortFilePath>${tomcat.propertiesPortFilePath}</tomcat.propertiesPortFilePath> </systemPropertyVariables> </configuration> </execution> @@ -279,7 +282,7 @@ </tasks> </configuration> </execution> - <execution> + <!--execution> <id>check-archiva-loaded</id> <phase>integration-test</phase> <configuration> @@ -291,7 +294,7 @@ <goals> <goal>run</goal> </goals> - </execution> + </execution--> </executions> </plugin> <plugin> @@ -330,6 +333,7 @@ <archiva.devMode>true</archiva.devMode> </systemProperties> <contextFile>${project.build.testOutputDirectory}/archiva.xml</contextFile> + <propertiesPortFilePath>${tomcat.propertiesPortFilePath}</propertiesPortFilePath> <useNaming>true</useNaming> </configuration> </execution> diff --git a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java index 69bb0791f..c486fea38 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test-js/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java @@ -26,6 +26,7 @@ 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; @@ -48,7 +49,8 @@ public abstract class AbstractSeleniumTest public String browser = System.getProperty( "browser" ); - public String baseUrl = System.getProperty( "baseUrl" ); + public String baseUrl = + "http://localhost:" + System.getProperty( "tomcat.maven.http.port" ) + "/archiva/index.html?request_lang=en"; public int maxWaitTimeInMs = Integer.getInteger( "maxWaitTimeInMs" ); @@ -70,6 +72,15 @@ public abstract class AbstractSeleniumTest { 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(); |