Package com.google.gdata.data

Examples of com.google.gdata.data.Entry


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


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

    //@Test
    @Ignore("TUSCANY-3006")
    public void testClientPost() throws Exception {
        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(300);       
        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 blogspot website,
View Full Code Here

    /*
     * Test method for 'org.apache.lucene.gdata.server.GDataResponse.sendResponse(BaseEntry, ExtensionProfile)'
     */
    public void testSendResponseBaseEntryExtensionProfile() throws IOException {
        try{
            Entry e = null;
            this.response.sendResponse(e, new ProvidedServiceStub());
            fail("Exception expected");
        }catch (IllegalArgumentException e) {
            //
        }
        try{
            Entry e = createEntry();
            this.response.sendResponse(e,null);
            fail("Exception expected");
        }catch (IllegalArgumentException e) {
            //
        }
View Full Code Here

        
        return feed;
    }
    /* create a simple entry */
    private Entry createEntry(){
        Entry e = new Entry();
        e.setTitle(new PlainTextConstruct("Test"));
        return e;
    }
View Full Code Here

     */
    public void testUpdateEntry() throws IOException, InterruptedException,
            ParseException, StorageException {
        testInsertEntry();
        for (int i = 1; i < this.count; i++) {
            Entry e = new Entry();
            e.setId("" + i);
            String insertString = "Hello world" + i;
            e.setTitle(new PlainTextConstruct(insertString));
            ServerBaseEntry en = getServerEntry(e);
            StorageEntryWrapper wrapper = new StorageEntryWrapper(en,
                    StorageOperation.UPDATE);
            this.modifier.updateEntry(wrapper);
            ReferenceCounter<StorageQuery> innerQuery = this.controller
                    .getStorageQuery();
            BaseEntry fetchedEntry = innerQuery.get().singleEntryQuery("" + i,
                    feedId, this.configurator);
            assertEquals("updated Title:", insertString, fetchedEntry
                    .getTitle().getPlainText());
        }
        // double updates
        for (int i = 1; i < this.count; i++) {
            Entry e = new Entry();
            e.setId("" + i);
            String insertString = "Hello world" + i;
            e.setTitle(new PlainTextConstruct(insertString));
            ServerBaseEntry en = getServerEntry(e);
            StorageEntryWrapper wrapper = new StorageEntryWrapper(en,
                    StorageOperation.UPDATE);
            this.modifier.updateEntry(wrapper);

            e = new Entry();
            e.setId("" + i);
            insertString = "Foo Bar" + i;
            e.setTitle(new PlainTextConstruct(insertString));
            en = getServerEntry(e);
            wrapper = new StorageEntryWrapper(en,
                    StorageOperation.UPDATE);
            this.modifier.updateEntry(wrapper);

View Full Code Here

       
    }

    public void testDeleteFeed() throws IOException, StorageException {
        testSaveFeed();
        Entry e = new Entry();
        e.setTitle(new PlainTextConstruct("hello world"));
        ServerBaseEntry entry = new ServerBaseEntry(e);
        entry.setFeedId(feedId);
        entry.setId("testme");
        entry.setServiceConfig(this.configurator);
        StorageEntryWrapper entryWrapper = new StorageEntryWrapper(entry,StorageOperation.INSERT);
View Full Code Here

            }

        }// end run

        private BaseEntry buildEntry(String id) {
            Entry e = new Entry();
            e.setId(id);
            e.setTitle(new PlainTextConstruct("Monty Python"));

            e.setPublished(DateTime.now());

            e.setUpdated(DateTime.now());
            String content = "1st soldier with a keen interest in birds: Who goes there?"
                    + "King Arthur: It is I, Arthur, son of Uther Pendragon, from the castle of Camelot. King of the Britons, defeater of the Saxons, Sovereign of all England!"
                    + "1st soldier with a keen interest in birds: Pull the other one!"
                    + "King Arthur: I am, and this is my trusty servant Patsy. We have ridden the length and breadth of the land in search of knights who will join me in my court at Camelot. I must speak with your lord and master."
                    + "1st soldier with a keen interest in birds: What? Ridden on a horse?"
                    + "King Arthur: Yes!";
            e.setContent(new TextContent(new PlainTextConstruct(content)));
            e.setSummary(new PlainTextConstruct("The Holy Grail"));
            return e;
        }
View Full Code Here

    String compareDelete = "D;"+FEEDID+";"+ENTRYID+";"+TIMESTAMP+";"+RecoverWriter.META_DATA_ENTRY_SEPARATOR+RecoverWriter.STORAGE_OPERATION_SEPARATOR+RecoverWriter.META_DATA_ENTRY_SEPARATOR;
    StorageEntryWrapper wrapper;
    StorageEntryWrapper deleteWrapper;

    protected void setUp() throws Exception {
        ServerBaseEntry entry = new ServerBaseEntry(new Entry());
        entry.setId(ENTRYID);
       
        entry.setUpdated(new DateTime(TIMESTAMP,0));
        entry.setTitle(new PlainTextConstruct(TITLE));
        ProvidedService config = new ProvidedServiceStub();
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.