Package org.springsource.loaded.test.infra

Examples of org.springsource.loaded.test.infra.IResult


        test.choiceGenerator = choiceGenerator;
        test.generative = true;

        try {
          test.setup();
          IResult r = null;
          if (predictResults) {
            try {
              r = test.test(); //run test in generative mode
            } catch (ResultException e) {
              r = e;
View Full Code Here


  @Override
  protected void runChild(GeneratedTest testPredicted, RunNotifier notifier) {
    notifier.fireTestStarted(describeChild(testPredicted));
    try {
      //Determine expected test result first:
      IResult expectedResult = testPredicted.getExpectedResult();
      if (expectedResult == null) {
        //Suite was not created with @PredictResult must predict it now
        GenerativeTest test = testClass.newInstance();

        //Inject a choice generator into the test!
        test.choiceGenerator = new SystematicChoiceGenerator(testPredicted.getChoices());
        test.generative = true;
        try {
          test.setup();
          expectedResult = test.test();
        } catch (ResultException e) {
          expectedResult = e;
        } finally {
          test.teardown();
        }
      }

      //Run the test again and verify
      GenerativeTest test = testClass.newInstance();

      //Inject a choice generator into the test!
      test.choiceGenerator = new SystematicChoiceGenerator(testPredicted.getChoices());
      test.generative = false;
      try {
        test.setup();
        Assert.assertEquals(testPredicted.getConfigDescription(), test.getConfigDescription());
        IResult actual;
        try {
          actual = test.test(); //run test in verify mode
        } catch (ResultException e) {
          actual = e;
        }
View Full Code Here

TOP

Related Classes of org.springsource.loaded.test.infra.IResult

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.