Examples of TestProgressMontitor


Examples of com.salesforce.dataloader.TestProgressMontitor

    @Test
    public void testBatchSizes() throws Exception {
        writeCsv(validRow, validRow);
        argMap.put(Config.LOAD_BATCH_SIZE, "1");
        TestProgressMontitor monitor = runProcess(argMap, 2, 0, 0, false);
        assertEquals("Inserting 2 rows with batch size of 1 should have produced 2 batches", 2, monitor.getNumberBatchesTotal());
    }
View Full Code Here

Examples of com.salesforce.dataloader.TestProgressMontitor

    @Test
    public void testBatchSizesNotAlteredByInvalidData() throws Exception {
        writeCsv(validRow, invalidRow, validRow);
        argMap.put(Config.LOAD_BATCH_SIZE, "2");
        TestProgressMontitor monitor = runProcess(argMap, 2, 0, 1, false);
        assertEquals("Even though middle row contains invalid data only 1 batch should have been created", 1, monitor.getNumberBatchesTotal());
    }
View Full Code Here

Examples of com.salesforce.dataloader.TestProgressMontitor

    private TestProgressMontitor runProcess(Map<String, String> argMap, int numInserts, int numUpdates, int numFailures, boolean emptyId) throws Exception {
        final ProcessRunner runner = ProcessRunner.getInstance(argMap);
        runner.setName(baseName);

        final TestProgressMontitor monitor = new TestProgressMontitor();
        runner.run(monitor);
        Controller controller = runner.getController();

        assertTrue("Process failed", monitor.isSuccess());
        verifyFailureFile(controller, numFailures);
        verifySuccessFile(controller, numInserts, numUpdates, emptyId);
        return monitor;
    }
View Full Code Here

Examples of com.salesforce.dataloader.TestProgressMontitor

        if (argMap == null) argMap = getTestConfig();

        final ProcessRunner runner = ProcessRunner.getInstance(argMap);
        runner.setName(this.baseName);

        final TestProgressMontitor monitor = new TestProgressMontitor();
        runner.run(monitor);
        Controller controller = runner.getController();

        // verify process completed as expected
        if (expectProcessSuccess) {

            verifyInsertCorrectByContent(controller, createAttachmentFileMap(files), myAttachmentTemplateListener);
            // this should also still work
            assertTrue("Process failed: " + monitor.getMessage(), monitor.isSuccess());
            verifyFailureFile(controller, numFailures); // A.S.: To be removed and replaced
            verifySuccessFile(controller, numInserts, numUpdates, false);

        } else {
            assertFalse("Expected process to fail but got success: " + monitor.getMessage(), monitor.isSuccess());
        }
        // TODO: validate all messages, including nulls if those exist
        if (failMessage != null) {
            assertEquals("wrong message: ", failMessage, monitor.getMessage());
        }

        // return the controller used by the process so that the tests can validate success/error output files, etc
        return controller;
    }
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.