Examples of UserEntrySet


Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

*/
public class UserHandlerTest extends HandlerBaseTest {
    public void testHandler() {
        try {
            //create
            UserEntrySet uesCreate = createSampleUser();
            assertNotNull(uesCreate);
            assertNotNull(uesCreate.getEntries());
            assertEquals(uesCreate.getEntries().length, 1);
            assertEquals(uesCreate, getSampleUserEntrySet());
           
            //get
            UserEntrySet uesFetch = fetchSampleUser();
            assertNotNull(uesFetch);
            assertNotNull(uesFetch.getEntries());
            assertEquals(uesFetch.getEntries().length, 1);
            assertEquals(uesFetch, uesCreate);
           
            //update
            UserEntrySet uesUpdate = updateSampleUser();
            assertNotNull(uesUpdate);
            assertNotNull(uesUpdate.getEntries());
            assertEquals(uesUpdate.getEntries().length, 1);
            assertEquals(uesUpdate, updateSampleUserEntrySet(getSampleUserEntrySet()));
           
            //delete
            UserEntrySet uesDelete = deleteSampleUser(true);
            assertNotNull(uesDelete);
            assertNotNull(uesCreate.getEntries());
            assertEquals(uesCreate.getEntries().length, 1);
            assertEquals(0, uesDelete.getEntries().length);
           
        } catch (IOException ioe) {
            ioe.printStackTrace();
            fail(ioe.getMessage());
        } catch (JDOMException je) {
View Full Code Here

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

        }
    }

    public void testEnabled() {
        try {
            UserEntrySet ues = createSampleUser();
            UserEntry ue = (UserEntry)ues.getEntries()[0];
            assertEquals(Boolean.TRUE, ue.getEnabled());
           
            ues = updateSampleUser();
            ue = (UserEntry)ues.getEntries()[0];
            assertEquals(Boolean.FALSE, ue.getEnabled());

            ues = fetchSampleUser();
            ue = (UserEntry)ues.getEntries()[0];
            assertEquals(Boolean.FALSE, ue.getEnabled());
           
        } catch (IOException ioe) {
            fail(ioe.getMessage());
            ioe.printStackTrace();
View Full Code Here

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

    public RollerUserHandler(HttpServletRequest request) throws HandlerException {
        super(request);
    }
   
    protected EntrySet getEntrySet(Document d) throws UnexpectedRootElementException {
        return new UserEntrySet(d, getUrlPrefix());
    }
View Full Code Here

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

   
    private UserEntrySet toUserEntrySet(User[] uds) {
        if (uds == null) {
            throw new NullPointerException("ERROR: Null user data not allowed");
        }
        UserEntrySet ues = new UserEntrySet(getUrlPrefix());
       
        List entries = new ArrayList();
        for (int i = 0; i < uds.length; i++) {
            User ud = uds[i];
            Entry entry = toUserEntry(ud);
            entries.add(entry);
        }
        ues.setEntries((Entry[])entries.toArray(new Entry[0]));
       
        return ues;
    }
View Full Code Here

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

            t.printStackTrace();
        }
    }
   
    protected UserEntrySet createSampleUser() throws IOException, JDOMException, UnexpectedRootElementException {
        UserEntrySet ues = getSampleUserEntrySet();
       
        String url = ues.getHref();
        String user = getUser();
        String password = getPassword();
       
        String body = ues.toString();
       
        HttpResponse res = post(url, user, password, body);
        assertEquals(201, res.getStatus());
       
        UserEntrySet uesResponse = null;
        InputStream responseBody = res.getResponseBody();
        if (responseBody != null) {
            uesResponse = new UserEntrySet(responseBody, getEndpointUrl());
        }
       
        return uesResponse;
    }
View Full Code Here

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

       
        return uesResponse;
    }
   
    protected UserEntrySet updateSampleUser() throws IOException, JDOMException, UnexpectedRootElementException {
        UserEntrySet ues = updateSampleUserEntrySet(getSampleUserEntrySet());
       
        String url = ues.getHref();
        String user = getUser();
        String password = getPassword();
       
        String body = ues.toString();
       
        HttpResponse res = put(url, user, password, body);
        assertEquals(200, res.getStatus());
       
        UserEntrySet uesResponse = null;
        InputStream responseBody = res.getResponseBody();
        if (responseBody != null) {
            uesResponse = new UserEntrySet(responseBody, getEndpointUrl());
        }
       
        return uesResponse;
    }
View Full Code Here

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

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

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

        UserEntry ue = getSampleUserEntry();
       
        HttpResponse res = get(ue.getHref(), getUser(), getPassword());
        assertEquals(200, res.getStatus());
       
        UserEntrySet uesResponse = null;
        InputStream responseBody = res.getResponseBody();
        if (responseBody != null) {
            uesResponse = new UserEntrySet(responseBody, getEndpointUrl());
        }
       
        return uesResponse;
    }
View Full Code Here

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

    }
   
    protected static UserEntrySet updateSampleUserEntrySet(UserEntrySet ues) {
        UserEntry ue = (UserEntry)ues.getEntries()[0];
        UserEntry ueUpdated = updateSampleUserEntry(ue);
        UserEntrySet uesUpdated = new UserEntrySet(getEndpointUrl());
        uesUpdated.setEntries(new UserEntry[] { ueUpdated });
       
        return uesUpdated;
    }
View Full Code Here

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntrySet

        return we;
    }
   
    protected static UserEntrySet getSampleUserEntrySet() {
        UserEntry ue = getSampleUserEntry();
        UserEntrySet ues = new UserEntrySet(getEndpointUrl());
        ues.setEntries(new UserEntry[] { ue });
       
        return ues;
    }
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.