Commits

Jan Lahoda committed 327cd99

Tests must use a (random) free port, rather than claiming 9998

Comments (0)

Files changed (3)

remoting/server/tests/integration/pom.xml

   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
-
+  <build>
+      <plugins>
+          <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-surefire-plugin</artifactId>
+              <configuration>
+                  <systemProperties>
+                      <property>
+                          <name>PORT</name>
+                          <value>${PORT}</value>
+                      </property>
+                  </systemProperties>
+              </configuration>
+          </plugin>
+      </plugins>
+  </build>
     <dependencies>
         <dependency>
             <groupId>org.seleniumhq.selenium</groupId>

remoting/server/tests/integration/src/test/java/org/netbeans/modules/jackpot30/web/ui/test/OverallTest.java

         ((HtmlUnitDriver) driver).setJavascriptEnabled(true);
 
         try {
-            driver.get("http://localhost:9998/index/ui/index.html");
+            driver.get("http://localhost:" + System.getProperty("PORT", "9998") + "/index/ui/index.html");
 
             //wait for the page to be rendered:
             new WebDriverWait(driver, 20).until(new Predicate<WebDriver>() {

remoting/server/tests/run-integration-tests

 
 OUT=`mktemp`;
 trap "rm $OUT" EXIT
-#JACKPOT_WEB_OPTS=-Xmx128m ../../build/indexing-backend/web.sh --port 0 cache >"$OUT" &
-JACKPOT_WEB_OPTS=-Xmx128m ../../build/indexing-backend/web.sh cache >"$OUT" &
+JACKPOT_WEB_OPTS=-Xmx128m ../../build/indexing-backend/web.sh --port 0 cache >"$OUT" &
 
 trap "kill %1" EXIT
 
-#while [ -z "$PORT" ] ; do
-#     sleep 1s;
-#     PORT=`cat "$OUT" | grep "Running on port: " | cut -d ':' -f 2 | tr -d ' '`;
-#done
+while [ -z "$PORT" ] ; do
+     sleep 1s;
+     PORT=`cat "$OUT" | grep "Running on port: " | cut -d ':' -f 2 | tr -d ' '`;
+done
 
-(cd integration; mvn test)
+(cd integration; mvn -DPORT=$PORT test)
 
 exit 0