Search in sources :

Example 51 with TestFile

use of org.gradle.test.fixtures.file.TestFile in project gradle by gradle.

the class Resources method getResource.

/**
 * Locates the resource with the given name, relative to the current test class. Asserts that the resource exists.
 */
public TestFile getResource(String name) {
    assertNotNull(testClass);
    TestFile file = findResource(name);
    assertNotNull(String.format("Could not locate resource '%s' for test class %s.", name, testClass.getName()), file);
    return file;
}
Also used : TestFile(org.gradle.test.fixtures.file.TestFile)

Example 52 with TestFile

use of org.gradle.test.fixtures.file.TestFile in project gradle by gradle.

the class XcodebuildExecutor method withProject.

public XcodebuildExecutor withProject(XcodeProjectPackage xcodeProject) {
    TestFile projectDir = new TestFile(xcodeProject.getDir());
    projectDir.assertIsDir();
    return addArguments("-project", projectDir.getAbsolutePath());
}
Also used : TestFile(org.gradle.test.fixtures.file.TestFile)

Example 53 with TestFile

use of org.gradle.test.fixtures.file.TestFile in project gradle by gradle.

the class XcodebuildExecutor method withWorkspace.

public XcodebuildExecutor withWorkspace(XcodeWorkspacePackage xcodeWorkspace) {
    TestFile workspaceDir = new TestFile(xcodeWorkspace.getDir());
    workspaceDir.assertIsDir();
    return addArguments("-workspace", workspaceDir.getAbsolutePath());
}
Also used : TestFile(org.gradle.test.fixtures.file.TestFile)

Aggregations

TestFile (org.gradle.test.fixtures.file.TestFile)53 Test (org.junit.Test)33 AbstractIntegrationTest (org.gradle.integtests.fixtures.AbstractIntegrationTest)25 File (java.io.File)5 ExecutionFailure (org.gradle.integtests.fixtures.executer.ExecutionFailure)4 OutputStream (java.io.OutputStream)2 URI (java.net.URI)2 MaybeCompressedFileResource (org.gradle.api.internal.file.MaybeCompressedFileResource)2 LocalResourceAdapter (org.gradle.api.resources.internal.LocalResourceAdapter)2 SourceFile (org.gradle.integtests.fixtures.SourceFile)2 DefaultExecHandleBuilder (org.gradle.process.internal.DefaultExecHandleBuilder)2 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 UncheckedIOException (org.gradle.api.UncheckedIOException)1 ExecutionResult (org.gradle.integtests.fixtures.executer.ExecutionResult)1 IntegrationTestBuildContext (org.gradle.integtests.fixtures.executer.IntegrationTestBuildContext)1 AvailableToolChains (org.gradle.nativeplatform.fixtures.AvailableToolChains)1 ExecOutput (org.gradle.test.fixtures.file.ExecOutput)1