public abstract class AbstractTestBase extends Object
To write a unit test against this test base, simply extend it and add one or more regular test methods and retrieve the StreamExecutionEnvironment from the context:
@Test public void someTest() { ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); // test code env.execute(); } @Test public void anotherTest() { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); // test code env.execute(); }
Modifier and Type | Field and Description |
---|---|
static MiniClusterExtension |
MINI_CLUSTER_EXTENSION |
protected File |
temporaryFolder |
Constructor and Description |
---|
AbstractTestBase() |
Modifier and Type | Method and Description |
---|---|
void |
cleanupRunningJobs(MiniClusterClient clusterClient) |
File |
createAndRegisterTempFile(String fileName) |
String |
createTempFile(String fileName,
String contents) |
String |
getTempDirPath(String dirName) |
String |
getTempFilePath(String fileName) |
@RegisterExtension public static final MiniClusterExtension MINI_CLUSTER_EXTENSION
@TempDir protected File temporaryFolder
@AfterEach public final void cleanupRunningJobs(MiniClusterClient clusterClient) throws Exception
Exception
public String getTempDirPath(String dirName) throws IOException
IOException
public String getTempFilePath(String fileName) throws IOException
IOException
public String createTempFile(String fileName, String contents) throws IOException
IOException
public File createAndRegisterTempFile(String fileName) throws IOException
IOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.