vgritsenko    2003/12/18 06:45:51

  Modified:    java/tests/src/org/apache/xindice/core/filer
                        FilerTestCase.java
  Log:
  increase number of threads & iterations
  
  Revision  Changes    Path
  1.11      +15 -10    
xml-xindice/java/tests/src/org/apache/xindice/core/filer/FilerTestCase.java
  
  Index: FilerTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/tests/src/org/apache/xindice/core/filer/FilerTestCase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FilerTestCase.java        15 Dec 2003 14:43:52 -0000      1.10
  +++ FilerTestCase.java        18 Dec 2003 14:45:50 -0000      1.11
  @@ -283,11 +283,10 @@
       }
   
       public void testConcurrentInsert() throws Exception {
  -        // Start anew
           assertTrue(filer.getRecordCount() == 0);
   
  -        final int THREADS = 10;
  -        final int ITERATIONS = 30;
  +        final int THREADS = 30;
  +        final int ITERATIONS = 65;
   
           Thread[] threads = new Thread[THREADS];
           for (int i = 0; i < THREADS; i++) {
  @@ -303,21 +302,24 @@
                               e.printStackTrace();
                           }
                       }
  +                    // System.out.println(getName() + " done.");
                   }
               };
  -            threads[i].setName("Thread " + i);
  +            threads[i].setName("FilerTest" + i);
           }
   
  +        // Start all the threads at once
           for (int i = 0; i < THREADS; i++) {
               threads[i].start();
           }
  -
           Thread.sleep(1000);
   
           for (int i = 0; i < THREADS; i++) {
               threads[i].join();
           }
   
  +        filer.flush();
  +
           // Check results
           assertEquals(filer.getRecordCount(), THREADS * ITERATIONS);
           for (int i = 0; i < THREADS; i++) {
  @@ -325,10 +327,13 @@
                   Key key = new Key("T" + i + "I" + ii);
                   Value value = new Value("<test thread=\"" + i + "\" 
iteration=\"" + ii + "\"/>");
                   Record record = filer.readRecord(key);
  -                assertEquals(key, record.getKey());
  -                assertEquals(value, record.getValue());
  +                assertNotNull("Record with key '" + key + "' was not found",
  +                              record);
  +                assertEquals("Expected record with key '" + key + "', found 
record with key '" + record.getKey() + "'",
  +                             key, record.getKey());
  +                assertEquals("Expected record with value '" + value + "', 
found record with value '" + record.getValue() + "'",
  +                             value, record.getValue());
               }
           }
  -        System.out.println("Done");
       }
   }
  
  
  

Reply via email to