< prev index next >

test/jdk/java/nio/file/Files/probeContentType/ParallelProbes.java

Print this page
rev 59105 : imported patch corelibs


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   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  * @summary Test probing content type simultaneously from multiple threads.
  26  * @requires (os.family == "linux") | (os.family == "solaris")
  27  * @build ParallelProbes SimpleFileTypeDetector
  28  * @run main/othervm ParallelProbes 10
  29  */
  30 
  31 import java.io.IOException;
  32 import java.nio.file.Files;
  33 import java.nio.file.Path;
  34 import java.nio.file.Paths;
  35 import java.util.ArrayList;
  36 
  37 public class ParallelProbes {
  38 
  39     private static final int REPEATS = 1000;
  40 
  41     private int numThreads = 0;
  42     private ArrayList<Thread> threads;
  43 
  44     public ParallelProbes(int numThreads) {
  45         System.out.println("Using <" + numThreads + "> threads.");
  46         this.numThreads = numThreads;




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   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  * @summary Test probing content type simultaneously from multiple threads.
  26  * @requires os.family == "linux"
  27  * @build ParallelProbes SimpleFileTypeDetector
  28  * @run main/othervm ParallelProbes 10
  29  */
  30 
  31 import java.io.IOException;
  32 import java.nio.file.Files;
  33 import java.nio.file.Path;
  34 import java.nio.file.Paths;
  35 import java.util.ArrayList;
  36 
  37 public class ParallelProbes {
  38 
  39     private static final int REPEATS = 1000;
  40 
  41     private int numThreads = 0;
  42     private ArrayList<Thread> threads;
  43 
  44     public ParallelProbes(int numThreads) {
  45         System.out.println("Using <" + numThreads + "> threads.");
  46         this.numThreads = numThreads;


< prev index next >