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

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


        // to relevant Workspace
        for (ServiceDocumentCollectionData serviceDocumentCollection : collectionList) {

            // get workspace
            String workspaceName = serviceDocumentCollection.getWorkspace();
            AppWorkspace workspace = workspaces.get(workspaceName);

            if (workspace == null) {

                // Create new workspace
                workspace = new AppWorkspace();
                AtomText workspaceTitle = new AtomText();

                // Set workspace title
                workspaceTitle.setValue(workspaceName);
                workspace.setTitle(workspaceTitle);
                workspaces.put(workspaceName, workspace);

                // Add workspace to list of workspaces
                workspaceList.add(workspace);
            }
View Full Code Here


            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();

            // Get collection of defects
            Resource feedResource = restClient.resource(href);
            AtomFeed feed = feedResource.accept(MediaType.APPLICATION_ATOM_XML).get(AtomFeed.class);
View Full Code Here

        // to relevant Workspace
        for (ServiceDocumentCollectionData serviceDocumentCollection : collectionList) {

            // get workspace
            String workspaceName = serviceDocumentCollection.getWorkspace();
            AppWorkspace workspace = workspaces.get(workspaceName);

            if (workspace == null) {

                // Create new workspace
                workspace = new AppWorkspace();
                AtomText workspaceTitle = new AtomText();

                // Set workspace title
                workspaceTitle.setValue(workspaceName);
                workspace.setTitle(workspaceTitle);
                workspaces.put(workspaceName, workspace);

                // Add workspace to list of workspaces
                workspaceList.add(workspace);
            }
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

        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

    private void assertWorkspaces(List<AppWorkspace> expectedWorkspaces,
                                  List<AppWorkspace> workspaces) {
        assertEquals(expectedWorkspaces.size(), workspaces.size());
        for (int i = 0; i < expectedWorkspaces.size(); ++i) {
            AppWorkspace expectedWorkspace = expectedWorkspaces.get(i);
            AppWorkspace workspace = workspaces.get(i);

            assertEquals(expectedWorkspace.getLang(), workspace.getLang());
            assertEquals(expectedWorkspace.getBase(), workspace.getBase());
            assertEquals(expectedWorkspace.getTitle().getType(), workspace.getTitle().getType());
            assertEquals(expectedWorkspace.getTitle().getValue(), workspace.getTitle().getValue());
            assertEquals(expectedWorkspace.getOtherAttributes()
                .get(new QName("anyAttirbCollection")), workspace.getOtherAttributes()
                .get(new QName("anyAttirbCollection")));

            assertNotNull(workspace.getCollection("collection1"));
            assertNotNull(workspace.getCollection("collection2"));
            assertNull(workspace.getCollection("collection3"));

            assertCollections(expectedWorkspace.getCollection(), workspace.getCollection());
        }

    }
View Full Code Here

        service.getWorkspace();
        return service;
    }

    private AppWorkspace getWorkspace(String id) {
        AppWorkspace ws = new AppWorkspace();
        ws.setLang("en-us");
        ws.setBase("http://base/workspace");
        ws.setTitle(new AtomText("workspace" + id));
        ws.getOtherAttributes().put(new QName("anyAttirbWorkspace"), "anyAttribValueWorkspace");

        ws.getCollection().add(getCollection("1"));
        ws.getCollection().add(getCollection("2"));

        return ws;
    }
View Full Code Here

TOP

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

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.