Package org.apache.wink.common.model.app

Examples of org.apache.wink.common.model.app.AppService


        // Map of all APP workspaces
        Map<String, AppWorkspace> workspaces = new LinkedHashMap<String, AppWorkspace>();

        // Create APP Service Document
        AppService appService = new AppService();

        // Get list of Workspaces
        List<AppWorkspace> workspaceList = appService.getWorkspace();

        // Loop over the list of Service Document Collections, and add each
        // to relevant Workspace
        for (ServiceDocumentCollectionData serviceDocumentCollection : collectionList) {
View Full Code Here


            RestClient restClient = new RestClient();

            // Create new Resource on given URL
            Resource resource = restClient.resource(defectsFeed);

            AppService service =
                resource.accept(MediaTypeUtils.ATOM_SERVICE_DOCUMENT).get(AppService.class);

            // Find workspace by it's title
            AppWorkspace workspace = service.getWorkspace(WORKSPACE_TITLE);

            // Find collection by title
            AppCollection collection = workspace.getCollection(COLLECTION_TITLE);
            String href = collection.getHref();
View Full Code Here

        // Map of all APP workspaces
        Map<String, AppWorkspace> workspaces = new LinkedHashMap<String, AppWorkspace>();

        // Create APP Service Document
        AppService appService = new AppService();

        // Get list of Workspaces
        List<AppWorkspace> workspaceList = appService.getWorkspace();

        // Loop over the list of Service Document Collections, and add each
        // to relevant Workspace
        for (ServiceDocumentCollectionData serviceDocumentCollection : collectionList) {
View Full Code Here

                                                        "/",
                                                        MediaTypeUtils.ATOM_SERVICE_DOCUMENT_TYPE);
        MockHttpServletResponse response = invoke(request);
        assertEquals("status", HttpStatus.OK.getCode(), response.getStatus());
        String contentString = response.getContentAsString();
        AppService service = AppService.unmarshal(new StringReader(contentString));
        AppWorkspace workspace = service.getWorkspace().get(0);
        AppCollection collection = workspace.getCollection().get(0);
        String href = collection.getHref();
        assertTrue("ipv6 URI: " + href, href.startsWith(http));
    }
View Full Code Here

                                                        MediaTypeUtils.ATOM_SERVICE_DOCUMENT_TYPE);
        request.setSecure(true);
        MockHttpServletResponse response = invoke(request);
        assertEquals("status", HttpStatus.OK.getCode(), response.getStatus());
        String contentString = response.getContentAsString();
        AppService service = AppService.unmarshal(new StringReader(contentString));
        AppWorkspace workspace = service.getWorkspace().get(0);
        AppCollection collection = workspace.getCollection().get(0);
        String href = collection.getHref();
        assertTrue("ipv6 URI: " + href, href.startsWith(https));
    }
View Full Code Here

    public void testAppMarshal() throws IOException {
        // Marshaller m = AtomJAXBUtils.createMarshaller(ctx, new
        // JAXBNamespacePrefixMapper(RestConstants.NAMESPACE_APP));
        Marshaller m = AppService.getMarshaller();

        AppService service = getService();
        JAXBElement<AppService> element = (new ObjectFactory()).createService(service);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        AtomJAXBUtils.marshal(m, element, null, os);
        assertEquals(SERVICE_DOCUMENT, os.toString());
    }
View Full Code Here

        Unmarshaller u = AppService.getUnmarshaller();
        Object element = AtomJAXBUtils.unmarshal(u, new StringReader(SERVICE_DOCUMENT));
        assertNotNull(element);
        assertTrue(element instanceof AppService);

        AppService service = (AppService)element;
        AppService expectedService = getService();

        assertService(expectedService, service);
    }
View Full Code Here

            assertEquals(expectedCategories.get(1).getHref(), categories.get(1).getHref());
        }
    }

    private AppService getService() {
        AppService service = new AppService();
        service.setLang("en-us");
        service.setBase("http://base/service");
        service.getOtherAttributes().put(new QName("anyAttirbService"), "anyAttribValueService");

        service.getWorkspace().add(getWorkspace("1"));
        service.getWorkspace().add(getWorkspace("2"));

        service.getWorkspace();
        return service;
    }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.model.app.AppService

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.