Package org.jbehave.core.io.google

Examples of org.jbehave.core.io.google.LoadOdtFromGoogle


    @Given("Google feed $uri")
    public void givenGoogleFeed(String feedURI) {
        String username = System.getenv("GOOGLE_USER");
        String password = System.getenv("GOOGLE_PASSWORD");
        storyLoader = new LoadOdtFromGoogle(username, password, feedURI);
    }
View Full Code Here


        when(feed.getEntries()).thenReturn(asList(entry));
        when(entry.getContent()).thenReturn(content);
        when(content.getUri()).thenReturn("http://docs.google.com");
        when(mediaSource.getInputStream()).thenReturn(inputStream);

        LoadOdtFromGoogle storyLoader = new LoadOdtFromGoogle("user", "password", "https://docs.google.com/feeds/default/private/full/", service){

            @Override
            DocumentQuery documentQuery(String title) throws MalformedURLException {
                return query;
            }

            @Override
            protected MediaContent mediaContent(String url) {
                return content;
            }
           
        };
        InputStream resourceStream = storyLoader.resourceAsStream("a_story");
        MatcherAssert.assertThat(resourceStream, Matchers.equalTo(inputStream));
    }
View Full Code Here

        MatcherAssert.assertThat(resourceStream, Matchers.equalTo(inputStream));
    }

    @Test(expected = InvalidStoryResource.class)
    public void shouldNotLoadInexistingResourceFromGoogleDocs() {
        new LoadOdtFromGoogle("user", "password", "https://docs.google.com/feeds/default/private/full/", mock(DocsService.class)).loadStoryAsText("an_inexisting_story");
    }
View Full Code Here

        new LoadOdtFromGoogle("user", "password", "https://docs.google.com/feeds/default/private/full/", mock(DocsService.class)).loadStoryAsText("an_inexisting_story");
    }

    @Test(expected = GoogleAccessFailed.class)
    public void shouldNotAllowInvalidAccess() {
        new LoadOdtFromGoogle("DUMMY", "DUMMY");
    }
View Full Code Here

TOP

Related Classes of org.jbehave.core.io.google.LoadOdtFromGoogle

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.