Examples of WeblogEntrySet


Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

       
        return mesResponse;
    }
   
    protected WeblogEntrySet createSampleWeblog() throws IOException, JDOMException, UnexpectedRootElementException {
        WeblogEntrySet wes = getSampleWeblogEntrySet();
       
        String url = wes.getHref();
        String user = getUser();
        String password = getPassword();
       
        String body = wes.toString();
       
        HttpResponse res = post(url, user, password, body);
        assertEquals(201, res.getStatus());
       
        WeblogEntrySet wesResponse = null;
        InputStream responseBody = res.getResponseBody();
        if (responseBody != null) {
            wesResponse = new WeblogEntrySet(responseBody, getEndpointUrl());
        }
       
        return wesResponse;
    }
View Full Code Here

Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

        WeblogEntry we = getSampleWeblogEntry();
       
        HttpResponse res = get(we.getHref(), getUser(), getPassword());
        assertEquals(200, res.getStatus());
       
        WeblogEntrySet wesResponse = null;
        InputStream responseBody = res.getResponseBody();
        if (responseBody != null) {
            wesResponse = new WeblogEntrySet(responseBody, getEndpointUrl());
        }
       
        return wesResponse;
    }
View Full Code Here

Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

            assertEquals(200, res.getStatus());
        } else if (res.getStatus() != 200) {
            return null;
        }
       
        WeblogEntrySet wesResponse = null;
        InputStream responseBody = res.getResponseBody();
        if (responseBody != null) {
            wesResponse = new WeblogEntrySet(responseBody, getEndpointUrl());
        }
       
        return wesResponse;
    }
View Full Code Here

Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

    }
   
    protected static WeblogEntrySet updateSampleWeblogEntrySet(WeblogEntrySet wes) {
        WeblogEntry we = (WeblogEntry)wes.getEntries()[0];
        WeblogEntry weUpdated = updateSampleWeblogEntry(we);
        WeblogEntrySet wesUpdated = new WeblogEntrySet(getEndpointUrl());
        wesUpdated.setEntries(new WeblogEntry[] { weUpdated });
       
        return wesUpdated;
    }
View Full Code Here

Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

        return ues;
    }
   
    protected static WeblogEntrySet getSampleWeblogEntrySet() {
        WeblogEntry we = getSampleWeblogEntry();
        WeblogEntrySet wes = new WeblogEntrySet(getEndpointUrl());
        wes.setEntries(new WeblogEntry[] { we });
       
        return wes;
    }
View Full Code Here

Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

    public void testHandler() {
        try {
            createSampleUser();
           
            //create
            WeblogEntrySet wesCreate = createSampleWeblog();
            assertNotNull(wesCreate);
            assertNotNull(wesCreate.getEntries());
            assertEquals(wesCreate.getEntries().length, 1);
            assertEquals(wesCreate, getSampleWeblogEntrySet());
           
            //get
            WeblogEntrySet wesFetch = fetchSampleWeblog();
            assertNotNull(wesFetch);
            assertNotNull(wesFetch.getEntries());
            assertEquals(wesFetch.getEntries().length, 1);
            assertEquals(wesFetch, wesCreate);
           
            //update
            WeblogEntrySet wesUpdate = updateSampleWeblog();
            assertNotNull(wesUpdate);
            assertNotNull(wesUpdate.getEntries());
            assertEquals(wesUpdate.getEntries().length, 1);
            assertEquals(wesUpdate, updateSampleWeblogEntrySet(getSampleWeblogEntrySet()));
           
            //delete
            WeblogEntrySet wesDelete = deleteSampleWeblog(true);
            assertNotNull(wesDelete);
            assertNotNull(wesCreate.getEntries());
            assertEquals(wesCreate.getEntries().length, 1);
            assertEquals(wesDelete, wesUpdate);
        } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

    }

    public void testEnabled() {
        try {
            createSampleUser();
            WeblogEntrySet wes = createSampleWeblog();
            WeblogEntry we = (WeblogEntry)wes.getEntries()[0];
            assertEquals(we.getEnabled(), Boolean.TRUE);
           
            wes = updateSampleWeblog();
            we = (WeblogEntry)wes.getEntries()[0];
            assertEquals(Boolean.FALSE, we.getEnabled());

            wes = fetchSampleWeblog();
            we = (WeblogEntry)wes.getEntries()[0];
            assertEquals(Boolean.FALSE, we.getEnabled());
        } catch (IOException ioe) {
            fail(ioe.getMessage());
            ioe.printStackTrace();
        } catch (JDOMException je) {
View Full Code Here

Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

    public void testHandler() {
        try {
            createSampleUser();
           
            //create
            WeblogEntrySet wesCreate = createSampleWeblog();
            assertNotNull(wesCreate);
            assertNotNull(wesCreate.getEntries());
            assertEquals(wesCreate.getEntries().length, 1);
            assertEquals(wesCreate, getSampleWeblogEntrySet());
           
            //get
            WeblogEntrySet wesFetch = fetchSampleWeblog();
            assertNotNull(wesFetch);
            assertNotNull(wesFetch.getEntries());
            assertEquals(wesFetch.getEntries().length, 1);
            assertEquals(wesFetch, wesCreate);
           
            //update
            WeblogEntrySet wesUpdate = updateSampleWeblog();
            assertNotNull(wesUpdate);
            assertNotNull(wesUpdate.getEntries());
            assertEquals(wesUpdate.getEntries().length, 1);
            assertEquals(wesUpdate, updateSampleWeblogEntrySet(getSampleWeblogEntrySet()));
           
            //delete
            WeblogEntrySet wesDelete = deleteSampleWeblog();
            assertNotNull(wesDelete);
            assertNotNull(wesCreate.getEntries());
            assertEquals(wesCreate.getEntries().length, 1);
            assertEquals(wesDelete, wesUpdate);
           
View Full Code Here

Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

    }
   
    protected static WeblogEntrySet updateSampleWeblogEntrySet(WeblogEntrySet wes) {
        WeblogEntry we = (WeblogEntry)wes.getEntries()[0];
        WeblogEntry weUpdated = updateSampleWeblogEntry(we);       
        WeblogEntrySet wesUpdated = new WeblogEntrySet(getEndpointUrl());
        wesUpdated.setEntries(new WeblogEntry[] { weUpdated });
       
        return wesUpdated;
    }
View Full Code Here

Examples of org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet

        return ues;
    }
   
    protected static WeblogEntrySet getSampleWeblogEntrySet() {
        WeblogEntry we = getSampleWeblogEntry();
        WeblogEntrySet wes = new WeblogEntrySet(getEndpointUrl());
        wes.setEntries(new WeblogEntry[] { we });
       
        return wes;
    }
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.