Examples of RestService


Examples of com.eviware.soapui.impl.rest.RestService

        return restMethod;
    }

    public RestResource makeRestResource() throws SoapUIException {
        String serviceName = "Interface_" + UUID.randomUUID().toString();
        RestService service = (RestService) project.addNewInterface(serviceName, RestServiceFactory.REST_TYPE);
        service.setName(serviceName);
        RestResource restResource = service.addNewResource("root", "/");
        return restResource;
    }
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestService

    public static RestResource makeRestResource() throws SoapUIException {
        return new RestResource(makeRestService(), RestResourceConfig.Factory.newInstance());
    }

    public static RestService makeRestService() throws SoapUIException {
        return new RestService(makeWsdlProject(), RestServiceConfig.Factory.newInstance());
    }
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestService

    public static RestResource resolveResource(RestTestRequestStep requestStep) {
        Map<String, RestResource> options = new LinkedHashMap<String, RestResource>();

        WsdlProject project = requestStep.getTestCase().getTestSuite().getProject();
        String serviceName = requestStep.getRequestStepConfig().getService();
        RestService service = (RestService) project.getInterfaceByName(serviceName);
        if (service != null) {
            addResources(service, options);
        } else {
            for (Interface iface : project.getInterfaceList()) {
                if (iface instanceof RestService) {
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestService

    }

    private DefinitionContext<?> getWadlContext(RestMessageExchange messageExchange, SubmitContext context)
            throws Exception {
        RestResource operation = messageExchange.getResource();
        RestService service = operation.getService();
        if (StringUtils.isNullOrEmpty(definition)
                || definition.equals(PathUtils.expandPath(service.getDefinition(), service, context))) {
            definitionContext = service.getWadlContext();
            definitionContext.loadIfNecessary();
        } else {
            String def = PathUtils.expandPath(definition, service, context);
            if (definitionContext == null || !def.equals(wsdlContextDef)) {
                definitionContext = new WadlDefinitionContext(def);
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestService

    private RestResource findRestResource() {
        Project project = ModelSupport.getModelItemProject(this);
        for (Interface iface : project.getInterfaceList()) {
            if (iface.getName().equals(getRequestStepConfig().getService()) && iface instanceof RestService) {
                RestService restService = (RestService) iface;
                // get all resources with the configured path
                for (RestResource resource : restService.getResourcesByFullPath(getRequestStepConfig().getResourcePath())) {
                    // try to find matching method
                    if (getWsdlModelItemByName(resource.getRestMethodList(), getRequestStepConfig().getMethodName()) != null) {
                        return resource;
                    }
                }
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestService

public class WadlImporterTest {

    @Test
    public void testWadlImporter() throws Exception {
        WsdlProject project = new WsdlProject();
        RestService service = (RestService) project.addNewInterface("REST Service", RestServiceFactory.REST_TYPE);
        WadlImporter importer = new WadlImporter(service);
        importer.initFromWadl(WadlImporter.class.getResource("/wadl/YahooSearch.wadl").toString());
        assertEquals(service.getName(), "REST Service");
        assertEquals(1, service.getResourceList().size());
        assertEquals(0, service.getResourceList().get(0).getChildResourceCount());
        assertEquals(1, service.getResourceList().get(0).getRestMethodCount());
    }
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestService

    }

    @Test
    public void importsWadl() throws Exception {
        WsdlProject project = new WsdlProject();
        RestService service = (RestService) project.addNewInterface("Test", RestServiceFactory.REST_TYPE);

        new WadlImporter(service).initFromWadl(RestUtilsTest.class.getResource("/wadl/YahooSearch.wadl").toURI().toString());

        assertEquals(1, service.getOperationCount());
        assertEquals("/NewsSearchService/V1/", service.getBasePath());

        RestResource resource = service.getOperationAt(0);

        assertEquals(1, resource.getPropertyCount());
        assertEquals("appid", resource.getPropertyAt(0).getName());
        assertNotNull(resource.getProperty("appid"));
        assertEquals(1, resource.getRequestCount());
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestService

    }

    @Test
    public void removesPropertyExpansions() throws Exception {
        WsdlProject project = new WsdlProject();
        RestService service = (RestService) project.addNewInterface("Test", RestServiceFactory.REST_TYPE);

        new WadlImporter(service).initFromWadl(RestUtilsTest.class.getResource(
                "/wadl/YahooSearchWithExpansions.wadl").toURI().toString());
        RestResource operation = (RestResource) service.getAllOperations()[0];
        RestMethod restMethod = operation.getRestMethodAt(0);
        RestRequest request = restMethod.getRequestAt(0);
        assertThat(request.getParams().getProperty("language").getDefaultValue(), is(anEmptyString()));
    }
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestService

                    if (new File(expandedUrl).exists()) {
                        expandedUrl = new File(expandedUrl).toURI().toURL().toString();
                    }

                    RestService result = importWadl(project, expandedUrl);
                    if (!url.equals(expandedUrl) && result != null) {
                        result.setWadlUrl(url);
                        if (dialog.getBooleanValue(Form.GENERATETESTSUITE)) {
                            new GenerateRestTestSuiteAction().perform(result, true);
                        }
                    }
                    break;
View Full Code Here

Examples of com.eviware.soapui.impl.rest.RestService

            dialog.getFormField(Form.GENERATETESTSUITE).setEnabled(false);
        }
    }

    private RestService importWadl(WsdlProject project, String url) {
        RestService restService = (RestService) project
                .addNewInterface(project.getName(), RestServiceFactory.REST_TYPE);
        UISupport.select(restService);
        try {
            new WadlImporter(restService).initFromWadl(url);
        } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.