Package org.gradle.api.file

Examples of org.gradle.api.file.FileCopyDetails.filter()


        context.checking(new Expectations() {{
            one(details).open();
            will(returnValue(new ByteArrayInputStream("content".getBytes())));
        }});

        mappedDetails.filter(HelperUtil.toClosure("{ 'PREFIX: ' + it } "));

        ByteArrayOutputStream outstr = new ByteArrayOutputStream();
        mappedDetails.copyTo(outstr);
        assertThat(new String(outstr.toByteArray()), equalTo("PREFIX: content"));
    }
View Full Code Here


            will(returnValue(false));
            one(details).getLastModified();
            will(returnValue(90L));
        }});

        mappedDetails.filter(HelperUtil.toClosure("{ 'PREFIX: ' + it } "));

        TestFile destDir = tmpDir.getDir().file("test.txt");
        mappedDetails.copyTo(destDir);
        destDir.assertContents(equalTo("PREFIX: content"));
    }
View Full Code Here

        context.checking(new Expectations() {{
            one(details).open();
            will(returnValue(new ByteArrayInputStream("content".getBytes())));
        }});

        mappedDetails.filter(HelperUtil.toClosure("{ 'PREFIX: ' + it } "));

        assertThat(mappedDetails.getSize(), equalTo(15L));
    }

    @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.