Package com.google.gdata.data

Examples of com.google.gdata.data.Entry


        if (testService == null) {
            // no internet connection
            return;
        }
        String blogEntryTitle = "titleByBloogerTestcase000";
        Entry newEntry = new Entry();
        newEntry.setTitle(new PlainTextConstruct(blogEntryTitle));
        newEntry.setContent(new PlainTextConstruct("contentByBloggerTestCase000"));
        Entry postedEntry = testService.clientPost(newEntry);       
        Assert.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("blogEntryShouldNotApear"));
        newEntry.setContent(new PlainTextConstruct("contentByBloggerShouldNotAppear"));
        Entry postedEntry = testService.clientPost(newEntry);
        Thread.sleep(Constants.SLEEP_INTERVAL);       
        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);
View Full Code Here

        String entryID = "tag:blogger.com,1999:blog-4520949313432095990.post-973462497533349425";
        Entry entry = testService.clientGetEntry(entryID);
        System.out.println("Entry id: " + entry.getId());
        */
       
        Entry myEntry = new Entry();
        myEntry.setTitle(new PlainTextConstruct("titleByConsumer2"));
        myEntry.setContent(new PlainTextConstruct("contentByConsmer2"));
        testService.clientPost(myEntry);
       
        //System.out.println("#Entries(After post): "+ testService.clientGetFeed().getEntries().size());
       
        String entryID = "tag:blogger.com,1999:blog-4520949313432095990.post-973462497533349425";
        Entry entry = testService.clientGetEntry(entryID);
        //System.out.println("Entry id: " + entry.getId());

      
    }
View Full Code Here

        if (testService == null) {
            // no internet connection
            return;
        }
        String entryID = "12feeeb38ab87365";
        Entry contactEntry = testService.clientGetEntry(entryID);
        //System.out.println("Entry ID: " + contactEntry.getId());
        Assert.assertTrue(contactEntry.getId().endsWith(entryID));
    }
View Full Code Here

        }
        String entryID = "12feeeb38ab87365";         
        String newBlogEntryTitle = "updatedTitleByGoogleContactsConsumerTestCase";
        testService.clientPut(entryID, newBlogEntryTitle);      //update the title
        Thread.sleep(Constants.SLEEP_INTERVAL);           
        Entry updatedEntry = testService.clientGetEntry(entryID);        
        Assert.assertEquals(newBlogEntryTitle, updatedEntry.getTitle().getPlainText());
    }
View Full Code Here

        if (testService == null) {
            // no internet connection
            return;
        }
        String blogEntryTitle = "titleByGoogleContactsTestcase";
        Entry newEntry = new Entry();
        newEntry.setTitle(new PlainTextConstruct(blogEntryTitle));
        newEntry.setContent(new PlainTextConstruct("contentByGoogleContactsTestCase"));
        Entry postedEntry = testService.clientPost(newEntry);       
        Assert.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(Constants.SLEEP_INTERVAL);
       
        //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
        for (int i = 0; i < 5; i++) { // make 5 attempts because of timing issues
            try {
                Entry entry00 = testService.clientGetEntry(postedEntryID);
                //System.out.println("Before Deletion: " + entry00.getId());
                break// get was successful
            } catch (Exception e) {
                if (i < 4) {
                    System.out.println("Get failed, retrying...");
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

    Service alwaysOneEntryService = new Service() {
      public BaseFeed query(Query query, Class entryClass, DateTime since) {
        return new Feed() {
          public List getEntries() {
            List list = new LinkedList();
            Entry entry = new Entry();
            entry.setId("\u9762");
            entry.setUpdated(DateTime.now());
            entry.addHtmlLink("http://localhost", "en", "example");
            entry.setContent(
                TextConstruct.create(TextConstruct.Type.TEXT,
                    "\u9762" + System.currentTimeMillis(), null));
            list.add(entry);
            return list;
          }
View Full Code Here

    String id = "ID";
    String uri = "http://localhost";
    DateTime dt = DateTime.now();
    String contentNonce = "\u9762" + System.currentTimeMillis();
   
    Entry entry = new Entry();
    entry.setId(id);
    entry.setUpdated(dt);
    entry.addHtmlLink(uri, "en", "example");
    entry.setContent(
        TextConstruct.create(TextConstruct.Type.TEXT, contentNonce, null));
   
    Document doc = null;
    try {
      doc = GdConnector.makeDocument(entry);
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.