db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dag.Wan...@Sun.COM (Dag H. Wanvik)
Subject Re: svn commit: r822641 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SequenceTest.java
Date Wed, 07 Oct 2009 23:13:53 GMT
ole@apache.org writes:

> -    public void testDuplicateCreationFailure() {
> +    public void testDuplicateCreationFailure() throws SQLException {
> +        Statement s = null;
>          try {
> -            Statement s = createStatement();
> +            s = createStatement();
>              s.executeUpdate("CREATE SEQUENCE mySeq1");
>              s.executeUpdate("CREATE SEQUENCE mySeq1");

Shouldn't there be a call to fail() here? If duplicate creation
succeeds, the test will silently pass. Not your patch, though, just
noticed reading it.

>          } catch (SQLException sqle) {
>              assertSQLState("X0Y68", sqle);
> +        }finally{
> +            s.executeUpdate("DROP SEQUENCE mySeq1"); // Drop the one created.
>          }
>      }

Mime
View raw message