commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: [Validator] Unit tests failing
Date Mon, 29 Mar 2004 05:32:36 GMT

--- Martin Cooper <martinc@apache.org> wrote:
> On Mon, 29 Mar 2004, Niall Pemberton wrote:
> 
> > I think its the ExceptionTest which is failing and it looks like it
> should
> > from the code. There are three tests in ExceptionTest - only one has
> code to
> > "pass" the test if it gets the Exception its expecting - the other two
> are
> > set to "fail".
> >
> > The two test which have failures have code to "pass" the test if the
> > expected Exception is received but its been commented out and replaced
> with
> > "fail" code. Theres a note saying "This will be true in Validator 2.0"
> above
> > the commented out code in one of the tests but that doesn't really
> explain
> > why the tests have been set up to throw an exception and then "fail".
> >
> > I think the bugs are in the test!
> 
> No, the problems I'm seeing are definitely in the e-mail tests. I've
> attached the Maven rest reports for the e-mail and exception tests, in
> which you can see that the former failed, while the latter succeeded.

The email tests are known to fail because there is a known bug in
EmailValidator.  I setup the exception tests and they should pass even
though exceptions may get thrown.  The stack traces you're seeing is
commons-logging at work :-).

I believe Rob knows more about the email situation but I think it's fine
to release with the bug that's been known for a while now.

David

> 
> --
> Martin Cooper
> 
> 
> >
> > Niall
> >
> >
> > ----- Original Message -----
> > From: "Martin Cooper" <martinc@apache.org>
> > To: <commons-dev@jakarta.apache.org>
> > Sent: Monday, March 29, 2004 2:46 AM
> > Subject: [Validator] Unit tests failing
> >
> >
> > > The e-mail test is failing for me, with the stack trace below.
> > >
> > > Ideas, anyone?
> > >
> > > --
> > > Martin Cooper
> > >
> > >
> > >     [junit] Running org.apache.commons.validator.EmailTest
> > >     [junit] Tests run: 8, Failures: 2, Errors: 0, Time elapsed:
> 1.913 sec
> > >     [junit] [ERROR] TEST org.apache.commons.validator.EmailTest
> FAILED
> > >     [junit] dir attribute ignored if running in the same VM
> > >     [junit] Running org.apache.commons.validator.ExceptionTest Mar
> 28,
> > > 2004 5:32:49 PM org.apache.commons.validator.ValidatorAction
> executeVali
> > > dationMethod SEVERE: Unhandled exception thrown during validation:
> > > RUNTIME-EXCEPTION java.lang.RuntimeException: RUNTIME-EXCEPTION
> > >         at
> > >
> org.apache.commons.validator.TestValidator.validateRaiseException(Tes
> > > tValidator.java:53)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> > >         at
> > >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> > > java:39)
> > >         at
> > >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> > > sorImpl.java:25)
> > >         at java.lang.reflect.Method.invoke(Method.java:324)
> > >         at
> > >
> org.apache.commons.validator.ValidatorAction.executeValidationMethod(
> > > ValidatorAction.java:570)
> > >         at
> > > org.apache.commons.validator.Field.validateForRule(Field.java:808)
> > >         at
> org.apache.commons.validator.Field.validate(Field.java:887)
> > >         at org.apache.commons.validator.Form.validate(Form.java:171)
> > >         at
> > > org.apache.commons.validator.Validator.validate(Validator.java:367)
> > >         at
> > >
> org.apache.commons.validator.ExceptionTest.testRuntimeException(Excep
> > > tionTest.java:98)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> > >         at
> > >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> > > java:39)
> > >         at
> > >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> > > sorImpl.java:25)
> > >         at java.lang.reflect.Method.invoke(Method.java:324)
> > >         at junit.framework.TestCase.runTest(TestCase.java:154)
> > >         at junit.framework.TestCase.runBare(TestCase.java:127)
> > >         at junit.framework.TestResult$1.protect(TestResult.java:106)
> > >         at
> junit.framework.TestResult.runProtected(TestResult.java:124)
> > >         at junit.framework.TestResult.run(TestResult.java:109)
> > >         at junit.framework.TestCase.run(TestCase.java:118)
> > >         at junit.framework.TestSuite.runTest(TestSuite.java:208)
> > >         at junit.framework.TestSuite.run(TestSuite.java:203)
> > >         at
> > >
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUni
> > > tTestRunner.java:325)
> > >         at
> > >
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JU
> > > nitTask.java:848)
> > >         at
> > >
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT
> > > ask.java:556)
> > >         at
> > >
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitT
> > > ask.java:532)
> > >         at org.apache.tools.ant.Task.perform(Task.java:341)
> > >         at
> org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
> > >         at
> org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
> > >         at
> > > org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
> > >         at
> > > org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
> > >         at
> org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
> > >         at
> org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
> > >         at
> > > org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
> > >         at
> > > org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
> > >         at
> > > com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
> > >         at com.werken.werkz.Goal.fire(Goal.java:639)
> > >         at com.werken.werkz.Goal.attain(Goal.java:575)
> > >         at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> > >         at com.werken.werkz.Goal.attain(Goal.java:573)
> > >         at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> > >         at com.werken.werkz.Goal.attain(Goal.java:573)
> > >         at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> > >         at com.werken.werkz.Goal.attain(Goal.java:573)
> > >         at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> > >         at com.werken.werkz.Goal.attain(Goal.java:573)
> > >         at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> > >         at com.werken.werkz.Goal.attain(Goal.java:573)
> > >         at
> > >
> org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:
> 448)
> > >         at
> > > org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
> > >         at org.apache.maven.cli.App.doMain(App.java:543)
> > >         at org.apache.maven.cli.App.main(App.java:1109)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> > >         at
> > >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> > > java:39)
> > >         at
> > >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> > > sorImpl.java:25)
> > >         at java.lang.reflect.Method.invoke(Method.java:324)
> > >         at com.werken.forehead.Forehead.run(Forehead.java:551)
> > >         at com.werken.forehead.Forehead.main(Forehead.java:581) Mar
> 28,
> > > 2004 5:32:50 PM org.apache.commons.validator.ValidatorAction
> executeVali
> > > dationMethod SEVERE: Unhandled exception thrown during validation:
> > > CHECKED-EXCEPTION java.lang.Exception: CHECKED-EXCEPTION
> > >         at
> > >
> org.apache.commons.validator.TestValidator.validateRaiseException(Tes
> > > tValidator.java:56)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> > >         at
> > >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> > > java:39)
> > >         at
> > >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> > > sorImpl.java:25)
> > >         at java.lang.reflect.Method.invoke(Method.java:324)
> > >         at
> > >
> org.apache.commons.validator.ValidatorAction.executeValidationMethod(
> 
=== message truncated ===> Testsuite:
org.apache.commons.validator.EmailTest
> Tests run: 8, Failures: 2, Errors: 0, Time elapsed: 1.913 sec
> 
> Testcase: testEmailFromPerl took 0.942 sec
> 	FAILED
> Value abigail@example.com ValidatorResult for the 'email' action should
> have passed.
> junit.framework.AssertionFailedError: Value abigail@example.com
> ValidatorResult for the 'email' action should have passed.
> 	at
> org.apache.commons.validator.EmailTest.valueTest(EmailTest.java:382)
> 	at
>
org.apache.commons.validator.EmailTest.testEmailFromPerl(EmailTest.java:349)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
> 	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
> 	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
> 	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
> 	at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
> 	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
> 	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
> 	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
> 	at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
> 	at com.werken.werkz.Goal.fire(Goal.java:639)
> 	at com.werken.werkz.Goal.attain(Goal.java:575)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at
>
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:448)
> 	at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
> 	at org.apache.maven.cli.App.doMain(App.java:543)
> 	at org.apache.maven.cli.App.main(App.java:1109)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at com.werken.forehead.Forehead.run(Forehead.java:551)
> 	at com.werken.forehead.Forehead.main(Forehead.java:581)
> 
> Testcase: testEmailFromPerlTestcase: testEmail took 0.08 sec
> Testcase: testEmailExtension took 0.36 sec
> Testcase: testEmailWithDash took 0.09 sec
> Testcase: testEmailWithDotEnd took 0.1 sec
> Testcase: testEmailWithBogusCharacter took 0.081 sec
> Testcase: testEmailWithCommas took 0.09 sec
> Testcase: testEmailUserName took 0.14 sec
> 	FAILED
> Value joe+@apache.orgValidatorResult for the 'email' action should have
> failed.
> junit.framework.AssertionFailedError: Value
> joe+@apache.orgValidatorResult for the 'email' action should have
> failed.
> 	at
> org.apache.commons.validator.EmailTest.valueTest(EmailTest.java:382)
> 	at
>
org.apache.commons.validator.EmailTest.testEmailUserName(EmailTest.java:209)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
> 	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
> 	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
> 	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
> 	at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
> 	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
> 	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
> 	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
> 	at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
> 	at com.werken.werkz.Goal.fire(Goal.java:639)
> 	at com.werken.werkz.Goal.attain(Goal.java:575)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at com.werken.werkz.Goal.attainPrecursors(Goal.java:488)
> 	at com.werken.werkz.Goal.attain(Goal.java:573)
> 	at
>
org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:448)
> 	at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
> 	at org.apache.maven.cli.App.doMain(App.java:543)
> 	at org.apache.maven.cli.App.main(App.java:1109)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at com.werken.forehead.Forehead.run(Forehead.java:551)
> 	at com.werken.forehead.Forehead.main(Forehead.java:581)
> 
> Testcase: testEmailUserName> Testsuite:
org.apache.commons.validator.ExceptionTest
> Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 1.783 sec
> 
> Testcase: testValidatorException took 0.721 sec
> Testcase: testRuntimeException took 0.671 sec
> Testcase: testCheckedException took 0.34 sec
> > ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message