< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/stress/except/except003.java

Print this page




 218                                     "Memory allocation became slow; so, heap seems exhausted.");
 219                         break;
 220                     }
 221                 }
 222             }
 223         } catch (OutOfMemoryError oome) {
 224             if (TRACE_ON)
 225                 log[messages++] = "Heap seems exhausted - OutOfMemoryError thrown.";
 226 
 227             // Do not release any byte once allocated:
 228             pool[index++] = oome;
 229         }
 230 
 231         if (index > poolSize - 1000) {
 232             if (WARN_ON)
 233                 log[messages++] = "Warning: pool[] is full; so, checks would not be enough hard...";
 234         }
 235 
 236         // Check ClassNotFoundException (negative):
 237         try {
 238 //          trash = Class.forName("nsk.stress.except.except003.except003$Abra$Cadabra"); //   correct - should pass
 239             trash = Class.forName("nsk.stress.except.except003.except003.Abra.Cadabra"); // incorrect - should fail
 240             log[messages++] = "Failure: ClassNotFoundException (negative)";
 241             exitCode = 2;
 242         } catch (ClassNotFoundException cnfe) {
 243             if (TRACE_ON)
 244                 log[messages++] = "Success: ClassNotFoundException (negative)";
 245         } catch (OutOfMemoryError oome) {
 246             if (WARN_ON)
 247                 log[messages++] = "Skipped: ClassNotFoundException (negative)";
 248             skipped++;
 249         }
 250 
 251         return exitCode;
 252     }
 253 
 254     /**
 255      * Re-call to <code>run(args,out)</code>, and return JCK-like exit status.
 256      * (The stream <code>out</code> is assigned to <code>System.out</code> here.)
 257      *
 258      * @see #run(String[], PrintStream)
 259      */




 218                                     "Memory allocation became slow; so, heap seems exhausted.");
 219                         break;
 220                     }
 221                 }
 222             }
 223         } catch (OutOfMemoryError oome) {
 224             if (TRACE_ON)
 225                 log[messages++] = "Heap seems exhausted - OutOfMemoryError thrown.";
 226 
 227             // Do not release any byte once allocated:
 228             pool[index++] = oome;
 229         }
 230 
 231         if (index > poolSize - 1000) {
 232             if (WARN_ON)
 233                 log[messages++] = "Warning: pool[] is full; so, checks would not be enough hard...";
 234         }
 235 
 236         // Check ClassNotFoundException (negative):
 237         try {
 238 //          trash = Class.forName("nsk.stress.except.except003$Abra$Cadabra"); //   correct - should pass
 239             trash = Class.forName("nsk.stress.except.except003.Abra.Cadabra"); // incorrect - should fail
 240             log[messages++] = "Failure: ClassNotFoundException (negative)";
 241             exitCode = 2;
 242         } catch (ClassNotFoundException cnfe) {
 243             if (TRACE_ON)
 244                 log[messages++] = "Success: ClassNotFoundException (negative)";
 245         } catch (OutOfMemoryError oome) {
 246             if (WARN_ON)
 247                 log[messages++] = "Skipped: ClassNotFoundException (negative)";
 248             skipped++;
 249         }
 250 
 251         return exitCode;
 252     }
 253 
 254     /**
 255      * Re-call to <code>run(args,out)</code>, and return JCK-like exit status.
 256      * (The stream <code>out</code> is assigned to <code>System.out</code> here.)
 257      *
 258      * @see #run(String[], PrintStream)
 259      */


< prev index next >