TestBase.@Deprecated public class ConfigurableTestBase extends Object
Application.
To clean App Fabric state, you can use the clear() method.TestBase| Modifier and Type | Field and Description |
|---|---|
static org.junit.rules.TemporaryFolder |
tmpFolder
Deprecated.
|
| Constructor and Description |
|---|
ConfigurableTestBase()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected <T extends DatasetAdmin> |
addDatasetInstance(co.cask.cdap.proto.Id.Namespace namespace,
String datasetTypeName,
String datasetInstanceName)
Deprecated.
Adds an instance of dataset.
|
protected static <T extends DatasetAdmin> |
addDatasetInstance(co.cask.cdap.proto.Id.Namespace namespace,
String datasetTypeName,
String datasetInstanceName,
DatasetProperties props)
Deprecated.
Adds an instance of a dataset.
|
protected <T extends DatasetAdmin> |
addDatasetInstance(String datasetTypeName,
String datasetInstanceName)
Deprecated.
Adds an instance of dataset.
|
protected static <T extends DatasetAdmin> |
addDatasetInstance(String datasetTypeName,
String datasetInstanceName,
DatasetProperties props)
Deprecated.
Adds an instance of a dataset.
|
protected static void |
addTemplatePluginJson(co.cask.cdap.proto.Id.ApplicationTemplate templateId,
String fileName,
String type,
String name,
String description,
String className,
PluginPropertyField... fields)
Deprecated.
Add a template plugin configuration file.
|
protected static void |
addTemplatePlugins(co.cask.cdap.proto.Id.ApplicationTemplate templateId,
String jarName,
Class<?> pluginClz,
Class<?>... classes)
Deprecated.
Adds a plugins jar usable by the given template.
|
void |
afterTest()
Deprecated.
By default after each test finished, it will stop all apps started during the test.
|
void |
beforeTest()
Deprecated.
|
protected static void |
clear()
Deprecated.
Clear the state of app fabric, by removing all deployed applications, Datasets and Streams.
|
protected static AdapterManager |
createAdapter(co.cask.cdap.proto.Id.Adapter adapterId,
co.cask.cdap.proto.AdapterConfig adapterConfig)
Deprecated.
Creates an adapter.
|
protected static void |
createNamespace(co.cask.cdap.proto.Id.Namespace namespace)
Deprecated.
Creates a Namespace.
|
protected static void |
deleteNamespace(co.cask.cdap.proto.Id.Namespace namespace)
Deprecated.
Deletes a Namespace.
|
protected static ApplicationManager |
deployApplication(Class<? extends Application> applicationClz,
Config appConfig,
File... bundleEmbeddedJars)
Deprecated.
|
protected static ApplicationManager |
deployApplication(Class<? extends Application> applicationClz,
File... bundleEmbeddedJars)
Deprecated.
Deploys an
Application. |
protected static ApplicationManager |
deployApplication(co.cask.cdap.proto.Id.Namespace namespace,
Class<? extends Application> applicationClz,
Config appConfig,
File... bundleEmbeddedJars)
Deprecated.
|
protected static ApplicationManager |
deployApplication(co.cask.cdap.proto.Id.Namespace namespace,
Class<? extends Application> applicationClz,
File... bundleEmbeddedJars)
Deprecated.
Deploys an
Application. |
protected static void |
deployDatasetModule(co.cask.cdap.proto.Id.Namespace namespace,
String moduleName,
Class<? extends DatasetModule> datasetModule)
Deprecated.
Deploys
DatasetModule. |
protected static void |
deployDatasetModule(String moduleName,
Class<? extends DatasetModule> datasetModule)
Deprecated.
Deploys
DatasetModule. |
protected static void |
deployTemplate(co.cask.cdap.proto.Id.Namespace namespace,
co.cask.cdap.proto.Id.ApplicationTemplate templateId,
Class<? extends ApplicationTemplate> templateClz,
String... exportPackages)
Deprecated.
Deploys an
ApplicationTemplate. |
static void |
finish()
Deprecated.
|
protected <T> DataSetManager<T> |
getDataset(co.cask.cdap.proto.Id.Namespace namespace,
String datasetInstanceName)
Deprecated.
Gets Dataset manager of Dataset instance of type
|
protected <T> DataSetManager<T> |
getDataset(String datasetInstanceName)
Deprecated.
Gets Dataset manager of Dataset instance of type
|
protected Connection |
getQueryClient()
Deprecated.
Returns a JDBC connection that allows to run SQL queries over data sets.
|
protected Connection |
getQueryClient(co.cask.cdap.proto.Id.Namespace namespace)
Deprecated.
Returns a JDBC connection that allows to run SQL queries over data sets.
|
protected StreamManager |
getStreamManager(co.cask.cdap.proto.Id.Namespace namespace,
String streamName)
Deprecated.
Returns a
StreamManager for the specified stream in the specified namespace |
protected StreamManager |
getStreamManager(String streamName)
Deprecated.
Returns a
StreamManager for the specified stream in the default namespace |
protected co.cask.tephra.TransactionManager |
getTxService()
Deprecated.
|
protected static void |
initTestBase(Map<String,String> additionalConfiguration)
Deprecated.
Use
TestConfiguration instead. |
public void afterTest()
throws Exception
Exception@Deprecated protected static void initTestBase(@Nullable Map<String,String> additionalConfiguration) throws Exception
TestConfiguration instead.Exceptionpublic static void finish()
throws co.cask.cdap.common.NotFoundException,
co.cask.cdap.common.NamespaceCannotBeDeletedException
co.cask.cdap.common.NotFoundExceptionco.cask.cdap.common.NamespaceCannotBeDeletedExceptionprotected static void createNamespace(co.cask.cdap.proto.Id.Namespace namespace)
throws Exception
namespace - the namespace to createExceptionprotected static void deleteNamespace(co.cask.cdap.proto.Id.Namespace namespace)
throws Exception
namespace - the namespace to createExceptionprotected static ApplicationManager deployApplication(co.cask.cdap.proto.Id.Namespace namespace, Class<? extends Application> applicationClz, File... bundleEmbeddedJars)
Application. The Flows and
other programs defined in the application must be in the same or children package as the application.applicationClz - The application classApplicationManager to manage the deployed application.protected static ApplicationManager deployApplication(co.cask.cdap.proto.Id.Namespace namespace, Class<? extends Application> applicationClz, Config appConfig, File... bundleEmbeddedJars)
protected static ApplicationManager deployApplication(Class<? extends Application> applicationClz, File... bundleEmbeddedJars)
Application. The Flows and
other programs defined in the application must be in the same or children package as the application.applicationClz - The application classApplicationManager to manage the deployed application.protected static ApplicationManager deployApplication(Class<? extends Application> applicationClz, Config appConfig, File... bundleEmbeddedJars)
protected static AdapterManager createAdapter(co.cask.cdap.proto.Id.Adapter adapterId, co.cask.cdap.proto.AdapterConfig adapterConfig) throws Exception
adapterId - The id of the adapter to createadapterConfig - The configuration for the adapterAdapterManager to manage the deployed adapter.Exception - if there was an exception deploying the adapter.protected static void deployTemplate(co.cask.cdap.proto.Id.Namespace namespace,
co.cask.cdap.proto.Id.ApplicationTemplate templateId,
Class<? extends ApplicationTemplate> templateClz,
String... exportPackages)
throws IOException
ApplicationTemplate.namespace - The namespace to deploy totemplateId - The id of the template. Must match the name set in
Application.configure(ApplicationConfigurer, ApplicationContext)templateClz - The template classexportPackages - The list of packages that should be visible to template plugins. For example,
if your plugins implement an interface com.company.api.myinterface that is in your template,
you will want to include 'com.company.api' in the list of export pacakges.IOExceptionprotected static void addTemplatePlugins(co.cask.cdap.proto.Id.ApplicationTemplate templateId,
String jarName,
Class<?> pluginClz,
Class<?>... classes)
throws IOException
deployTemplate(Id.Namespace, Id.ApplicationTemplate, Class, String...) is made. The
jar created will include all classes in the same package as the given plugin class, plus any dependencies of the
that class and given additional classes.
If another plugin in the same package as the given plugin requires a different set of dependent classes,
you must include both plugins. For example, suppose you have two plugins,
com.company.myapp.functions.functionX and com.company.myapp.function.functionY, with functionX having
one set of dependencies and functionY having another set of dependencies. If you only add functionX, functionY
will also be included in the created jar since it is in the same package. However, only functionX's dependencies
will be traced and added to the jar, so you will run into issues when the platform tries to register functionY.
In this scenario, you must be certain to include functionY in the list of classes when specifying functionX as the
plugin class.templateId - The id of the template to add the plugin forjarName - The name to use for the plugin jarpluginClz - A plugin class to add to the jar. Any other class that shares the same package will be included
in the jar.classes - Additional plugin classes whose dependencies should be added to the jar.IOExceptionprotected static void addTemplatePluginJson(co.cask.cdap.proto.Id.ApplicationTemplate templateId,
String fileName,
String type,
String name,
String description,
String className,
PluginPropertyField... fields)
throws IOException
templateId - the id of the template to add the plugin config forfileName - the name of the config file. The name should match the plugin jar file that it is for. For example,
if you added a plugin named hsql-jdbc-1.0.0.jar, the config file must be named hsql-jdbc-1.0.0.jsontype - the type of pluginname - the name of the plugindescription - the description for the pluginclassName - the class name of the pluginfields - the fields the plugin usesIOExceptionprotected static void clear()
protected static void deployDatasetModule(co.cask.cdap.proto.Id.Namespace namespace,
String moduleName,
Class<? extends DatasetModule> datasetModule)
throws Exception
DatasetModule.moduleName - name of the moduledatasetModule - module classExceptionprotected static void deployDatasetModule(String moduleName, Class<? extends DatasetModule> datasetModule) throws Exception
DatasetModule.moduleName - name of the moduledatasetModule - module classExceptionprotected static <T extends DatasetAdmin> T addDatasetInstance(co.cask.cdap.proto.Id.Namespace namespace, String datasetTypeName, String datasetInstanceName, DatasetProperties props) throws Exception
T - type of the dataset admindatasetTypeName - dataset type namedatasetInstanceName - instance nameprops - propertiesExceptionprotected static <T extends DatasetAdmin> T addDatasetInstance(String datasetTypeName, String datasetInstanceName, DatasetProperties props) throws Exception
T - type of the dataset admindatasetTypeName - dataset type namedatasetInstanceName - instance nameprops - propertiesExceptionprotected final <T extends DatasetAdmin> T addDatasetInstance(co.cask.cdap.proto.Id.Namespace namespace, String datasetTypeName, String datasetInstanceName) throws Exception
T - type of the dataset admindatasetTypeName - dataset type namedatasetInstanceName - instance nameExceptionprotected final <T extends DatasetAdmin> T addDatasetInstance(String datasetTypeName, String datasetInstanceName) throws Exception
T - type of the dataset admindatasetTypeName - dataset type namedatasetInstanceName - instance nameExceptionprotected final <T> DataSetManager<T> getDataset(co.cask.cdap.proto.Id.Namespace namespace, String datasetInstanceName) throws Exception
datasetInstanceName - - instance name of datasetExceptionprotected final <T> DataSetManager<T> getDataset(String datasetInstanceName) throws Exception
datasetInstanceName - - instance name of datasetExceptionprotected final Connection getQueryClient(co.cask.cdap.proto.Id.Namespace namespace) throws Exception
Exceptionprotected final Connection getQueryClient() throws Exception
Exceptionprotected final StreamManager getStreamManager(String streamName)
StreamManager for the specified stream in the default namespacestreamName - the specified streamStreamManager for the specified stream in the default namespaceprotected final StreamManager getStreamManager(co.cask.cdap.proto.Id.Namespace namespace, String streamName)
StreamManager for the specified stream in the specified namespacestreamName - the specified streamStreamManager for the specified stream in the specified namespaceprotected co.cask.tephra.TransactionManager getTxService()
Copyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.