Package org.apache.roller.weblogger.webservices.adminprotocol.sdk

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


        super(request);
        memberUri = new MemberURI(request);
    }
   
    protected EntrySet getEntrySet(Document d) throws UnexpectedRootElementException {
        return new MemberEntrySet(d, getUrlPrefix());
    }
View Full Code Here


        for (int i = 0; i < pds.length; i++) {
            WeblogPermission pd = pds[i];
            Entry entry = toMemberEntry(pd);
            entries.add(entry);
        }
        MemberEntrySet mes = new MemberEntrySet(getUrlPrefix());
        mes.setEntries((Entry[])entries.toArray(new Entry[0]));
       
        return mes;
    }
View Full Code Here

        try {
            createSampleUser();
            createSampleWeblog();
           
            // delete user-weblog permission
            MemberEntrySet mesDelete = deleteSampleMember(true);
            assertNotNull(mesDelete);
            assertEquals(0, mesDelete.getEntries().length);           
           
            //create
            MemberEntrySet mesCreate = createSampleMember();
            assertNotNull(mesCreate);
            assertNotNull(mesCreate.getEntries());
            assertEquals(mesCreate.getEntries().length, 1);
            assertEquals(mesCreate, getSampleMemberEntrySet());
           
            //get
            MemberEntrySet mesFetch = fetchSampleMember();
            assertNotNull(mesFetch);
            assertNotNull(mesFetch.getEntries());
            assertEquals(mesFetch.getEntries().length, 1);
            assertEquals(mesFetch, mesCreate);
           
            //update
            MemberEntrySet mesUpdate = updateSampleMember();
            assertNotNull(mesUpdate);
            assertNotNull(mesUpdate.getEntries());
            assertEquals(mesUpdate.getEntries().length, 1);
            assertEquals(mesUpdate, updateSampleMemberEntrySet(getSampleMemberEntrySet()));
           
            //delete
            mesDelete = deleteSampleMember(true);
            assertNotNull(mesDelete);
View Full Code Here

       
        return wesResponse;
    }
   
    protected MemberEntrySet updateSampleMember() throws IOException, JDOMException, UnexpectedRootElementException {
        MemberEntrySet mes = updateSampleMemberEntrySet(getSampleMemberEntrySet());
       
        String url = mes.getHref();
        String user = getUser();
        String password = getPassword();
       
        String body = mes.toString();
       
        HttpResponse res = put(url, user, password, body);
        assertEquals(200, res.getStatus());
       
        MemberEntrySet mesResponse = null;
        InputStream responseBody = res.getResponseBody();
        if (responseBody != null) {
            mesResponse = new MemberEntrySet(responseBody, getEndpointUrl());
        }
       
        return mesResponse;
    }
View Full Code Here

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

        MemberEntry me = getSampleMemberEntry();
       
        HttpResponse res = get(me.getHref(), getUser(), getPassword());
        assertEquals(200, res.getStatus());
       
        MemberEntrySet mesResponse = null;
        InputStream responseBody = res.getResponseBody();
        if (responseBody != null) {
            mesResponse = new MemberEntrySet(responseBody, getEndpointUrl());
        }
       
        return mesResponse;
    }
View Full Code Here

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

    }
   
    protected static MemberEntrySet updateSampleMemberEntrySet(MemberEntrySet mes) {
        MemberEntry me = (MemberEntry)mes.getEntries()[0];
        MemberEntry meUpdated = updateSampleMemberEntry(me);
        MemberEntrySet mesUpdated = new MemberEntrySet(getEndpointUrl());
        mesUpdated.setEntries(new MemberEntry[] { meUpdated });
       
        return mesUpdated;
    }
View Full Code Here

        return wes;
    }
   
    protected static MemberEntrySet getSampleMemberEntrySet() {
        MemberEntry me = getSampleMemberEntry();
        MemberEntrySet mes = new MemberEntrySet(getEndpointUrl());
        mes.setEntries(new MemberEntry[] { me });
       
        return mes;
    }
View Full Code Here

import org.apache.roller.weblogger.webservices.adminapi.AappTest;
import org.jdom.JDOMException;

public class MemberEntryTest extends AappTest {
    public void testEquals() {
        MemberEntrySet wes1 = getSampleMemberEntrySet();
        MemberEntrySet wes2 = getSampleMemberEntrySet();
       
        assertEquals(wes1, wes2);
    }
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.webservices.adminprotocol.sdk.MemberEntrySet

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.