Package org.apache.derby.iapi.tools.i18n

Examples of org.apache.derby.iapi.tools.i18n.LocalizedOutput


    for (i = 0; i < max; i++)
    {
      String tester = "Tester" + (i+1);
      try
      {
        LocalizedOutput out = openFile(outputDir, tester + ".out");
        testers[i] = new mtTester(tester, suite, out, log);
      } catch (IOException e) {
        System.out.println("MultiTest ERROR: unable open output file "+e);
        return;
      }
    }

    long duration = execTesters(testers);

    log.println("");
    log.println("test ran "+duration+" ms");
    log.println("total memory is "+Runtime.getRuntime().totalMemory());
    log.println("free memory  is "+Runtime.getRuntime().freeMemory());
    // Delete the .out files for Testers that did not report errors.
    for (i = 0; i < max; i++)
    {
      if ( testers[i].noFailure() )
      {
        log.println("Deleting " + "Tester" + (i+1) + ".out" + "(" + outputDir + ")");
        File out = new File(outputDir, "Tester" + (i+1) + ".out");
        out.delete();
      }
      else
      {
        log.println("Tester" + (i+1) + " failed.");
      }
View Full Code Here


      throws IOException
  {
   
    java.io.File file = new java.io.File(dir, fileName);

    return new LocalizedOutput(new FileOutputStream(file));
  }
View Full Code Here

  ** Sequentially run scripts
  */
  private static void seqRunCases(Vector cases, String descr, String inputDir, String outputDir)
    throws FileNotFoundException, IOException, ijFatalException
  {
    LocalizedOutput  out;
    BufferedInputStream  in;
    mtTestCase    testCase;

    if (cases == null)
    {
View Full Code Here

  {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    LocalizedResource localLangUtil = langUtil;
    if (currentSession != null && currentSession.langUtil != null)
    localLangUtil = currentSession.langUtil;
    LocalizedOutput aw = localLangUtil.getNewOutput(bos);
    org.apache.derby.impl.tools.sysinfo.Main.getMainInfo(aw, false);
    return bos.toString();
  }
View Full Code Here

    String inputResourceName;
    boolean gotProp;
    Properties connAttributeDefaults = null;

    LocalizedResource langUtil = LocalizedResource.getInstance();
    LocalizedOutput out = langUtil.getNewOutput(System.out);

                // Validate arguments, check for --help.
    if (util.invalidArgs(args)) {
      util.Usage(out);
          return;
    }

    // load the property file if specified
    gotProp = util.getPropertyArg(args);

    // get the default connection attributes
    connAttributeDefaults = util.getConnAttributeArg(args);

    // readjust output to derby.ui.locale and derby.ui.codeset if
                // they were loaded from a property file.
    langUtil.init();
    out = langUtil.getNewOutput(System.out);
                main.initAppUI();

    file = util.getFileArg(args);
    inputResourceName = util.getInputResourceNameArg(args);
    if (inputResourceName != null) {
      in = langUtil.getNewInput(util.getResourceAsStream(inputResourceName));
      if (in == null) {
        out.println(langUtil.getTextMessage("IJ_IjErroResoNo",inputResourceName));
        return;
      }
    } else if (file == null) {
      in = langUtil.getNewInput(System.in);
                        out.flush();
              } else {
                    try {
                        in1 = new FileInputStream(file);
                        if (in1 != null) {
                            in1 = new BufferedInputStream(in1, utilMain.BUFFEREDFILESIZE);
                            in = langUtil.getNewInput(in1);
                        }
                    } catch (FileNotFoundException e) {
                        if (Boolean.getBoolean("ij.searchClassPath")) {
                            in = langUtil.getNewInput(util.getResourceAsStream(file));
                        }
                        if (in == null) {
                        out.println(langUtil.getTextMessage("IJ_IjErroFileNo",file));
                  return;
                        }
                    }
                }

    final String outFile = util.getSystemProperty("ij.outfile");
    if (outFile != null && outFile.length()>0) {
      LocalizedOutput oldOut = out;
      FileOutputStream fos = (FileOutputStream) AccessController.doPrivileged(new PrivilegedAction() {
        public Object run() {
          FileOutputStream out = null;
          try {
            out = new FileOutputStream(outFile);
          } catch (FileNotFoundException e) {
            out = null;
          }
          return out;
        }
      });
      out = langUtil.getNewOutput(fos);

      if (out == null)
         oldOut.println(langUtil.getTextMessage("IJ_IjErroUnabTo",outFile));
 
    }

    // the old property name is deprecated...
    String maxDisplayWidth = util.getSystemProperty("maximumDisplayWidth");
View Full Code Here

      OutputStream sqlOut,
      String outputEncoding,
          boolean loadSystemProperties)
      throws UnsupportedEncodingException
    {
        LocalizedOutput lo =
          outputEncoding == null ?
                  LocalizedResource.getInstance().
                    getNewOutput(sqlOut)
                 :
                  LocalizedResource.getInstance().
View Full Code Here

  {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    LocalizedResource localLangUtil = langUtil;
    if (currentSession != null && currentSession.langUtil != null)
    localLangUtil = currentSession.langUtil;
    LocalizedOutput aw = localLangUtil.getNewOutput(bos);
    org.apache.derby.impl.tools.sysinfo.Main.getMainInfo(aw, false);
    return bos.toString();
  }
View Full Code Here

  {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    LocalizedResource localLangUtil = langUtil;
    if (currentSession != null && currentSession.langUtil != null)
    localLangUtil = currentSession.langUtil;
    LocalizedOutput aw = localLangUtil.getNewOutput(bos);
    org.apache.derby.impl.tools.sysinfo.Main.getMainInfo(aw, false);
    return bos.toString();
  }
View Full Code Here

    for (i = 0; i < max; i++)
    {
      String tester = "Tester" + (i+1);
      try
      {
        LocalizedOutput out = openFile(outputDir, tester, ".out");
        testers[i] = new mtTester(tester, suite, out, log);
      } catch (IOException e) {
        System.out.println("MultiTest ERROR: unable open output file "+e);
        return;
      }
View Full Code Here

    }
    else
    {
      newFile = filePath;
   
    return new LocalizedOutput(new FileOutputStream(newFile));
  }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.tools.i18n.LocalizedOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.