Examples of ImportConfig


Examples of org.cyclop.service.importer.model.ImportConfig

    byte[] fileContentBytes = upload.getBytes();
    LOG.debug("Importing file of {} bytes", fileContentBytes.length);

    ImportResultWriter result = new ImportResultWriter();

    ImportConfig config = createImportConfig(importOptions);
    ImportStats stats = getImporter(importOptions).importScript(new ByteArrayInputStream(fileContentBytes), result,
        config);

    resultModel.setObject(result.getResult());
View Full Code Here

Examples of org.cyclop.service.importer.model.ImportConfig

    updatePreferences(importOptions);
  }

  private ImportConfig createImportConfig(ImportOptions importOptions) {
    ImportConfig config = new ImportConfig();
    config.withContinueWithErrors(importOptions.isContinueWithErrors()).withUpdateHistory(
        importOptions.isContinueWithErrors());
    return config;
  }
View Full Code Here

Examples of org.cyclop.service.importer.model.ImportConfig

  @Test
  public void testBreakAfterError() throws Exception {

    try (InputStream fio = getClass().getResourceAsStream("/cql/testImportOrdered.cql")) {
      ResultConsumer rc = new ResultConsumer();
      ImportStats stats = importer.importScript(fio, rc, new ImportConfig().withContinueWithErrors(false)
          .withUpdateHistory(true));

      assertEquals(rc.toString(), 3, rc.size());
      assertEquals(rc.toString(), 1, rc.error.size());
      assertEquals(rc.toString(), 2, rc.success.size());
View Full Code Here

Examples of org.cyclop.service.importer.model.ImportConfig

  @Test
  public void testImportOrdered() throws Exception {
    try (InputStream fio = getClass().getResourceAsStream("/cql/testImportOrdered.cql")) {
      ResultConsumer rc = new ResultConsumer();
      ImportStats stats = importer.importScript(fio, rc, new ImportConfig().withContinueWithErrors(true)
          .withUpdateHistory(true));

      assertTrue(rc.toString(), rc.success.contains(new CqlQuery(CqlQueryType.UNKNOWN, "USE CqlDemo")));
      assertTrue(
          rc.toString(),
View Full Code Here

Examples of org.cyclop.service.importer.model.ImportConfig

  @Test
  public void testImportOneQueryPerLine() throws Exception {
    try (InputStream fio = getClass().getResourceAsStream("/cql/createDemoData.cql")) {
      ResultConsumer rc = new ResultConsumer();
      ImportStats stats = getImporter().importScript(fio, rc,
          new ImportConfig().withContinueWithErrors(true).withUpdateHistory(true));
      assertEquals(rc.toString(), 6, rc.size());
      assertEquals(rc.error.toString(), 0, rc.error.size());
      assertEquals(rc.toString(), 6, rc.success.size());
      assertEquals(rc.toString(), 0, stats.errorCount);
      assertEquals(rc.toString(), 6, stats.successCount);
View Full Code Here

Examples of org.cyclop.service.importer.model.ImportConfig

    assertFalse(queryService.execute(testCql).iterator().hasNext());

    try (InputStream fio = getClass().getResourceAsStream("/cql/testImportLineBreaks.cql")) {
      ResultConsumer rc = new ResultConsumer();
      ImportStats stats = getImporter().importScript(fio, rc,
          new ImportConfig().withContinueWithErrors(true).withUpdateHistory(true));
      assertEquals(7, rc.size());
      assertEquals(rc.error.toString(), 0, rc.error.size());
      assertEquals(7, rc.success.size());
      assertEquals(0, stats.errorCount);
      assertEquals(7, stats.successCount);
View Full Code Here

Examples of org.cyclop.service.importer.model.ImportConfig

  private void execImport(int scrNr, int amountError, long counterValue) throws Exception {
    String script = "/cql/testImportOneCol_" + scrNr + ".cql";
    try (InputStream fio = getClass().getResourceAsStream(script)) {
      ResultConsumer rc = new ResultConsumer();
      ImportStats stats = getImporter().importScript(fio, rc,
          new ImportConfig().withContinueWithErrors(true).withUpdateHistory(true));

      assertEquals(script + "- " + rc, amountError, rc.error.size());
      assertEquals(script + "- " + rc, scrNr - amountError, rc.success.size());
      assertEquals(script + "- " + rc, scrNr, rc.size());
      assertEquals(script + "- " + rc, amountError, stats.errorCount);
View Full Code Here

Examples of org.cyclop.service.importer.model.ImportConfig

  @Test
  public void testBreakAfterError() throws Exception {

    try (InputStream fio = getClass().getResourceAsStream("/cql/testImportOrdered.cql")) {
      ResultConsumer rc = new ResultConsumer();
      ImportStats stats = importer.importScript(fio, rc, new ImportConfig().withContinueWithErrors(false)
          .withUpdateHistory(true));

      assertTrue(rc.toString(), rc.size() < 100);
      assertTrue(rc.toString(), rc.error.size() < 4);
      assertTrue(rc.toString(), rc.success.size() < 100);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.