db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-3412) junit regression test failure on j2me in testForwardOnlyNegative(org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test)junit.framework.AssertionFailedError
Date Thu, 14 Feb 2008 13:01:12 GMT

     [ https://issues.apache.org/jira/browse/DERBY-3412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kristian Waagan updated DERBY-3412:
-----------------------------------

    Attachment: derby-3412-option_b.diff

That seems to be correct, and the error falls into one of the categories
I mentioned in DERBY-3306.
I forgot to consider the case where the utility classes were used by the
connectors, and as you say, they are already smart enough to set create
only when needed.
I don't run tests on a J2ME platform.

However, there are a number of tests that just do
(JDBC|J2EE)DataSource.getXConnectionSource(), then ds.getConnection() in
the test itself. These tests fail if you run them in a clean
environment, because the database does not exist and the tests have
been written assuming the database will exist or be created if required.

A few options for a fix:
  a) Revert the changes, let these tests fail if run in a clean
     environment (no existing db).
  b) Somehow unset createDatabase when the framework obtains the
     connection for you, but keep DERBY-3306 changes.
  c) Identify all tests failing in a clean environment and code a
     workaround.

The tests affected by DERBY-3306, are tests asserting on no warnings,
expecting exceptions on connection attempts to non-existing databases,
asserting on connection URLs and connections with attributes conflicting
with the create attribute.
I ran suites.All with a modified TestConfiguration to only use
DataSource, and saw a total of 11 failures out of 10175 tests;
    5 x DatabaseMetaDataTest.testGetURL
    5 x ScrollCursors2Test.<variousMethods>
    1 x ClientSideSystemPropertiesTest.testConnection
        (fails because it is written for DriverManager?)

The reason for obtaining the data source directly and creating a
connection oneself, is probably because one needs full control over the
data source and cannot trust/expect the test framework to do the right
thing.

Regarding the (non-exhaustive) list of solutions, I have made a
patch suggestion for option b. It clutters the data source connectors a
little, but not much. With it, only the ClientSideSystemPropertiesTest fail.
Option a and c can also be pursued.
I guess option a would mean all responsibility for creating the required
databases is put on the test developer, which
is fine for future tests, but requires work to go back and change
existing tests. 
I'll back out the change if requested.

Any thoughts on which solution to choose?

> junit regression test failure on j2me  in testForwardOnlyNegative(org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test)junit.framework.AssertionFailedError
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3412
>                 URL: https://issues.apache.org/jira/browse/DERBY-3412
>             Project: Derby
>          Issue Type: Bug
>          Components: Regression Test Failure
>    Affects Versions: 10.4.0.0
>         Environment: Java Version:    J2ME Foundation Specification v1.1
> Java Vendor:     IBM Corporation
> Java home:       c:\jartest\weme6.1
> Java classpath:  c:/jartest/classes/derby.jar;c:/jartest/classes/derbyLocale_zh_TW.jar;c:/jartest/classes/derbyLocale_zh_CN.jar;c:/jartest/classes/derbyLocale_ru.jar;c:/jartest/classes/derbyLocale_pt_BR.jar;c:/jartest/classes/derbyLocale_pl.jar;c:/jartest/classes/derbyLocale_ko_KR.jar;c:/jartest/classes/derbyLocale_ja_JP.jar;c:/jartest/classes/derbyLocale_it.jar;c:/jartest/classes/derbyLocale_hu.jar;c:/jartest/classes/derbyLocale_fr.jar;c:/jartest/classes/derbyLocale_es.jar;c:/jartest/classes/derbyLocale_de_DE.jar;c:/jartest/classes/derbyLocale_cs.jar;c:/jartest/tools/java/junit.jar;c:/jartest/classes/derbytools.jar;c:/jartest/classes/derbyrun.jar;c:/jartest/classes/derbyTesting.jar;c:/jartest/classes/functionTests.jar
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1 build 2600 Service Pack 2
> Java user name:  cloudtest
> Java user home:  C:\Documents and Settings\cloudtest
> Java user dir:   C:\jartest\JarResults.2008-02-11\weme6.1_derbyall
> java.specification.name: J2ME Foundation Specification
> java.specification.version: 1.1
>            Reporter: Mike Matrigali
>         Attachments: derby-3412-option_b.diff
>
>
> 5 new failures as of 2/11/08 in the ScrollCursors2Test, only seen in j2me test:
> 1) testForwardOnlyNegative(org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test)junit.framework.AssertionFailedError
> 	at org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test.testForwardOnlyNegative(ScrollCursors2Test.java:95)
> 	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
> 	at <unknown class>.<unknown method>(Unknown Source)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:99)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 2) testForwardOnlyPositive(org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test)junit.framework.AssertionFailedError
> 	at org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test.testForwardOnlyPositive(ScrollCursors2Test.java:263)
> 	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
> 	at <unknown class>.<unknown method>(Unknown Source)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:99)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 3) testScrollInsensitivePositive(org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test)junit.framework.AssertionFailedError
> 	at org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test.testScrollInsensitivePositive(ScrollCursors2Test.java:352)
> 	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
> 	at <unknown class>.<unknown method>(Unknown Source)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:99)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 4) testScrollInsensitiveNegative(org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test)junit.framework.AssertionFailedError
> 	at org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test.testScrollInsensitiveNegative(ScrollCursors2Test.java:505)
> 	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
> 	at <unknown class>.<unknown method>(Unknown Source)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:99)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 5) testCallableStatements(org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test)junit.framework.ComparisonFailure:
expected:<...2> but was:<...1>
> 	at org.apache.derbyTesting.functionTests.tests.lang.ScrollCursors2Test.testCallableStatements(ScrollCursors2Test.java:580)
> 	at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
> 	at <unknown class>.<unknown method>(Unknown Source)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:99)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
> 	at junit.extensions.TestSetup.run(TestSetup.java:23)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message