|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectco.cask.cdap.test.TestBase
public class TestBase
Base class to inherit from, provides testing functionality for Application.
To clean App Fabric state, you can use the clear() method.
| Field Summary | |
|---|---|
static org.junit.rules.TemporaryFolder |
tmpFolder
|
| Constructor Summary | |
|---|---|
TestBase()
|
|
| Method Summary | ||
|---|---|---|
protected
|
addDatasetInstance(String datasetTypeName,
String datasetInstanceName)
Adds an instance of dataset. |
|
protected
|
addDatasetInstance(String datasetTypeName,
String datasetInstanceName,
DatasetProperties props)
Adds an instance of a dataset. |
|
void |
afterTest()
By default after each test finished, it will stop all apps started during the test. |
|
void |
beforeTest()
|
|
protected void |
clear()
Clear the state of app fabric, by removing all deployed applications, Datasets and Streams. |
|
protected ApplicationManager |
deployApplication(Class<? extends Application> applicationClz,
File... bundleEmbeddedJars)
Deploys an Application. |
|
protected void |
deployDatasetModule(String moduleName,
Class<? extends DatasetModule> datasetModule)
Deploys DatasetModule. |
|
static void |
finish()
|
|
protected
|
getDataset(String datasetInstanceName)
Gets Dataset manager of Dataset instance of type |
|
protected Connection |
getQueryClient()
Returns a JDBC connection that allows to run SQL queries over data sets. |
|
static void |
init()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static org.junit.rules.TemporaryFolder tmpFolder
| Constructor Detail |
|---|
public TestBase()
| Method Detail |
|---|
protected ApplicationManager deployApplication(Class<? extends Application> applicationClz,
File... bundleEmbeddedJars)
Application. The Flows and
Procedures defined in the application
must be in the same or children package as the application.
applicationClz - The application class
ApplicationManager to manage the deployed application.protected void clear()
public void beforeTest()
throws Exception
Exception
public void afterTest()
throws Exception
Exception
public static void init()
throws Exception
Exceptionpublic static final void finish()
@Beta
protected final void deployDatasetModule(String moduleName,
Class<? extends DatasetModule> datasetModule)
throws Exception
DatasetModule.
moduleName - name of the moduledatasetModule - module class
Exception
@Beta
protected final <T extends DatasetAdmin> T addDatasetInstance(String datasetTypeName,
String datasetInstanceName,
DatasetProperties props)
throws Exception
T - type of the dataset admindatasetTypeName - dataset type namedatasetInstanceName - instance nameprops - properties
Exception
@Beta
protected final <T extends DatasetAdmin> T addDatasetInstance(String datasetTypeName,
String datasetInstanceName)
throws Exception
T - type of the dataset admindatasetTypeName - dataset type namedatasetInstanceName - instance name
Exception
@Beta
protected final <T> DataSetManager<T> getDataset(String datasetInstanceName)
throws Exception
datasetInstanceName - - instance name of dataset
Exception
@Beta
protected final Connection getQueryClient()
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||