Forum Discussion

stefaca's avatar
stefaca
New Contributor
11 years ago

JUnit & assertEquals status

hi there,

I have a small problem with Equals status in assert. I'm trying to compare expected status (FINISHED is expected status) with actual one (getStatus() method). if so test will be OK. but whats the problem? in code when I type Status.FINISHED field FINISHED throws message that "FINISHED cannot be resolved or is not a field".

here is a code:
import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.eviware.soapui.config.WorkspaceProjectConfig.Status;
import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.model.support.PropertiesMap;
import com.eviware.soapui.model.testsuite.TestCase;
import com.eviware.soapui.model.testsuite.TestRunner;
import com.eviware.soapui.model.testsuite.TestSuite;

public class IntegraconiServisi {

@Test
public void testCaseIstorijaPromenaPDVPerioda() throws Exception {

WsdlProject wsdlProject = new WsdlProject("/home/stefaca/workspace/JUnitTesting/xml/IntegracioniServisi-soapui-project_V2.xml");
TestSuite testSuite = wsdlProject.getTestSuiteByName("IntegracioniServisiTestSuite");
TestCase testCase = testSuite.getTestCaseByName("istorijaPromenaPDVPerioda TestCase");

TestRunner runner = testCase.run(new PropertiesMap(), false);
assertEquals(Status.FINISHED, runner.getStatus());
}

2 Replies

  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    stefaca
    instead of
    import com.eviware.soapui.config.WorkspaceProjectConfig.Status;

    use the following
    import com.eviware.soapui.model.testsuite.TestRunner.Status;


    I had the same issue because Eclipse imported the wrong package automatically