Пример #1
0
 static int atoi(String a) {
   int i = 0;
   try {
     i = Integer.parseInt(a);
   } catch (Exception ex) {
     ex.printStackTrace();
   }
   return i;
 }
Пример #2
0
  public static void main(String[] args) {
    int type = USE_NEWT;
    String tstName = "demos.es2.perftst.PerfVBOLoad"; // default

    for (int i = args.length - 1; i >= 0; i--) {
      if (args[i].equals("-awt")) {
        type |= USE_AWT;
      }
      if (args[i].equals("-test") && i + 1 < args.length) {
        tstName = args[i + 1];
      }
    }

    try {
      PerfModule pmod = (PerfModule) Class.forName(tstName).newInstance();
      new Perftst().run(type, pmod);
      System.exit(0);
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
    }
  }