Examples of UpsertResult


Examples of com.socrata.model.UpsertResult

        // Ensures dataset is in known state (3 rows)
        File threeRowsFile = new File("src/test/resources/datasync_unit_test_three_rows.csv");
        Soda2Publisher.replaceNew(producer, ddl, UNITTEST_DATASET_ID, threeRowsFile, true);

        File deleteTwoRowsFile = new File("src/test/resources/datasync_unit_test_delete_two_rows_with_header.csv");
        UpsertResult result = Soda2Publisher.deleteRows(producer, ddl, UNITTEST_DATASET_ID, deleteTwoRowsFile, 0, true);

        TestCase.assertEquals(0, result.errorCount());
        TestCase.assertEquals(2, result.getRowsDeleted());
        TestCase.assertEquals(1, getTotalRows(UNITTEST_DATASET_ID));
    }
View Full Code Here

Examples of com.socrata.model.UpsertResult

        File twoRowsFile = new File("src/test/resources/datasync_unit_test_two_rows.csv");
        Soda2Publisher.replaceNew(producer, ddl, UNITTEST_DATASET_ID, twoRowsFile, true);

        File threeRowsFile = new File("src/test/resources/datasync_unit_test_three_rows_invalid_date.csv");
        int numRowsPerChunk = 0;
        UpsertResult result = Soda2Publisher.appendUpsert(producer, ddl, UNITTEST_DATASET_ID, threeRowsFile, numRowsPerChunk, true);

        TestCase.assertEquals(1, result.errorCount());
        TestCase.assertEquals(2, result.getRowsUpdated());
        TestCase.assertEquals(0, result.getRowsCreated());
        TestCase.assertEquals(2, getTotalRows(UNITTEST_DATASET_ID));
        TestCase.assertEquals("Unknown date format 'invalid_date'.", result.getErrors().get(0).getError());
        TestCase.assertEquals(2, result.getErrors().get(0).getIndex());
    }
View Full Code Here

Examples of com.socrata.model.UpsertResult

        File twoRowsFile = new File("src/test/resources/datasync_unit_test_two_rows.csv");
        Soda2Publisher.replaceNew(producer, ddl, UNITTEST_DATASET_ID, twoRowsFile, true);

        File threeRowsFile = new File("src/test/resources/datasync_unit_test_three_rows_multiple_invalid_dates.csv");
        int numRowsPerChunk = 2;
        UpsertResult result = Soda2Publisher.appendUpsert(producer, ddl, UNITTEST_DATASET_ID, threeRowsFile, numRowsPerChunk, true);

        TestCase.assertEquals(2, result.errorCount());
        TestCase.assertEquals(1, result.getRowsUpdated());
        TestCase.assertEquals(0, result.getRowsCreated());
        TestCase.assertEquals(2, getTotalRows(UNITTEST_DATASET_ID));
    }
View Full Code Here

Examples of com.socrata.model.UpsertResult

        // Ensures dataset is in known state (1 row)
        File oneRowFile = new File("src/test/resources/log_dataset_one_row.csv");
        Soda2Publisher.replaceNew(producer, ddl, UNITTEST_LOG_DATASET_ID, oneRowFile, true);

        IntegrationJob job = new IntegrationJob();
        UpsertResult result = new UpsertResult(1, 1, 1, new ArrayList<UpsertError>());
        SocrataConnectionInfo connectionInfo = new SocrataConnectionInfo(DOMAIN, USERNAME, PASSWORD, API_KEY);
        String logPublishingErrorMessage = job.addLogEntry(
                UNITTEST_LOG_DATASET_ID, connectionInfo, job, JobStatus.INVALID_DATASET_ID, result);

        TestCase.assertEquals(null, logPublishingErrorMessage);
View Full Code Here

Examples of com.socrata.model.UpsertResult

    }

    @Test
    public void testAddLogEntryInvalidLogDatasetId() {
        IntegrationJob job = new IntegrationJob();
        UpsertResult result = new UpsertResult(1, 1, 1, new ArrayList<UpsertError>());
        SocrataConnectionInfo connectionInfo = new SocrataConnectionInfo(DOMAIN, USERNAME, PASSWORD, API_KEY);
        String logPublishingErrorMessage = job.addLogEntry(
                "xxxx-xxxx", connectionInfo, job, JobStatus.SUCCESS, result);

        TestCase.assertEquals("Not found", logPublishingErrorMessage);
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.