Package org.apache.tuscany.sca.binding.atom.collection

Examples of org.apache.tuscany.sca.binding.atom.collection.Collection


        Assert.assertNotNull(abdera);
    }

    @Test
    public void testAtomPut() throws Exception {
        Collection resourceCollection = testService.getCustomerCollection();
        Assert.assertNotNull(resourceCollection);

        Entry postEntry = postEntry("Sponge Bob");
        System.out.println(">>> post entry= " + postEntry.getTitle());

        Entry newEntry = resourceCollection.post(postEntry);
        System.out.println("<<< Entry posted for " + newEntry.getTitle());
        System.out.println(newEntry.getId());

        System.out.println(">>> put id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
        resourceCollection.put(newEntry.getId().toString(), updateEntry(newEntry, "James Bond"));
        System.out.println("<<< put id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
    }
View Full Code Here


        System.out.println("<<< put id=" + newEntry.getId() + " entry=" + newEntry.getTitle());
    }

    @Test
    public void testAtomPutException() throws Exception {
        Collection resourceCollection = testService.getCustomerCollection();
        Assert.assertNotNull(resourceCollection);

        Entry postEntry = postEntry("Sponge Bob");
        System.out.println(">>> post entry= " + postEntry.getTitle());

        // Generate random ID to pass as parameter in PUT() --
        String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
        try {
            // ID doesn't match with the existing IDs and NotFoundException is thrown
            resourceCollection.put(id, updateEntry(postEntry, "James Bond"));
        } catch (Exception e) {
            Assert.assertEquals("NotFoundException", e.getClass().getSimpleName());
        }
    }
View Full Code Here

     * the Collection interface.
     */
    @Test
    public void testThatCanGetFeedEntriesFromNonCollectionImplementation() {
        // Get the entries from the feed
        final Collection resourceCollection = testService.getCustomerCollection();
        Assert.assertNotNull(resourceCollection);
        final List<org.apache.abdera.model.Entry> entries = resourceCollection.getFeed().getEntries();

        // Validate the feed entries
        Assert.assertNotNull(entries);
        Assert.assertEquals(FEED_ENTRY_COUNT, entries.size());
        for (int i = 0; i < FEED_ENTRY_COUNT; i++) {
View Full Code Here

    @Test
    public void testThatFeedTitleSet() {
        final String expectedFeedTitle = "Atom binding Non Collection";

        // Get the title of the feed
        final Collection resourceCollection = testService.getCustomerCollection();
        Assert.assertNotNull(resourceCollection);
        final String feedTitle = resourceCollection.getFeed().getTitle();

        // Validate the title
        Assert.assertEquals(expectedFeedTitle, feedTitle);
    }
View Full Code Here

    @Test
    public void testThatFeedDescriptionSet() {
        final String expectedFeedDescription = "Feed used for unit testing";

        // Get the description of the feed
        final Collection resourceCollection = testService.getCustomerCollection();
        Assert.assertNotNull(resourceCollection);
        final String feedDescription = resourceCollection.getFeed().getSubtitle();

        // Validate the description
        Assert.assertEquals(expectedFeedDescription, feedDescription);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.atom.collection.Collection

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.