Package com.google.gdata.data

Examples of com.google.gdata.data.Entry


   

    @Test
    public void testClientPost() throws Exception {
        String blogEntryTitle = "titleByGoogleContactsTestcase";
        Entry newEntry = new Entry();
        newEntry.setTitle(new PlainTextConstruct(blogEntryTitle));
        newEntry.setContent(new PlainTextConstruct("contentByGoogleContactsTestCase"));
        Entry postedEntry = testService.clientPost(newEntry);       
        assertEquals(blogEntryTitle, postedEntry.getTitle().getPlainText());
    }
View Full Code Here


        //This test case might fail
        //because Google blogger service has limitation on new posts allowed everyday/every hour?
       
        System.out.println("testClientDelete");
        //We create a new post, and then delete it
        Entry newEntry = new Entry();
        newEntry.setTitle(new PlainTextConstruct("contactEntryShouldNotApear"));
        newEntry.setContent(new PlainTextConstruct("contactByBloggerShouldNotAppear"));
        Entry postedEntry = testService.clientPost(newEntry);
        Thread.sleep(300);
       
        System.out.println("ID: " + postedEntry.getId());
       
        int idStartPosition = postedEntry.getId().lastIndexOf("/");
        String postedEntryID = postedEntry.getId().substring(idStartPosition+1);       
        System.out.println("postedEntryID: " + postedEntryID );
       
        //Before deletion
        Entry entry00 = testService.clientGetEntry(postedEntryID);
        System.out.println("Before Deleteion: " + entry00.getId());
       
        //Delete this entry
        testService.clientDelete(postedEntryID);

        //Worked: this newly posted entry did not appear in the contact list
View Full Code Here

   
    @Test
    public void testClientGetEntry() throws Exception {
        String entryID = "photoid/5233468700029715874";
        Entry contactEntry = testService.clientGetEntry(entryID);
        System.out.println("Entry ID: " + contactEntry.getId());
        assertTrue(contactEntry.getId().endsWith(entryID));
        System.out.println("------------------------------------------------------------\n\n");
    }
View Full Code Here

    public void testClientPut() throws Exception
        String entryID = "photoid/5233468700029715874";         
        String newBlogEntryTitle = "updatedTitle:dog";
        testService.clientPut(entryID, newBlogEntryTitle);      //update the title
        Thread.sleep(300);           
        Entry updatedEntry = testService.clientGetEntry(entryID);        
        assertEquals(newBlogEntryTitle, updatedEntry.getTitle().getPlainText());
    }
View Full Code Here

            // purpose of testing, we just make them as static ids 
         
            // String id = "urn:uuid:customer-" + UUID.randomUUID().toString();

            String id = "urn:uuid:customer-" + String.valueOf(i);
            Entry entry = new Entry();
            entry.setId(id);
            entry.setTitle(new PlainTextConstruct("EntryTitle_" + i));
            entry.setContent(new PlainTextConstruct("content_" + i));
            entry.setUpdated(DateTime.now());
            // FIXME: The following three lines of code need to be fixed to add
            // HTML links.           
            Link link = new Link();
            link.setType(Link.Type.ATOM);
            link.setRel(Link.Rel.ENTRY_EDIT);
            link.setHref("http://localhost:8084/customer"  + "/" +  id);       
            entry.getLinks().add(link);
           
            // entry.addHtmlLink(""+id, "", "edit");
            // entry.addHtmlLink(""+id, "", "alternate");
            entries.put(id, entry);
            System.out.println(">>> id=" + id);
View Full Code Here

   
   
    @Test
    public void testClientGetEntry() throws Exception {
        String entryID = "1c76lcl70jg9r0fm18rcbneea8";
        Entry blogEntry = testService.clientGetEntry(entryID);
        System.out.println("Entry ID: " + blogEntry.getId());
        assertTrue(blogEntry.getId().endsWith(entryID));
        System.out.println("------------------------------------------------------------\n\n");
    }
View Full Code Here

    public void testClientPut() throws Exception
        String entryID = "1c76lcl70jg9r0fm18rcbneea8";         
        String newBlogEntryTitle = "updatedTitleByGoogleContactsConsumerTestCase";
        testService.clientPut(entryID, newBlogEntryTitle);      //update the title
        Thread.sleep(300);           
        Entry updatedEntry = testService.clientGetEntry(entryID);        
        assertEquals(newBlogEntryTitle, updatedEntry.getTitle().getPlainText());
    }
View Full Code Here

   

    @Test
    public void testClientPost() throws Exception {
        String blogEntryTitle = "titleByGoogleCalendarTestcase";
        Entry newEntry = new Entry();
        newEntry.setTitle(new PlainTextConstruct(blogEntryTitle));
        newEntry.setContent(new PlainTextConstruct("contentByGoogleCalendarTestCase"));
        Entry postedEntry = testService.clientPost(newEntry);       
        assertEquals(blogEntryTitle, postedEntry.getTitle().getPlainText());
    }
View Full Code Here

        //This test case might fail
        //because Google blogger service has limitation on new posts allowed everyday/every hour?
       
        System.out.println("testClientDelete");
        //We create a new post, and then delete it
        Entry newEntry = new Entry();
        newEntry.setTitle(new PlainTextConstruct("calendarEntryShouldNotApear"));
        newEntry.setContent(new PlainTextConstruct("calendarByBloggerShouldNotAppear"));
        Entry postedEntry = testService.clientPost(newEntry);
        Thread.sleep(300);
       
        System.out.println("ID: " + postedEntry.getId());
       
        int idStartPosition = postedEntry.getId().lastIndexOf("/");
        String postedEntryID = postedEntry.getId().substring(idStartPosition+1);       
        System.out.println("postedEntryID: " + postedEntryID );
       
        //Before deletion
        Entry entry00 = testService.clientGetEntry(postedEntryID);
        System.out.println("Before Deleteion: " + entry00.getId());
       
        //Delete this entry
        testService.clientDelete(postedEntryID);

        //Worked: this newly posted entry did not appear in the contact list
View Full Code Here

    }

    @Test
    public void testClientGetEntry() throws Exception {
        String entryID = "urn:uuid:customer-0";
        Entry entry = testService.clientGetEntry(entryID);
        System.out.println("entryID in testcase: " + entry.getId());
        assertEquals(entryID, entry.getId());
    }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.Entry

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.