Beispiel #1
0
  public int loadTransactionIntoOriginEntryTable(OriginEntryGroup group) {
    int numberOfInputData = Integer.valueOf(properties.getProperty("numOfData"));
    businessObjectService.save(group);

    int[] fieldLength = this.getFieldLength(fieldLengthList);
    List<LaborOriginEntry> originEntries =
        this.loadInputData(
            LaborOriginEntry.class, "data", numberOfInputData, keyFieldList, fieldLength);
    for (LaborOriginEntry entry : originEntries) {
      entry.setEntryGroupId(group.getId());
    }

    businessObjectService.save(originEntries);
    return originEntries.size();
  }
Beispiel #2
0
  public static void main(String[] args) {
    TestDataLoader testDataLoader = new TestDataLoader();
    Date groupCreationDate = new Date(0);

    if (ArrayUtils.isEmpty(args) || args.length < 2) {
      System.out.println("The program requires at least two arguments.");
      return;
    }

    if (!StringUtils.isAlphanumeric(args[0])) {
      System.out.println("The first argument should be a number.");
      return;
    }

    for (int numOfRound = Integer.parseInt(args[0]); numOfRound > 0; numOfRound--) {
      if (ArrayUtils.contains(args, "poster")) {
        OriginEntryGroup group = new OriginEntryGroup();
        group.setSourceCode(LABOR_SCRUBBER_VALID);
        group.setValid(true);
        group.setScrub(false);
        group.setProcess(true);
        group.setDate(groupCreationDate);
        int numOfData = testDataLoader.loadTransactionIntoOriginEntryTable(group);
        System.out.println("Number of Origin Entries for Poster = " + numOfData);
      }

      if (ArrayUtils.contains(args, "scrubber")) {
        OriginEntryGroup group = new OriginEntryGroup();
        group.setSourceCode(LABOR_BACKUP);
        group.setValid(true);
        group.setScrub(true);
        group.setProcess(true);
        group.setDate(groupCreationDate);
        int numOfData = testDataLoader.loadTransactionIntoOriginEntryTable(group);
        System.out.println("Number of Origin Entries for Scrubber = " + numOfData);
      }

      if (ArrayUtils.contains(args, "pending")) {
        int numOfData = testDataLoader.loadTransactionIntoPendingEntryTable();
        System.out.println("Number of Pending Entries = " + numOfData);
      }

      if (ArrayUtils.contains(args, "glentry")) {
        int numOfData = testDataLoader.loadTransactionIntoGLEntryTable();
        System.out.println("Number of Labor GL Entries = " + numOfData);
      }
    }
    System.exit(0);
  }