/** * Build an application artifact from the specified class and then add it. * * @param artifactId the id of the artifact to add * @param appClass the application class to build the artifact from * @return an {@link ArtifactManager} to manage the added artifact */ protected static ArtifactManager addAppArtifact(ArtifactId artifactId, Class<?> appClass) throws Exception { return getTestManager().addAppArtifact(artifactId, appClass); }
protected ApplicationManager deployApplication(NamespaceId namespace, Class<? extends Application> applicationClz, File...bundleEmbeddedJars) throws IOException { return getTestManager().deployApplication(namespace, applicationClz, bundleEmbeddedJars); }
/** * Add the specified artifact. * * @param artifactId the id of the artifact to add * @param artifactFile the contents of the artifact. Must be a valid jar file containing apps or plugins * @throws Exception */ protected static ArtifactManager addArtifact(ArtifactId artifactId, File artifactFile) throws Exception { return getTestManager().addArtifact(artifactId, artifactFile); }
/** * Build an artifact from the specified plugin classes and then add it. The * jar created will include all classes in the same package as the give classes, plus any dependencies of the * given 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 specify both functionX and functionY when calling this method. * * @param artifactId the id of the artifact to add * @param parent the parent artifact it extends * @param pluginClass the plugin class to build the jar from * @param pluginClasses any additional plugin classes that should be included in the jar * @return {@link ArtifactManager} to manage the added plugin artifact */ protected static ArtifactManager addPluginArtifact(ArtifactId artifactId, ArtifactId parent, Class<?> pluginClass, Class<?>... pluginClasses) throws Exception { return getTestManager().addPluginArtifact(artifactId, parent, pluginClass, pluginClasses); }
/** * Add a new schedule to an existing application * * @param scheduleId the ID of the schedule to add * @param scheduleDetail the {@link ScheduleDetail} describing the new schedule. */ protected final void addSchedule(ScheduleId scheduleId, ScheduleDetail scheduleDetail) throws Exception { getTestManager().addSchedule(scheduleId, scheduleDetail); }
/** * Deletes an instance of dataset. * * @param datasetId the dataset to delete */ protected void deleteDatasetInstance(DatasetId datasetId) throws Exception { getTestManager().deleteDatasetInstance(datasetId); }
/** * Delete an existing schedule. * * @param scheduleId the ID of the schedule to be deleted */ protected final void deleteSchedule(ScheduleId scheduleId) throws Exception { getTestManager().deleteSchedule(scheduleId); }
/** * Deletes all applications in the specified namespace. * * @param namespaceId the namespace from which to delete all applications */ protected static void deleteAllApplications(NamespaceId namespaceId) throws Exception { getTestManager().deleteAllApplications(namespaceId); } }
/** * Clear the state of app fabric, by removing all deployed applications, Datasets and Streams. * This method could be called between two unit tests, to make them independent. */ protected static void clear() { try { getTestManager().clear(); } catch (Exception e) { // Unchecked exception to maintain compatibility until we remove this method throw Throwables.propagate(e); } }
/** * Adds an instance of a dataset. * * @param datasetId the dataset id * @param datasetTypeName dataset type name, like "table" or "fileset" * @param props properties * @param <T> type of the dataset admin * @return a DatasetAdmin to manage the dataset instance */ protected static <T extends DatasetAdmin> T addDatasetInstance(String datasetTypeName, DatasetId datasetId, DatasetProperties props) throws Exception { return getTestManager().addDatasetInstance(datasetTypeName, datasetId, props); }
/** * Build an artifact from the specified plugin classes and then add it. The * jar created will include all classes in the same package as the give classes, plus any dependencies of the * given 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 specify both functionX and functionY when calling this method. * * @param artifactId the id of the artifact to add * @param parentArtifacts the parent artifacts it extends * @param pluginClass the plugin class to build the jar from * @param pluginClasses any additional plugin classes that should be included in the jar * @return an {@link ArtifactManager} to manage the added plugin artifact */ protected static ArtifactManager addPluginArtifact(ArtifactId artifactId, Set<ArtifactRange> parentArtifacts, Class<?> pluginClass, Class<?>... pluginClasses) throws Exception { return getTestManager().addPluginArtifact(artifactId, parentArtifacts, pluginClass, pluginClasses); }
/** * Add a new schedule to an existing application * * @param scheduleId the ID of the schedule to add * @param scheduleDetail the {@link ScheduleDetail} describing the new schedule. */ protected final void addSchedule(ScheduleId scheduleId, ScheduleDetail scheduleDetail) throws Exception { getTestManager().addSchedule(scheduleId, scheduleDetail); }
/** * Deletes an instance of dataset. * * @param datasetId the dataset to delete */ protected void deleteDatasetInstance(DatasetId datasetId) throws Exception { getTestManager().deleteDatasetInstance(datasetId); }
/** * Delete an existing schedule. * * @param scheduleId the ID of the schedule to be deleted */ protected final void deleteSchedule(ScheduleId scheduleId) throws Exception { getTestManager().deleteSchedule(scheduleId); }
/** * Deletes all applications in the specified namespace. * * @param namespaceId the namespace from which to delete all applications */ protected static void deleteAllApplications(NamespaceId namespaceId) throws Exception { getTestManager().deleteAllApplications(namespaceId); } }
/** * Clear the state of app fabric, by removing all deployed applications, Datasets and Streams. * This method could be called between two unit tests, to make them independent. */ protected static void clear() { try { getTestManager().clear(); } catch (Exception e) { // Unchecked exception to maintain compatibility until we remove this method throw Throwables.propagate(e); } }
/** * Adds an instance of a dataset. * * @param datasetId the dataset id * @param datasetTypeName dataset type name, like "table" or "fileset" * @param props properties * @param <T> type of the dataset admin * @return a DatasetAdmin to manage the dataset instance */ protected static <T extends DatasetAdmin> T addDatasetInstance(String datasetTypeName, DatasetId datasetId, DatasetProperties props) throws Exception { return getTestManager().addDatasetInstance(datasetTypeName, datasetId, props); }
/** * Build an application artifact from the specified class and then add it. * * @param artifactId the id of the artifact to add * @param appClass the application class to build the artifact from * @return an {@link ArtifactManager} to manage the added artifact */ protected static ArtifactManager addAppArtifact(ArtifactId artifactId, Class<?> appClass) throws Exception { return getTestManager().addAppArtifact(artifactId, appClass); }
/** * Deploys an {@link Application} with version. The application artifact must already exist. * * @param appId the id of the application to create * @param appRequest the application create or update request * @return An {@link ApplicationManager} to manage the deployed application */ protected static ApplicationManager deployApplication(ApplicationId appId, AppRequest appRequest) throws Exception { ApplicationManager appManager = getTestManager().deployApplication(appId, appRequest); applicationManagers.add(appManager); return appManager; }
/** * Build an artifact from the specified plugin classes and then add it. The * jar created will include all classes in the same package as the give classes, plus any dependencies of the * given 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 specify both functionX and functionY when calling this method. * * @param artifactId the id of the artifact to add * @param parentArtifacts the parent artifacts it extends * @param pluginClass the plugin class to build the jar from * @param pluginClasses any additional plugin classes that should be included in the jar * @return an {@link ArtifactManager} to manage the added plugin artifact */ protected static ArtifactManager addPluginArtifact(ArtifactId artifactId, Set<ArtifactRange> parentArtifacts, Class<?> pluginClass, Class<?>... pluginClasses) throws Exception { return getTestManager().addPluginArtifact(artifactId, parentArtifacts, pluginClass, pluginClasses); }