On Mon, 2 Jul 2007, Mamta Satoor wrote:

        Thanks for a quick reply.

Hi Ravinder,

I have more of a junit framework question for this particular test(for
DERBY-1706) change. This test in the non-junit test framework made sure that
it was executed before anyone physically created the SESSION schema. The
reason for that is we wanted to make sure that if the SESSION schema didn't
exist, we should be able to create a table inside that schema and that table
creation should automatically create SESSION schema. Just like what would
happen for any other user schema.

Now in the junit framework, there is no way (I could be wrong) to ensure
that this test fixture (ie the test for DERBY-1706) gets run before other
test fixtures and hence it is possible that the SESSION schema has already
been created by other test fixtures by the time this particular test fixture
gets called and hence we won't really be testing what the original test
intended to run.
I guess one way would be drop the SESSION schema at the
beginning of this test fixture and then run rest of the code in this test
fixture.
        I think we can't drop the SESSION schema unless it is empty.
we have to drop all the tables before drop the SESSION. more complication.!!

This will not test exactly what the original test was testing but
will be close enough.


Hope this helps,
Mamta


On 7/2/07, Ravinder Reddy <[EMAIL PROTECTED]> wrote:


       hi,
               I am converting lang/declareGlobalTempTableJava.java to
junit.
One of the tests test the Derby1706 which was handled by You.
plzz look at the fixture and let me know If I am going something wrong.

public void testDerby1706() throws SQLException {
               Statement s = createStatement();
               s.executeUpdate("set schema SESSION");
               try{
                       s.executeUpdate("create table DERBY1706(c11 int)");
               }
               catch(SQLException e){
                       assertFalse( "XJ001" == e.getSQLState());
               }
                s.executeUpdate("drop table DERBY1706");
                s.executeUpdate("set schema APP");
                s.executeUpdate("drop schema SESSION restrict");

          s.close();
       }

Thanks in Advance.

--

******************************************************************************

   Every problem that has been solved can be solved again in a better way

                                                  - Ravinder Reddy


*******************************************************************************


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.





--
******************************************************************************

   Every problem that has been solved can be solved again in a better way

                                                  - Ravinder Reddy

*******************************************************************************


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to