use of org.apache.rya.api.client.Uninstall in project incubator-rya by apache.
the class MongoUninstallIT method uninstall_instanceDoesNotExists.
@Test(expected = InstanceDoesNotExistException.class)
public void uninstall_instanceDoesNotExists() throws MongoException, RyaClientException {
// Install an instance of Rya.
final String instanceName = "testInstance_";
// Uninstall the instance
final RyaClient ryaClient = MongoRyaClientFactory.build(getConnectionDetails(), getMongoClient());
final Uninstall uninstall = ryaClient.getUninstall();
uninstall.uninstall(instanceName);
}
use of org.apache.rya.api.client.Uninstall in project incubator-rya by apache.
the class RyaAdminCommandsTest method uninstall_no.
@Test
public void uninstall_no() throws Exception {
// Mock the object that performs the Uninstall command.
final Uninstall mockUninstall = mock(Uninstall.class);
// Mock a prompt that says the user does want to uninstall it.
final UninstallPrompt uninstallPrompt = mock(UninstallPrompt.class);
when(uninstallPrompt.promptAreYouSure(eq("test_instance"))).thenReturn(false);
final RyaClient mockClient = mock(RyaClient.class);
when(mockClient.getUninstall()).thenReturn(mockUninstall);
final SharedShellState state = new SharedShellState();
state.connectedToAccumulo(mock(AccumuloConnectionDetails.class), mockClient);
state.connectedToInstance("test_instance");
// Execute the command.
final RyaAdminCommands commands = new RyaAdminCommands(state, mock(InstallPrompt.class), mock(SparqlPrompt.class), uninstallPrompt);
commands.uninstall();
// Verify the request was forwarded to the client.
verify(mockUninstall, never()).uninstall(eq("test_instance"));
}
use of org.apache.rya.api.client.Uninstall in project incubator-rya by apache.
the class RyaAdminCommandsTest method uninstall_yes.
@Test
public void uninstall_yes() throws Exception {
// Mock the object that performs the Uninstall command.
final Uninstall mockUninstall = mock(Uninstall.class);
// Mock a prompt that says the user does want to uninstall it.
final UninstallPrompt uninstallPrompt = mock(UninstallPrompt.class);
when(uninstallPrompt.promptAreYouSure(eq("test_instance"))).thenReturn(true);
final RyaClient mockClient = mock(RyaClient.class);
when(mockClient.getUninstall()).thenReturn(mockUninstall);
final SharedShellState state = new SharedShellState();
state.connectedToAccumulo(mock(AccumuloConnectionDetails.class), mockClient);
state.connectedToInstance("test_instance");
// Execute the command.
final RyaAdminCommands commands = new RyaAdminCommands(state, mock(InstallPrompt.class), mock(SparqlPrompt.class), uninstallPrompt);
commands.uninstall();
// Verify the request was forwarded to the client.
verify(mockUninstall).uninstall(eq("test_instance"));
}
use of org.apache.rya.api.client.Uninstall in project incubator-rya by apache.
the class MongoUninstallIT method uninstall.
@Test
public void uninstall() throws MongoException, RyaClientException {
// Install an instance of Rya.
final String instanceName = "testInstance_";
final InstallConfiguration installConfig = InstallConfiguration.builder().setEnableTableHashPrefix(true).setEnableEntityCentricIndex(true).setEnableFreeTextIndex(true).setEnableTemporalIndex(true).setEnablePcjIndex(true).setEnableGeoIndex(true).setFluoPcjAppName("fluo_app_name").build();
final RyaClient ryaClient = MongoRyaClientFactory.build(getConnectionDetails(), getMongoClient());
final Install install = ryaClient.getInstall();
install.install(instanceName, installConfig);
// Show that the instance exists.
final InstanceExists instanceExists = ryaClient.getInstanceExists();
assertTrue(instanceExists.exists(instanceName));
// Uninstall the instance
final Uninstall uninstall = ryaClient.getUninstall();
uninstall.uninstall(instanceName);
// Check that the instance no longer exists.
assertFalse(instanceExists.exists(instanceName));
}
Aggregations