Package ch.inftec.ju.util

Examples of ch.inftec.ju.util.XString


     */
    public ExportBuilder addTableSorted(String tableName, String... orderColumns) {
      if (orderColumns.length == 0) {
        return this.addTable(tableName);
      } else {
        XString xs = new XString();
        xs.addFormatted("SELECT * FROM %s ORDER BY ", tableName);
        for (String orderColumn : orderColumns) {
          xs.assertText("ORDER BY ", ", ");
          xs.addText(orderColumn);
        }
       
        return this.addTable(tableName, xs.toString());
      }
    }
View Full Code Here


            eb.writeToXmlFile(targetFilePath);
          }
        } else if (dataSetExport.exportType() == ExportType.MEMORY) {
          // Log XML
          if (logger.isInfoEnabled()) {
            XString xs = new XString(targetFileName);
            xs.newLine();
            xs.addLine(XmlUtils.toString(doc, true, true));
            logger.info(xs.toString());
          }
        } else {
          // Shouldn't happen
          throw new IllegalArgumentException("Unsupported export type: " + dataSetExport.exportType());
        }
View Full Code Here

      if (ite != null && ite.getTargetException() instanceof AssumptionViolatedException) {
        throw new AssumptionViolatedException(ite.getTargetException().getMessage());
      }

     
      XString causes = new XString("%s (Original Exception %s not serializable. Resolving chain"
          , t.getMessage()
          , t.getClass().getName());
         
      Throwable tChain = t;
      // Use cause (if possible / serializable)
      if (ite != null) {
        causes.addLineFormatted("%s [Target: %s]", ite.getMessage(), ite.getTargetException());
        if (ite.getTargetException() != null) {
          tChain = ite.getTargetException();
        }
      }
     
      Throwable cause = tChain.getCause();
      while (cause != null) {
        if (!IOUtil.isSerializable(cause)) {
                   
          causes.addLineFormatted("%s [Caused by: %s (non-serializable)", cause.getMessage(), cause.getClass().getName());
          cause = cause.getCause();
        } else {
          break;
        }
      }
     
      if (cause != null) {
        throw new JuRuntimeException(causes.toString(), cause);
      } else {
        causes.addLine("Check Server log for more details");
        throw new JuRuntimeException(causes.toString());
      }
    } else {
      throw t;
    }
  }
View Full Code Here

          eb.writeToXmlFile(targetFilePath);
        }
      } else {
        // Log XML
        if (logger.isInfoEnabled()) {
          XString xs = new XString(targetFileName);
          xs.newLine();
          xs.addLine(XmlUtils.toString(doc, true, true));
          logger.info(xs.toString());
        }
      }
     
      if (this.dataSetExportAnnos.size() > 1) {
        logger.warn("Ignoring DataSetExport annotations as only first is processed");
View Full Code Here

     */
    public ExportBuilder addTableSorted(String tableName, String... orderColumns) {
      if (orderColumns.length == 0) {
        return this.addTable(tableName);
      } else {
        XString xs = new XString();
        xs.addFormatted("SELECT * FROM %s ORDER BY ", tableName);
        for (String orderColumn : orderColumns) {
          xs.assertText("ORDER BY ", ", ");
          xs.addText(orderColumn);
        }
       
        return this.addTable(tableName, xs.toString());
      }
    }
View Full Code Here

      if (ite != null && ite.getTargetException() instanceof AssumptionViolatedException) {
        throw new AssumptionViolatedException(ite.getTargetException().getMessage());
      }

     
      XString causes = new XString("%s (Original Exception %s not serializable. Resolving chain"
          , t.getMessage()
          , t.getClass().getName());
         
      Throwable tChain = t;
      // Use cause (if possible / serializable)
      if (ite != null) {
        causes.addLineFormatted("%s [Target: %s]", ite.getMessage(), ite.getTargetException());
        if (ite.getTargetException() != null) {
          tChain = ite.getTargetException();
        }
      }
     
      Throwable cause = tChain.getCause();
      while (cause != null) {
        if (!IOUtil.isSerializable(cause)) {
                   
          causes.addLineFormatted("%s [Caused by: %s (non-serializable)", cause.getMessage(), cause.getClass().getName());
          cause = cause.getCause();
        } else {
          break;
        }
      }
     
      if (cause != null) {
        throw new JuRuntimeException(causes.toString(), cause);
      } else {
        causes.addLine("Check Server log for more details");
        throw new JuRuntimeException(causes.toString());
      }
    } else {
      throw t;
    }
  }
View Full Code Here

        ParentRunner<Runner> suiteRunner = (ParentRunner<Runner>) new AnnotatedBuilder(builder).runnerForClass(parentRunnerClass);

        this.parentRunner = new DataSetAwareParentRunner<>(suiteRunner);

        // Print dependency report
        XString xs = new XString();
        this.parentRunner.printDependencyReport(xs);
        logger.info("DataSetExport Suite dependency information: \n\n" + xs.toString());

        if (this.parentRunner.hasCyclicDependencies()) {
          throw new JuRuntimeException("Cyclic dependencies detected. Check log for details.");
        }
      } catch (JuRuntimeException ex) {
View Full Code Here

          eb.writeToXmlFile(targetFilePath.toString());
        }
      } else {
        // Log XML
        if (logger.isInfoEnabled()) {
          XString xs = new XString(targetFileName);
          xs.newLine();
          xs.addLine(XmlUtils.toString(doc, true, true));
          logger.info(xs.toString());
        }
      }
     
      if (this.dataSetExportAnnos.size() > 1) {
        logger.warn("Ignoring DataSetExport annotations as only first is processed");
View Full Code Here

            xmlOutput.writeToXmlFile(targetFilePath);
          }
        } else if (dataSetExport.exportType() == ExportType.MEMORY) {
          // Log XML
          if (logger.isInfoEnabled()) {
            XString xs = new XString(targetFileName);
            xs.newLine();
            xs.addLine(XmlUtils.toString(doc, true, true));
            logger.info(xs.toString());
          }
        } else {
          // Shouldn't happen
          throw new IllegalArgumentException("Unsupported export type: " + dataSetExport.exportType());
        }
View Full Code Here

     */
    public ExportBuilder addTableSorted(String tableName, String... orderColumns) {
      if (orderColumns.length == 0) {
        return this.addTable(tableName);
      } else {
        XString xs = new XString();
        xs.addFormatted("SELECT * FROM %s ORDER BY ", tableName);
        for (String orderColumn : orderColumns) {
          xs.assertText("ORDER BY ", ", ");
          xs.addText(orderColumn);
        }
       
        return this.addTable(tableName, xs.toString());
      }
    }
View Full Code Here

TOP

Related Classes of ch.inftec.ju.util.XString

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.