db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3222) 'CollationTest' fails with ' expected:<1> but was:<0>' in testPolishCollation(CollationTest.java:402)
Date Fri, 30 Nov 2007 06:08:45 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547007
] 

Mamta A. Satoor commented on DERBY-3222:
----------------------------------------

Since the main goal of the test in question is to make sure that we do not throw collation
type mismatch error for the comparison operation, I think it will be fine to alter the existing
test as shown below
****************existing test******************
    s.executeUpdate("create table a (vc varchar(30))");
    s.executeUpdate("insert into a values(CURRENT_DATE)");
    rs = s.executeQuery("select vc from a where vc = CURRENT_DATE");
    assertEquals(1,JDBC.assertDrainResults(rs));
    rs = s.executeQuery("select vc from a where vc = UPPER(CURRENT_DATE)");
    JDBC.assertDrainResults(rs,1);
    rs = s.executeQuery("select vc from a where vc =  '' || CURRENT_DATE");
    JDBC.assertDrainResults(rs,1);
    rs = s.executeQuery("select vc from a where '' || CURRENT_DATE = vc");
    assertEquals(1,JDBC.assertDrainResults(rs));
    assertStatementError("42818",s,"select TABLENAME FROM SYS.SYSTABLES WHERE UPPER(CURRENT_DATE)
= TABLENAME");
****************existing test end*************

to following

****************suggested change**********
    s.executeUpdate("create table a (vc varchar(30))");
    s.executeUpdate("insert into a values(CURRENT_DATE)");
    rs = s.executeQuery("select vc from a where vc <= CURRENT_DATE");
    assertEquals(1,JDBC.assertDrainResults(rs));
    rs = s.executeQuery("select vc from a where vc <= UPPER(CURRENT_DATE)");
    JDBC.assertDrainResults(rs,1);
    rs = s.executeQuery("select vc from a where vc <=  '' || CURRENT_DATE");
    JDBC.assertDrainResults(rs,1);
    rs = s.executeQuery("select vc from a where '' || CURRENT_DATE >= vc");
    assertEquals(1,JDBC.assertDrainResults(rs));
    assertStatementError("42818",s,"select TABLENAME FROM SYS.SYSTABLES WHERE UPPER(CURRENT_DATE)
= TABLENAME");
****************suggested test end*************



If no one has objection to this, I will go ahead and make this change tomorrow.

> 'CollationTest' fails with ' expected:<1> but was:<0>' in testPolishCollation(CollationTest.java:402)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3222
>                 URL: https://issues.apache.org/jira/browse/DERBY-3222
>             Project: Derby
>          Issue Type: Bug
>          Components: Regression Test Failure
>    Affects Versions: 10.3.1.5
>         Environment: OS: Solaris 10 8/07 s10x_u4wos_12b X86 64bits - SunOS 5.10 Generic_120012-14
> JVM: Sun Microsystems Inc. 1.6.0_01-b06
>            Reporter: Ole Solberg
>
> See http://dbtg.thresher.com/derby/test/10.3Branch/jvm1.6/testing/Limited/testSummary-597152.html
: sol.
> There was 1 failure:
> 1) testPolishCollation(org.apache.derbyTesting.functionTests.tests.lang.CollationTest)junit.framework.AssertionFailedError:
expected:<1> but was:<0>
> 	at org.apache.derbyTesting.functionTests.tests.lang.CollationTest.commonTestingForTerritoryBasedDB(CollationTest.java:1141)
> 	at org.apache.derbyTesting.functionTests.tests.lang.CollationTest.testPolishCollation(CollationTest.java:402)
> 	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.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:88)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)

-- 
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