Package com.jcabi.github

Examples of com.jcabi.github.ReleaseAssets


     *
     * @throws Exception If a problem occurs.
     */
    @Test
    public void removesAsset() throws Exception {
        final ReleaseAssets assets = release().assets();
        final ReleaseAsset asset = assets.upload(
            "testRemove".getBytes(), "text/plain", "remove.txt"
        );
        MatcherAssert.assertThat(
            assets.iterate(),
            Matchers.<ReleaseAsset>iterableWithSize(1)
        );
        asset.remove();
        MatcherAssert.assertThat(
            assets.iterate(),
            Matchers.emptyIterable()
        );
    }
View Full Code Here


     *
     * @throws Exception If a problem occurs.
     */
    @Test
    public void removesSeveralAssets() throws Exception {
        final ReleaseAssets assets = release().assets();
        // @checkstyle MagicNumberCheck (1 line)
        final int limit = 3;
        final ReleaseAsset[] bodies = new ReleaseAsset[limit];
        for (int idx = 0; idx < limit; ++idx) {
            bodies[idx] = assets.upload(
                "testRemove".getBytes(), "text/plain", "remove.txt"
            );
        }
        MatcherAssert.assertThat(
            assets.iterate(),
            Matchers.<ReleaseAsset>iterableWithSize(limit)
        );
        for (int idx = 0; idx < limit; ++idx) {
            bodies[idx].remove();
        }
        MatcherAssert.assertThat(
            assets.iterate(),
            Matchers.emptyIterable()
        );
    }
View Full Code Here

     * @throws Exception if some problem inside
     */
    @Test
    public void fetchesRawRepresentation() throws Exception {
        final String fetch = "fetch";
        final ReleaseAssets assets = release().assets();
        final ReleaseAsset asset = assets.upload(
            fetch.getBytes(), "text/plain", "raw.txt"
        );
        final InputStream raw = new ByteArrayInputStream(
            DatatypeConverter.parseBase64Binary(
                fetch
View Full Code Here

     *
     * @throws Exception If a problem occurs.
     */
    @Test
    public void uploadsNewAsset() throws Exception {
        final ReleaseAssets assets = release().assets();
        final ReleaseAsset asset = assets.upload(
            "testUpload".getBytes(), "text/plain", "upload.txt"
        );
        MatcherAssert.assertThat(
            asset.number(),
            Matchers.is(1)
View Full Code Here

     *
     * @throws Exception If a problem occurs.
     */
    @Test
    public void fetchesSingleAsset() throws Exception {
        final ReleaseAssets assets = release().assets();
        final ReleaseAsset asset = assets.upload(
            "testGet".getBytes(), "text/plain", "get.txt"
        );
        MatcherAssert.assertThat(
            assets.get(asset.number()),
            Matchers.is(asset)
        );
    }
View Full Code Here

     *
     * @throws Exception If a problem occurs.
     */
    @Test
    public void iteratesAssets() throws Exception {
        final ReleaseAssets assets = release().assets();
        assets.upload(
            "testIterate".getBytes(), "text/plain", "iterate.txt"
        );
        MatcherAssert.assertThat(
            assets.iterate(),
            Matchers.not(Matchers.emptyIterable())
        );
    }
View Full Code Here

TOP

Related Classes of com.jcabi.github.ReleaseAssets

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.