Package com.salesforce.dataloader.controller

Examples of com.salesforce.dataloader.controller.Controller


        argMap.put(Config.ENABLE_EXTRACT_STATUS_OUTPUT, Config.TRUE);
        argMap.put(Config.DAO_WRITE_BATCH_SIZE, String.valueOf(BATCH_SIZE));

        Date startTime = new Date();

        Controller theController = runProcessWithErrors(argMap, expectedSuccesses, expectedFailures);

        // verify there were no errors during extract
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("compare_date", startTime);
        verifyDbSuccess(theController, "queryAccount", expectedSuccesses);
View Full Code Here


        if (!operation.equals(OperationInfo.insert)) {
            taskId = createTask(nullFieldName, isDateField);
        }
        generateCsvWithNAField(nullFieldName, taskId);
        Map<String, String> argMap = getArgMap(operation);
        Controller controller;
        if (!getController().getConfig().getBoolean(Config.BULK_API_ENABLED) && isDateField) {
            controller = runProcess(argMap, true, null, 0, 0, 1, false);
            String errorFile = controller.getConfig().getStringRequired(Config.OUTPUT_ERROR);
            String errorMessage = getCsvFieldValue(errorFile, "ERROR");
            assertEquals("unexpected error message",
                    "Error converting value to correct data type: Failed to parse date: #N/A", errorMessage);
        } else {
            int numInsert = operation.equals(OperationInfo.insert) ? 1 : 0;
View Full Code Here

        }
    }

    private void runEmptyFieldInsertTest(String emtpyFieldName) throws Exception {
        generateCsvWithEmptyField(emtpyFieldName, null);
        Controller controller = runProcess(getArgMap(OperationInfo.insert), true, null, 1, 0, 0, false);
        String actualValue = getFieldValueAfterOperation(emtpyFieldName, controller);
        assertNull("Empty field values in CSV shouldn't have been inserted with values", actualValue);
    }
View Full Code Here

    }

    private void runEmptyFieldUpdateTest(String nullFieldName, boolean isDateField) throws Exception {
        String taskId = createTask(nullFieldName, isDateField);
        generateCsvWithEmptyField(nullFieldName, taskId);
        Controller controller = runProcess(getArgMap(OperationInfo.update), true, null, 0, 1, 0, false);
        String actualValue = getFieldValueAfterOperation(nullFieldName, controller);
        assertNotNull("Empty field values in CSV should have been ignored", actualValue);
    }
View Full Code Here

        int expectedUpdates = Math.max(0, numberOfInserts - iOffset);
        int expectedInserts = Math.max(0, NUM_DATA_ROWS - expectedUpdates - iOffset);
        // perform the upsert
        // verify no errors occurred
        final Controller ctl = runUpsertProcess(getRowOffsetTestConfig(offset, numberOfInserts), expectedInserts,
                expectedUpdates);

        // now check offset specs
        String rowOffset = ctl.getConfig().getString(Config.LOAD_ROW_TO_START_AT);

        if (rowOffset != null) {
            verifyOffsetFromInputAndOutputFiles(iOffset, ctl.getConfig());
        }
    }
View Full Code Here

            argMap.put(Config.ENABLE_LAST_RUN_OUTPUT, String.valueOf(enableOutput));
            argMap.put(Config.LAST_RUN_OUTPUT_DIR, outputDir);
        }

        this.baseName = baseProcessName;
        Controller theController = runProcess(argMap, 1);

        Config config = theController.getConfig();
        String lastRunFilePath = config.getLastRunFilename();
        File lastRunFile = new File(lastRunFilePath);
        try {
            String defaultFileName = baseProcessName + "_lastRun.properties";
            File expectedFile = useDefault ? new File(config.constructConfigFilePath(defaultFileName)) : new File(
View Full Code Here

import com.salesforce.dataloader.ui.UIUtils;

public class DataLoaderRunner {

    public static void main(String[] args) {
        Controller controller;
        try {
            controller = Controller.getInstance("ui", false);
            controller.createAndShowGUI();
        } catch (ControllerInitializationException e) {
            UIUtils.errorMessageBox(new Shell(new Display()), e);
        }
    }
View Full Code Here

        return true;
    }

    @Override
    protected FinishPage setPages() {
        Controller controller = getController();

        addPage(new DataSelectionPage(controller));

        hook_additionalLoadWizardPages();
View Full Code Here

        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

        final String descriptionValue = "Some Description";

        // insert the values
        Map<String, String> argumentMap = getTestConfig(OperationInfo.insert, getTestDataDir()
                + "/constantMappingInCsv.csv", false);
        Controller controller = runProcess(argumentMap, 2);
        for (SObject acct : retrieveAccounts(controller, "Description", "BillingState", "ShippingState")) {
            assertEquals("Incorrect value for billing state returned", stateValue, acct.getField("BillingState"));
            assertEquals("Incorrect value for shipping state returned", stateValue, acct.getField("ShippingState"));
            assertEquals("Incorrect value for description returned",
                    descriptionValue, acct.getField("Description"));
View Full Code Here

TOP

Related Classes of com.salesforce.dataloader.controller.Controller

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.