From: <jar...@us...> - 2012-06-02 06:19:02
|
Revision: 21748 http://jedit.svn.sourceforge.net/jedit/?rev=21748&view=rev Author: jarekczek Date: 2012-06-02 06:18:55 +0000 (Sat, 02 Jun 2012) Log Message: ----------- Added a test directory containing a macro to test the plugin under heavy stress. Added Paths: ----------- plugins/ErrorList/trunk/test/ plugins/ErrorList/trunk/test/macros/ plugins/ErrorList/trunk/test/macros/attack_error_list.bsh Added: plugins/ErrorList/trunk/test/macros/attack_error_list.bsh =================================================================== --- plugins/ErrorList/trunk/test/macros/attack_error_list.bsh (rev 0) +++ plugins/ErrorList/trunk/test/macros/attack_error_list.bsh 2012-06-02 06:18:55 UTC (rev 21748) @@ -0,0 +1,36 @@ +/** + * This macro creates 2 threads and they attack ErrorList with + * continous errors. Adjust n and watching the total number of errors + * allows for testing if all goes well. + */ + +import errorlist.*; + +n = 500; +es = new errorlist.DefaultErrorSource("macro"); +bar = new java.util.concurrent.CyclicBarrier(2); + +th1 = new Thread(new Runnable() { + public void run() { + i = 1; + while (i <= n) { + es.addError(errorlist.ErrorSource.WARNING, "c:\\temp", 1, 0,0, "hello "+i); + i++; + } + bar.await(); + es.registerErrorSource(es); +}}); + +th2 = new Thread(new Runnable() { + public void run() { + bar.await(); + i = n + 1; + while (i <= 2*n) { + es.addError(errorlist.ErrorSource.WARNING, "c:\\temp", 1, 0,0, "hello "+i); + i++; + } +}}); + +th1.start(); +th2.start(); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |