]> source.dussan.org Git - archiva.git/commitdiff
ugly display stack trace in selenium tests to know why it failed on asf jenkins in...
authorOlivier Lamy <olamy@apache.org>
Fri, 17 Jun 2011 20:59:36 +0000 (20:59 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 17 Jun 2011 20:59:36 +0000 (20:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1137019 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-test/src/test/testng/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java

index 654d84835ab830c584b18d8c7c99284e01e843fb..5088893726b8c3349c11457ec0e22a41a26e5ab8 100644 (file)
@@ -67,15 +67,25 @@ public abstract class AbstractSeleniumTest
     public void open( String baseUrl, String browser, String seleniumHost, int seleniumPort, String maxWaitTimeInMs )
         throws Exception
     {
-        AbstractSeleniumTest.baseUrl = baseUrl;
-        AbstractSeleniumTest.maxWaitTimeInMs = maxWaitTimeInMs;
+        try
+        {
+            AbstractSeleniumTest.baseUrl = baseUrl;
+            AbstractSeleniumTest.maxWaitTimeInMs = maxWaitTimeInMs;
 
-        if ( getSelenium() == null )
+            if ( getSelenium() == null )
+            {
+                DefaultSelenium s =
+                    new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl + "?" + forceLocaleParam );
+                s.start();
+                s.setTimeout( maxWaitTimeInMs );
+                selenium.set( s );
+            }
+        }
+        catch ( Exception e )
         {
-            DefaultSelenium s = new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl + "?" + forceLocaleParam );
-            s.start();
-            s.setTimeout( maxWaitTimeInMs );
-            selenium.set( s );
+            // yes
+            System.out.print( e.getMessage() );
+            e.printStackTrace();
         }
     }
 
@@ -405,14 +415,14 @@ public abstract class AbstractSeleniumTest
         Assert.assertFalse( getSelenium().isChecked( locator ) );
     }
 
-    public void assertXpathCount(String locator, int expectedCount)
+    public void assertXpathCount( String locator, int expectedCount )
     {
-        Assert.assertEquals( getSelenium().getXpathCount(locator).intValue(), expectedCount );
+        Assert.assertEquals( getSelenium().getXpathCount( locator ).intValue(), expectedCount );
     }
 
-    public void assertElementValue(String locator, String expectedValue)
+    public void assertElementValue( String locator, String expectedValue )
     {
-        Assert.assertEquals(getSelenium().getValue(locator), expectedValue);
+        Assert.assertEquals( getSelenium().getValue( locator ), expectedValue );
     }
 
 }
\ No newline at end of file