Forum Stats

  • 3,851,946 Users
  • 2,264,053 Discussions
  • 7,904,914 Comments

Discussions

Testing a Batch Process using JUnit

(' ')sman
(' ')sman Member Posts: 7
edited Apr 14, 2015 10:45AM in WebLogic Portal

Hello,

I have written a java batch in CC&B. I want now to check it through Junit. I have created a test case for this which implements BatchJobTestCase. It generates couple of methods. I want to know how I will pass soft parameters to batch and how to inovke that batch.

Thanks,

Usman Ashraf

1560721

Answers

  • 1560721
    1560721 Member Posts: 1
    edited Apr 14, 2015 10:45AM

    For setting the soft parameters:

    One of the overridden Methods is setupRun. Mine looks like this:

    SubmissionParameters parameters = new SubmissionParameters();

    Properties properties = new Properties();

    properties.setProperty("PropertyName","PropertyValue");

    properties.setProperty("PropertyName","PropertyValue");

    properties.setProperty("PropertyName","PropertyValue");

    properties.setProperty("PropertyName","PropertyValue");

    parameters.setExtraParameters(properties);

    return parameters;

    I know that if you create a batch object and assign the result of this method to batch.setSubmissionParameters(result) the main thread of the batch can run.

    It looks like calling "submitBatchJob(parameters)" is supposed to run the whole thing, but i keep getting a null pointer exception  in com.splwg.base.support.batch.BatchJobExecuter.create

This discussion has been closed.