You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2013/11/04 20:49:08 UTC

[1/3] git commit: Use SLF4J Logging

Updated Branches:
  refs/heads/master c685a96e1 -> bec5a5c77


Use SLF4J Logging


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/864623aa
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/864623aa
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/864623aa

Branch: refs/heads/master
Commit: 864623aa8db942c99bcd3e256b3685a08d87fd71
Parents: c685a96
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Nov 4 10:55:50 2013 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Nov 4 10:55:50 2013 -0800

----------------------------------------------------------------------
 .../apache/tapestry5/test/SeleniumTestCase.java | 73 ++++++++++++++------
 1 file changed, 51 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/864623aa/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
----------------------------------------------------------------------
diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
index c2b6232..6233879 100644
--- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
+++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
@@ -20,6 +20,8 @@ import com.thoughtworks.selenium.HttpCommandProcessor;
 import com.thoughtworks.selenium.Selenium;
 import org.openqa.selenium.server.RemoteControlConfiguration;
 import org.openqa.selenium.server.SeleniumServer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 import org.testng.ITestContext;
 import org.testng.annotations.*;
@@ -37,6 +39,8 @@ import java.lang.reflect.Method;
  */
 public abstract class SeleniumTestCase extends Assert implements Selenium
 {
+    public final Logger LOGGER = LoggerFactory.getLogger(SeleniumTestCase.class);
+
     /**
      * 15 seconds
      */
@@ -175,14 +179,16 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
 
         String baseURL = String.format("http://localhost:%d%s/", port, contextPath);
 
-        System.err.println("Starting SeleniumTestCase:");
-        System.err.println("    currentDir: " + System.getProperty("user.dir"));
-        System.err.println("  webAppFolder: " + webAppFolder);
-        System.err.println("     container: " + container);
-        System.err.println("   contextPath: " + contextPath);
-        System.err.printf("         ports: %d / %d%n", port, sslPort);
-        System.err.println("  browserStart: " + browserStartCommand);
-        System.err.println("       baseURL: " + baseURL);
+        String sep = System.getProperty("line.separator");
+
+        LOGGER.info("Starting SeleniumTestCase:" + sep +
+                "    currentDir: " + System.getProperty("user.dir") + sep +
+                "  webAppFolder: " + webAppFolder + sep +
+                "     container: " + container + sep +
+                "   contextPath: " + contextPath + sep +
+                String.format("         ports: %d / %d", port, sslPort) + sep +
+                "  browserStart: " + browserStartCommand + sep +
+                "       baseURL: " + baseURL);
 
         final Runnable stopWebServer = launchWebServer(container, webAppFolder, contextPath, port, sslPort);
 
@@ -221,17 +227,35 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
             {
                 try
                 {
-                    System.err.println("Shutting down selenium client ...");
-
-                    selenium.stop();
-
-                    System.err.println("Shutting down selenium server ...");
-
-                    seleniumServer.stop();
-
-                    System.err.println("Shutting web server ...");
-
-                    stopWebServer.run();
+                    LOGGER.info("Shutting down selenium client ...");
+
+                    try
+                    {
+                        selenium.stop();
+                    } catch (RuntimeException e)
+                    {
+                        LOGGER.error("Selenium client shutdown failure.", e);
+                    }
+
+                    LOGGER.info("Shutting down selenium server ...");
+
+                    try
+                    {
+                        seleniumServer.stop();
+                    } catch (RuntimeException e)
+                    {
+                        LOGGER.error("Selenium server shutdown failure.", e);
+                    }
+
+                    LOGGER.info("Shutting web server ...");
+
+                    try
+                    {
+                        stopWebServer.run();
+                    } catch (RuntimeException e)
+                    {
+                        LOGGER.error("Web server shutdown failure.", e);
+                    }
 
                     // Output, at the end of the Test, any html capture or screen shots (this makes it much easier
                     // to locate them at the end of the run; there's such a variance on where they end up based
@@ -1158,18 +1182,23 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
         // that does not include the body element and data-page-initialized element. In those cases,
         // there will never be page initialization in the Tapestry sense and we return immediately.
 
-        if (!isElementPresent("css=body[data-page-initialized]")) { return; }
+        if (!isElementPresent("css=body[data-page-initialized]"))
+        {
+            return;
+        }
 
         int totalTime = 0;
         int sleepTime = 20;
 
-        while (true) {
+        while (true)
+        {
             if (isElementPresent("css=body[data-page-initialized='true']"))
             {
                 return;
             }
 
-            if (totalTime > 10000) {
+            if (totalTime > 10000)
+            {
                 reportAndThrowAssertionError("Page did not finish initializing.");
             }
 


[2/3] git commit: Remove errant @Test annotation from class

Posted by hl...@apache.org.
Remove errant @Test annotation from class


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/cc78fdeb
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/cc78fdeb
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/cc78fdeb

Branch: refs/heads/master
Commit: cc78fdebf5f20d278d98791d7d7bdc70518d676e
Parents: 864623a
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Nov 4 11:23:23 2013 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Nov 4 11:26:58 2013 -0800

----------------------------------------------------------------------
 ...eanEditorWithOverridenCssClassesTests.groovy | 34 ++++++++------------
 1 file changed, 14 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/cc78fdeb/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy
index 92d4463..04ef718 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy
@@ -1,38 +1,32 @@
 package org.apache.tapestry5.integration.app3
 
-import org.apache.tapestry5.integration.app3.services.AppModule
-import org.apache.tapestry5.corelib.components.BeanEditForm
 import org.apache.tapestry5.corelib.components.BeanEditor
 import org.apache.tapestry5.integration.TapestryCoreTestCase
-import org.apache.tapestry5.integration.app1.data.RegistrationData
 import org.apache.tapestry5.integration.app3.services.AppModule
 import org.apache.tapestry5.test.TapestryTestConfiguration
-import org.testng.annotations.Test
 
 /**
  * Tests for the {@link BeanEditor} component CSS overrides
  */
 @TapestryTestConfiguration(webAppFolder = "src/test/app3")
-@Test
-public class BeanEditorTestsWithOverridenCssClassesTests extends TapestryCoreTestCase
-{
-    
+public class BeanEditorTestsWithOverridenCssClassesTests extends TapestryCoreTestCase {
+
     /** TAP5-2182 */
     public void bean_editor_overriden_markup() {
 
-        final String formGroupLocator = String.format("//form[@id='form']/div[@class='%s']", AppModule.FORM_GROUP_WRAPPER_CSS_CLASS_VALUE)
-        final String divCssLocator = formGroupLocator + "/@class"
-        final String labelCssLocator = formGroupLocator + "/label/@class"
-        final String inputCssLocator = formGroupLocator + String.format("/%s[@class='%s']/input/@class",
-            AppModule.FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_NAME_VALUE, 
+        def formGroupLocator = "//form[@id='form']/div[@class='${AppModule.FORM_GROUP_WRAPPER_CSS_CLASS_VALUE}']"
+        def divCssLocator = "$formGroupLocator/@class"
+        def labelCssLocator = "$formGroupLocator/label/@class"
+        def inputCssLocator = String.format("%s/%s[@class='%s']/input/@class",
+            formGroupLocator,
+            AppModule.FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_NAME_VALUE,
             AppModule.FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_CSS_CLASS_VALUE)
-        
+
         open("/beaneditorwithoverridencssclassesdemo")
-        
-        assertEquals(AppModule.FORM_GROUP_WRAPPER_CSS_CLASS_VALUE, getAttribute(divCssLocator))
-        assertEquals(AppModule.FORM_GROUP_LABEL_CSS_CLASS_VALUE, getAttribute(labelCssLocator))
-        assertEquals(AppModule.FORM_FIELD_CSS_CLASS_VALUE, getAttribute(inputCssLocator))
-        
+
+        assertEquals AppModule.FORM_GROUP_WRAPPER_CSS_CLASS_VALUE, getAttribute(divCssLocator)
+        assertEquals AppModule.FORM_GROUP_LABEL_CSS_CLASS_VALUE, getAttribute(labelCssLocator)
+        assertEquals AppModule.FORM_FIELD_CSS_CLASS_VALUE, getAttribute(inputCssLocator)
     }
-    
+
 }


[2/3] git commit: Remove errant @Test annotation from class

Posted by hl...@apache.org.
Remove errant @Test annotation from class


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/cc78fdeb
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/cc78fdeb
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/cc78fdeb

Branch: refs/heads/master
Commit: cc78fdebf5f20d278d98791d7d7bdc70518d676e
Parents: 864623a
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Nov 4 11:23:23 2013 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Nov 4 11:26:58 2013 -0800

----------------------------------------------------------------------
 ...eanEditorWithOverridenCssClassesTests.groovy | 34 ++++++++------------
 1 file changed, 14 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/cc78fdeb/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy
index 92d4463..04ef718 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app3/BeanEditorWithOverridenCssClassesTests.groovy
@@ -1,38 +1,32 @@
 package org.apache.tapestry5.integration.app3
 
-import org.apache.tapestry5.integration.app3.services.AppModule
-import org.apache.tapestry5.corelib.components.BeanEditForm
 import org.apache.tapestry5.corelib.components.BeanEditor
 import org.apache.tapestry5.integration.TapestryCoreTestCase
-import org.apache.tapestry5.integration.app1.data.RegistrationData
 import org.apache.tapestry5.integration.app3.services.AppModule
 import org.apache.tapestry5.test.TapestryTestConfiguration
-import org.testng.annotations.Test
 
 /**
  * Tests for the {@link BeanEditor} component CSS overrides
  */
 @TapestryTestConfiguration(webAppFolder = "src/test/app3")
-@Test
-public class BeanEditorTestsWithOverridenCssClassesTests extends TapestryCoreTestCase
-{
-    
+public class BeanEditorTestsWithOverridenCssClassesTests extends TapestryCoreTestCase {
+
     /** TAP5-2182 */
     public void bean_editor_overriden_markup() {
 
-        final String formGroupLocator = String.format("//form[@id='form']/div[@class='%s']", AppModule.FORM_GROUP_WRAPPER_CSS_CLASS_VALUE)
-        final String divCssLocator = formGroupLocator + "/@class"
-        final String labelCssLocator = formGroupLocator + "/label/@class"
-        final String inputCssLocator = formGroupLocator + String.format("/%s[@class='%s']/input/@class",
-            AppModule.FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_NAME_VALUE, 
+        def formGroupLocator = "//form[@id='form']/div[@class='${AppModule.FORM_GROUP_WRAPPER_CSS_CLASS_VALUE}']"
+        def divCssLocator = "$formGroupLocator/@class"
+        def labelCssLocator = "$formGroupLocator/label/@class"
+        def inputCssLocator = String.format("%s/%s[@class='%s']/input/@class",
+            formGroupLocator,
+            AppModule.FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_NAME_VALUE,
             AppModule.FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_CSS_CLASS_VALUE)
-        
+
         open("/beaneditorwithoverridencssclassesdemo")
-        
-        assertEquals(AppModule.FORM_GROUP_WRAPPER_CSS_CLASS_VALUE, getAttribute(divCssLocator))
-        assertEquals(AppModule.FORM_GROUP_LABEL_CSS_CLASS_VALUE, getAttribute(labelCssLocator))
-        assertEquals(AppModule.FORM_FIELD_CSS_CLASS_VALUE, getAttribute(inputCssLocator))
-        
+
+        assertEquals AppModule.FORM_GROUP_WRAPPER_CSS_CLASS_VALUE, getAttribute(divCssLocator)
+        assertEquals AppModule.FORM_GROUP_LABEL_CSS_CLASS_VALUE, getAttribute(labelCssLocator)
+        assertEquals AppModule.FORM_FIELD_CSS_CLASS_VALUE, getAttribute(inputCssLocator)
     }
-    
+
 }


[3/3] git commit: Add some further logging

Posted by hl...@apache.org.
Add some further logging


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/bec5a5c7
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/bec5a5c7
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/bec5a5c7

Branch: refs/heads/master
Commit: bec5a5c77e8d0d7a08047e954a76014edec38113
Parents: cc78fde
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Nov 4 11:49:00 2013 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Nov 4 11:49:00 2013 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/tapestry5/test/SeleniumTestCase.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/bec5a5c7/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
----------------------------------------------------------------------
diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
index 6233879..426f02d 100644
--- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
+++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
@@ -39,7 +39,7 @@ import java.lang.reflect.Method;
  */
 public abstract class SeleniumTestCase extends Assert implements Selenium
 {
-    public final Logger LOGGER = LoggerFactory.getLogger(SeleniumTestCase.class);
+    public final static Logger LOGGER = LoggerFactory.getLogger(SeleniumTestCase.class);
 
     /**
      * 15 seconds
@@ -304,7 +304,7 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
 
         if (r != null)
         {
-            System.err.println("Shutting down integration tests ...");
+            LOGGER.info("Shutting down integration test support ...");
             r.run();
         }
     }
@@ -398,6 +398,8 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
     @BeforeMethod
     public void indicateTestMethodName(Method testMethod)
     {
+        LOGGER.info("Executing " + testMethod);
+
         testContext.setAttribute(TapestryTestConstants.CURRENT_TEST_METHOD_ATTRIBUTE, testMethod);
 
         String className = testMethod.getDeclaringClass().getSimpleName();


[3/3] git commit: Add some further logging

Posted by hl...@apache.org.
Add some further logging


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/bec5a5c7
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/bec5a5c7
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/bec5a5c7

Branch: refs/heads/master
Commit: bec5a5c77e8d0d7a08047e954a76014edec38113
Parents: cc78fde
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Nov 4 11:49:00 2013 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Nov 4 11:49:00 2013 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/tapestry5/test/SeleniumTestCase.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/bec5a5c7/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
----------------------------------------------------------------------
diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
index 6233879..426f02d 100644
--- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
+++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
@@ -39,7 +39,7 @@ import java.lang.reflect.Method;
  */
 public abstract class SeleniumTestCase extends Assert implements Selenium
 {
-    public final Logger LOGGER = LoggerFactory.getLogger(SeleniumTestCase.class);
+    public final static Logger LOGGER = LoggerFactory.getLogger(SeleniumTestCase.class);
 
     /**
      * 15 seconds
@@ -304,7 +304,7 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
 
         if (r != null)
         {
-            System.err.println("Shutting down integration tests ...");
+            LOGGER.info("Shutting down integration test support ...");
             r.run();
         }
     }
@@ -398,6 +398,8 @@ public abstract class SeleniumTestCase extends Assert implements Selenium
     @BeforeMethod
     public void indicateTestMethodName(Method testMethod)
     {
+        LOGGER.info("Executing " + testMethod);
+
         testContext.setAttribute(TapestryTestConstants.CURRENT_TEST_METHOD_ATTRIBUTE, testMethod);
 
         String className = testMethod.getDeclaringClass().getSimpleName();