< prev index next >

test/java/util/Properties/ConcurrentLoadAndStoreXML.java

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /* @test
  25  * @bug 8005281
  26  * @summary Test that the Properties storeToXML and loadFromXML methods are
  27  *   thread safe

  28  */
  29 
  30 import java.io.*;
  31 import java.util.Properties;
  32 import java.util.Random;
  33 import java.util.concurrent.Callable;
  34 import java.util.concurrent.Executors;
  35 import java.util.concurrent.ExecutorService;
  36 import java.util.concurrent.Future;
  37 
  38 public class ConcurrentLoadAndStoreXML {
  39 
  40     static final Random RAND = new Random();
  41 
  42     static volatile boolean done;
  43 
  44     /**
  45      * Simple task that bashes on storeToXML and loadFromXML until the "done"
  46      * flag is set.
  47      */




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /* @test
  25  * @bug 8005281
  26  * @summary Test that the Properties storeToXML and loadFromXML methods are
  27  *   thread safe
  28  * @key randomness
  29  */
  30 
  31 import java.io.*;
  32 import java.util.Properties;
  33 import java.util.Random;
  34 import java.util.concurrent.Callable;
  35 import java.util.concurrent.Executors;
  36 import java.util.concurrent.ExecutorService;
  37 import java.util.concurrent.Future;
  38 
  39 public class ConcurrentLoadAndStoreXML {
  40 
  41     static final Random RAND = new Random();
  42 
  43     static volatile boolean done;
  44 
  45     /**
  46      * Simple task that bashes on storeToXML and loadFromXML until the "done"
  47      * flag is set.
  48      */


< prev index next >