dev@glassfish.java.net

Sahoo: PROBLEM UNDERSTOOD: BV QL Test Failure

From: Ed Burns <Ed.Burns_at_Sun.COM>
Date: Thu, 22 Oct 2009 06:31:35 -0700

One sentance Summary:
=====================

The test failure is due to an assertion in my tescase that was not
updated to reflect the new "correct".

Executive Summary:
==================

An incorrect assumption on my part caused me to conclude that QL was
passing when in fact it was not. There are two reasons I concluded the
QL was passing.

1. I always manually deploy the simple-bv-servlet.war and visit the
   <http://localhost:8080/simple-bv-servlet/test> in my browser and
   manually inspect the output. This output was always correct
   throughout this whole debacle.

2. I assumed the QL build would fail if a test fails. This is an
   incorrect assumption.

The reason the test was failing was that an assertion was looking for a
regular expression that was no longer present in the output due to a
package name change between versions 3.0-JBoss-4.0.0.Beta3A and
3.0-JBoss-4.0.1_01.

ACTION: Sahoo: Can you please give me a call at x31640 when you read
this message?

Details:
========

>>>>> On Wed, 21 Oct 2009 13:34:50 -0700, Jerome Dochez <Jerome.Dochez_at_Sun.COM> said:

JD> you fail the same BV quicklook test than last friday. I just reverted
JD> this integration.

>>>>> On Wed, 21 Oct 2009 14:01:42 -0700, Ed Burns <ed.burns_at_sun.com> said:

EB> I ran the quicklook tests on MacOS X and Solaris, with in glassfish and
EB> web profile, with security manager enabled and disabled, and it worked
EB> for me. I don't know what else I have to do to not have my changes
EB> kicked back out.

>>>>> On Wed, 21 Oct 2009 14:21:05 -0700, Jerome Dochez <Jerome.Dochez_at_Sun.COM> said:

JD> you must do something wrong b/c when I was building v3 against hk2
JD> snapshots after your checkin yesterday, I could see that the BV test
JD> was failing.

Ahh, I see now the problem. My mistake was to assumme that seeing BUILD
SUCCESSFUL after running quicklook meant that quicklook was successful.
That's how it is with our JSF automated test suite. Here's the problem.

   [testng] FAILED: executeServlet
   [testng] java.lang.AssertionError: Unable to find match for regex (?s)(?m).*Obtained ValidatorFactory: org.hibernate.validation.engine.ValidatorFactoryImpl.* in output from request to http://localhost:8080/simple-bv-servlet/test expected:<true> but was:<false>
   [testng] at test.bv.servlet.simple.SimpleBVServletTestNG.executeServlet(SimpleBVServletTestNG.java:125)
   [testng] ... Removed 25 stack frames

   [testng] ===============================================
   [testng] bv_servlet_simple
   [testng] Tests run: 1, Failures: 1, Skips: 0
   [testng] ===============================================

This failure is due to the test not being updated after the package name
changed between version 3.0-JBoss-4.0.0.Beta3A and 3.0-JBoss-4.0.1_01.
I made the following change to the test.

Index: bean-validator/simple-bv-servlet/src/test/test/bv/servlet/simple/SimpleBVServletTestNG.java
===================================================================
--- bean-validator/simple-bv-servlet/src/test/test/bv/servlet/simple/SimpleBVServletTestNG.java (revision 33096)
+++ bean-validator/simple-bv-servlet/src/test/test/bv/servlet/simple/SimpleBVServletTestNG.java (working copy)
@@ -87,7 +87,7 @@
             boolean result = false;
             String testLine = null;
             String[] regexesToFind = {
- "(?s)(?m).*Obtained ValidatorFactory: org.hibernate.validation.engine.ValidatorFactoryImpl.*",
+ "(?s)(?m).*Obtained ValidatorFactory: org.hibernate.validator.engine.ValidatorFactoryImpl.*",
                 "(?s)(?m).*case1: No ConstraintViolations found.*",
                 "(?s)(?m).*case2: caught IllegalArgumentException.*",
                 "(?s)(?m).*case3: ConstraintViolation: message: may not be null propertyPath: listOfString.*",

And now it passes:

   [testng] PASSED: executeServlet

   [testng] ===============================================
   [testng] bv_servlet_simple
   [testng] Tests run: 1, Failures: 0, Skips: 0
   [testng] ===============================================

>>>>> On Thu, 22 Oct 2009 11:29:17 +0530, Sahoo <Sahoo_at_sun.com> said:

SS> I am not sure what is the case with your setup, but when I tried to use
SS> HK2 version 0.4.4-SNAPSHOT as mentioned above, I observed one QL
SS> failure. Since I need a newer version of HK2 later today, I have
SS> reverted your BV integration in HK2 as shown below:
SS> ss141213_at_Sahoo:/space/ss141213/WS/hk2/trunk$ svn commit -m "Revert back
SS> to bean-validator version 3.0-JBoss-4.0.0.Beta3A"
SS> Sending config/pom.xml

ACTION: Ok, we have a very funny little set of race conditions here. Sahoo,
let's talk on the phone. Can you please give me a call at 31640 when
you read this message?

Ed

-- 
| ed.burns_at_sun.com  | office: 408 884 9519 OR x31640
| homepage:         | http://ridingthecrest.com/