Package com.eviware.soapui.model.testsuite

Examples of com.eviware.soapui.model.testsuite.TestCaseRunContext


    objects.put( "context", context );
    objects.put( "log", SoapUI.ensureGroovyLog() );

    if( context instanceof TestCaseRunContext )
    {
      TestCaseRunContext testCaseRunContext = ( TestCaseRunContext )context;
      objects.put( "testRunner", testCaseRunContext.getTestRunner() );

      objects.put( "testStep", testCaseRunContext.getCurrentStep() );

      if( testCaseRunContext.getCurrentStep() instanceof SamplerTestStep )
      {
        objects.put( "request", ( ( SamplerTestStep )testCaseRunContext.getCurrentStep() ).getTestRequest() );
      }
    }

    if( context instanceof LoadTestRunContext )
    {
View Full Code Here


    @Test
    public void testProvider()
    {
        CurrentStepIndexProvider provider = new CurrentStepIndexProvider();

        TestCaseRunContext context = Mockito.mock(TestCaseRunContext.class);
        Mockito.when( context.getCurrentStepIndex()).thenReturn( 3 );

        Assert.assertEquals( "3", provider.getValue( context ));
    }
View Full Code Here

        StringToObjectMap objects = new StringToObjectMap(context.getProperties());
        objects.put("context", context);
        objects.put("log", SoapUI.ensureGroovyLog());

        if (context instanceof TestCaseRunContext) {
            TestCaseRunContext testCaseRunContext = (TestCaseRunContext) context;
            objects.put("testRunner", testCaseRunContext.getTestRunner());

            objects.put("testStep", testCaseRunContext.getCurrentStep());

            if (testCaseRunContext.getCurrentStep() instanceof SamplerTestStep) {
                objects.put("request", ((SamplerTestStep) testCaseRunContext.getCurrentStep()).getTestRequest());
            }
        }

        if (context instanceof LoadTestRunContext) {
            objects.put("loadTestRunner", ((LoadTestRunContext) context).getLoadTestRunner());
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent evt) {
    WsdlTestStepResult result = new WsdlTestStepResult(testStep);
    result.startTimer();
    TestCaseRunContext context = new MockTestRunContext(new MockTestRunner(testStep.getTestCase()), testStep);
    MockTestRunner runner = new MockTestRunner(testStep.getTestCase());
    try {
      testStep.run(runner, context);
    } finally {
      result.stopTimer();
View Full Code Here

  }
 
  @Test
  public void testRunBasic() throws Exception {
    WsdlTestCase mockTestCase = Mockito.mock(WsdlTestCase.class);
    TestCaseRunContext mockRunContext = Mockito.mock(TestCaseRunContext.class);
    Mockito.when(mockRunContext.expand("5 + 5")).thenReturn("5 + 5");
    TestStepConfig config = TestStepConfig.Factory.newInstance();
    config.setName("Math Evaluator");
    config.setType("expreval");
    XmlObject xmlObject = config.addNewConfig();
   
View Full Code Here

  }
 
  @Test
  public void testPrecision() throws Exception {
    WsdlTestCase mockTestCase = Mockito.mock(WsdlTestCase.class);
    TestCaseRunContext mockRunContext = Mockito.mock(TestCaseRunContext.class);
    Mockito.when(mockRunContext.expand("10 / 3")).thenReturn("10 / 3");
    TestStepConfig config = TestStepConfig.Factory.newInstance();
    config.setName("Math Evaluator");
    config.setType("expreval");
    XmlObject xmlObject = config.addNewConfig();
   
View Full Code Here

  }
 
  @Test
  public void testPrecisionWithoutPadding() throws Exception {
    WsdlTestCase mockTestCase = Mockito.mock(WsdlTestCase.class);
    TestCaseRunContext mockRunContext = Mockito.mock(TestCaseRunContext.class);
    Mockito.when(mockRunContext.expand("10 / 4")).thenReturn("10 / 4");
    TestStepConfig config = TestStepConfig.Factory.newInstance();
    config.setName("Math Evaluator");
    config.setType("expreval");
    XmlObject xmlObject = config.addNewConfig();
   
View Full Code Here

  }
 
  @Test
  public void testPrecisionWithPadding() throws Exception {
    WsdlTestCase mockTestCase = Mockito.mock(WsdlTestCase.class);
    TestCaseRunContext mockRunContext = Mockito.mock(TestCaseRunContext.class);
    Mockito.when(mockRunContext.expand("10 / 4")).thenReturn("10 / 4");
    TestStepConfig config = TestStepConfig.Factory.newInstance();
    config.setName("Math Evaluator");
    config.setType("expreval");
    XmlObject xmlObject = config.addNewConfig();
   
View Full Code Here

  }
 
  @Test
  public void testExpressionParsingError() throws Exception {
    WsdlTestCase mockTestCase = Mockito.mock(WsdlTestCase.class);
    TestCaseRunContext mockRunContext = Mockito.mock(TestCaseRunContext.class);
    Mockito.when(mockRunContext.expand("10 / now_when_the_saints")).thenReturn("10 / now_when_the_saints");
    TestStepConfig config = TestStepConfig.Factory.newInstance();
    config.setName("Math Evaluator");
    config.setType("expreval");
    XmlObject xmlObject = config.addNewConfig();
   
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.testsuite.TestCaseRunContext

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.