You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2004/01/22 13:11:43 UTC

cvs commit: db-ojb/src/test/org/apache/ojb/odmg UserTestCases.java

arminw      2004/01/22 04:11:43

  Modified:    src/test/org/apache/ojb/odmg UserTestCases.java
  Log:
  fix bug in test case
  
  Revision  Changes    Path
  1.12      +7 -5      db-ojb/src/test/org/apache/ojb/odmg/UserTestCases.java
  
  Index: UserTestCases.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/UserTestCases.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- UserTestCases.java	2 Jun 2003 15:18:00 -0000	1.11
  +++ UserTestCases.java	22 Jan 2004 12:11:43 -0000	1.12
  @@ -35,13 +35,15 @@
       {
           Implementation odmg = OJB.getInstance();
           Database db = odmg.newDatabase();
  +        String name = "testDuplicateInsertion_" + System.currentTimeMillis();
  +        String nameNew = "testDuplicateInsertion_New_" + System.currentTimeMillis();
   
           db.open(databaseName, Database.OPEN_READ_WRITE);
           //System.out.println("TEST: Database open");
   
           // insert an object with UNIQUE field NAME="A site"
           //System.out.println("TEST: Insert first object");
  -        newSite(odmg, "testDuplicateInsertion", 2, 1);
  +        newSite(odmg, name, 2, 1);
   
           // insert another object with UNIQUE field NAME="A site"
           // This should not create a new object (UNIQUE fields conflict) but
  @@ -49,7 +51,7 @@
           //System.out.println("TEST: Insert second object, should fail");
           try
           {
  -            newSite(odmg, "testDuplicateInsertion", 3, 2);
  +            newSite(odmg, name, 3, 2);
               assertTrue("We should get a SqlException 'Violation of unique index'", false);
           }
           catch (Exception e)
  @@ -58,12 +60,12 @@
               assertTrue(true);
           }
   
  -        // insert an object with UNIQUE field NAME="Another site"
  +        // insert an object with new UNIQUE field NAME
           // should always work
           //System.out.println("TEST: Insert third object");
           try
           {
  -            newSite(odmg, "Another site", 1, 2);
  +            newSite(odmg, nameNew, 1, 2);
               assertTrue(true);
           }
           catch (Exception e)
  
  
  

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