Java Code Examples for org.springframework.shell.core.JLineShellComponent

The following examples show how to use org.springframework.shell.core.JLineShellComponent. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: rya   Source File: AccumuloRyaConnectionCommandsIT.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void connectAccumulo() throws IOException {
    final MiniAccumuloCluster cluster = getCluster();
    final Bootstrap bootstrap = getTestBootstrap();
    final JLineShellComponent shell = getTestShell();

    // Mock the user entering the correct password.
    final ApplicationContext context = bootstrap.getApplicationContext();
    final PasswordPrompt mockPrompt = context.getBean( PasswordPrompt.class );
    when(mockPrompt.getPassword()).thenReturn("password".toCharArray());

    // Execute the connect command.
    final String cmd =
            RyaConnectionCommands.CONNECT_ACCUMULO_CMD + " " +
                    "--username root " +
                    "--instanceName " + cluster.getInstanceName() + " "+
                    "--zookeepers " + cluster.getZooKeepers();

    final CommandResult connectResult = shell.executeCommand(cmd);

    // Ensure the connection was successful.
    assertTrue( connectResult.isSuccess() );
}
 
Example 2
Source Project: rya   Source File: AccumuloRyaConnectionCommandsIT.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void connectAccumulo_wrongCredentials() throws IOException {
    final MiniAccumuloCluster cluster = getCluster();
    final Bootstrap bootstrap = getTestBootstrap();
    final JLineShellComponent shell = getTestShell();

    // Mock the user entering the wrong password.
    final ApplicationContext context = bootstrap.getApplicationContext();
    final PasswordPrompt mockPrompt = context.getBean( PasswordPrompt.class );
    when(mockPrompt.getPassword()).thenReturn("asjifo[ijwa".toCharArray());

    // Execute the command
    final String cmd =
            RyaConnectionCommands.CONNECT_ACCUMULO_CMD + " " +
                    "--username root " +
                    "--instanceName " + cluster.getInstanceName() + " "+
                    "--zookeepers " + cluster.getZooKeepers();

    final CommandResult connectResult = shell.executeCommand(cmd);

    // Ensure the command failed.
    assertFalse( connectResult.isSuccess() );
}
 
Example 3
Source Project: rya   Source File: AccumuloRyaConnectionCommandsIT.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void connectToInstance_instanceDoesNotExist() throws IOException {
    final MiniAccumuloCluster cluster = getCluster();
    final Bootstrap bootstrap = getTestBootstrap();
    final JLineShellComponent shell = getTestShell();

    // Mock the user entering the correct password.
    final ApplicationContext context = bootstrap.getApplicationContext();
    final PasswordPrompt mockPrompt = context.getBean( PasswordPrompt.class );
    when(mockPrompt.getPassword()).thenReturn("password".toCharArray());

    // Connect to the mini accumulo instance.
    String cmd =
            RyaConnectionCommands.CONNECT_ACCUMULO_CMD + " " +
                    "--username root " +
                    "--instanceName " + cluster.getInstanceName() + " "+
                    "--zookeepers " + cluster.getZooKeepers();
    shell.executeCommand(cmd);

    // Try to connect to a non-existing instance.
    cmd = RyaConnectionCommands.CONNECT_INSTANCE_CMD + " --instance doesNotExist";
    final CommandResult result = shell.executeCommand(cmd);
    assertFalse( result.isSuccess() );
}
 
Example 4
Source Project: rya   Source File: AccumuloRyaConnectionCommandsIT.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void disconnect() throws IOException {
    final MiniAccumuloCluster cluster = getCluster();
    final Bootstrap bootstrap = getTestBootstrap();
    final JLineShellComponent shell = getTestShell();

    // Mock the user entering the correct password.
    final ApplicationContext context = bootstrap.getApplicationContext();
    final PasswordPrompt mockPrompt = context.getBean( PasswordPrompt.class );
    when(mockPrompt.getPassword()).thenReturn("password".toCharArray());

    // Connect to the mini accumulo instance.
    final String cmd =
            RyaConnectionCommands.CONNECT_ACCUMULO_CMD + " " +
                    "--username root " +
                    "--instanceName " + cluster.getInstanceName() + " "+
                    "--zookeepers " + cluster.getZooKeepers();
    shell.executeCommand(cmd);

    // Disconnect from it.
    final CommandResult disconnectResult = shell.executeCommand( RyaConnectionCommands.DISCONNECT_COMMAND_NAME_CMD );
    assertTrue( disconnectResult.isSuccess() );
}
 
Example 5
Source Project: rya   Source File: MongoRyaShellIT.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void printConnectionDetails_connectedToMongo_noAuths() throws IOException {
    final JLineShellComponent shell = getTestShell();

    // Connect to the Mongo instance.
    final String cmd =
            RyaConnectionCommands.CONNECT_MONGO_CMD + " " +
                    "--hostname " + super.getMongoHostname() + " " +
                    "--port " + super.getMongoPort();
    shell.executeCommand(cmd);

    // Run the print connection details command.
    final CommandResult printResult = shell.executeCommand( RyaConnectionCommands.PRINT_CONNECTION_DETAILS_CMD );
    final String msg = (String) printResult.getResult();

    final String expected =
            "The shell is connected to an instance of MongoDB using the following parameters:\n" +
            "    Hostname: " + super.getMongoHostname() + "\n" +
            "    Port: " + super.getMongoPort() + "\n";
    assertEquals(expected, msg);
}
 
Example 6
Source Project: rya   Source File: MongoRyaShellIT.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void connectToInstance_instanceDoesNotExist() throws IOException {
    final JLineShellComponent shell = getTestShell();

    // Connect to the Mongo instance.
    String cmd =
            RyaConnectionCommands.CONNECT_MONGO_CMD + " " +
                    "--hostname " + super.getMongoHostname() + " " +
                    "--port " + super.getMongoPort();
    shell.executeCommand(cmd);

    // Try to connect to a non-existing instance.
    cmd = RyaConnectionCommands.CONNECT_INSTANCE_CMD + " --instance doesNotExist";
    final CommandResult result = shell.executeCommand(cmd);
    assertFalse( result.isSuccess() );
}
 
Example 7
Source Project: hdfs-shell   Source File: BootShim.java    License: Apache License 2.0 5 votes vote down vote up
public ExitShellRequest run() throws IllegalAccessException {
    sw.start();
    String[] commandsToExecuteAndThenQuit = commandLine.getShellCommandsToExecute();
    JLineShellComponent shell = this.ctx.getBean("shell", JLineShellComponent.class);
    ExitShellRequest exitShellRequest;
    if (null != commandsToExecuteAndThenQuit) {
        boolean successful = false;
        exitShellRequest = ExitShellRequest.FATAL_EXIT;
        for (String cmd : commandsToExecuteAndThenQuit) {
            successful = shell.executeCommand(cmd).isSuccess();
            if (!successful) {
                break;
            }
        }
        if (successful) {
            exitShellRequest = ExitShellRequest.NORMAL_EXIT;
        }
    } else {
        shell.start();
        shell.promptLoop();
        exitShellRequest = shell.getExitShellRequest();
        if (exitShellRequest == null) {
            exitShellRequest = ExitShellRequest.NORMAL_EXIT;
        }
        shell.waitForComplete();
    }
    sw.stop();
    if (shell.isDevelopmentMode()) {
        System.out.println("Total execution time: " + sw.getLastTaskTimeMillis() + " ms");
    }
    return exitShellRequest;
}
 
Example 8
Source Project: hdfs-shell   Source File: ContextCommandsTest.java    License: Apache License 2.0 5 votes vote down vote up
public void exists() throws Exception {
    Bootstrap bootstrap = new Bootstrap();

    JLineShellComponent shell = bootstrap.getJLineShellComponent();

    CommandResult cr = shell.executeCommand("exists /analytics");
    assertEquals(true, cr.isSuccess());
}
 
Example 9
@BeforeClass
public static void startUp() throws InterruptedException, IOException {
	if (applicationContext == null) {
		if (System.getProperty(SHUTDOWN_AFTER_RUN) != null) {
			shutdownAfterRun = Boolean.getBoolean(SHUTDOWN_AFTER_RUN);
		}

		SpringApplication application = new SpringApplicationBuilder(TestConfig.class).build();

		int randomPort = SocketUtils.findAvailableTcpPort();
		String dataFlowUri = String.format("--dataflow.uri=http://localhost:%s", serverPort);
		String dataSourceUrl = String.format("jdbc:h2:tcp://localhost:%s/mem:dataflow", randomPort);
		applicationContext = application.run(
				String.format("--server.port=%s", serverPort),
				dataFlowUri,
				"--spring.jmx.default-domain=" + System.currentTimeMillis(),
				"--spring.jmx.enabled=false",
				"--security.basic.enabled=false",
				"--spring.main.show_banner=false",
				"--spring.cloud.config.enabled=false",
				"--spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.session.SessionAutoConfiguration",
				"--spring.datasource.url=" + dataSourceUrl);

		JLineShellComponent shell = applicationContext.getBean(JLineShellComponent.class);
		if (!shell.isRunning()) {
			shell.start();
		}
		dataFlowShell = new DataFlowShell(shell);
	}
}
 
Example 10
@BeforeClass
public static void startUp() {
	if (applicationContext == null) {
		if (System.getProperty(SHUTDOWN_AFTER_RUN) != null) {
			shutdownAfterRun = Boolean.getBoolean(SHUTDOWN_AFTER_RUN);
		}

		SpringApplication application = new SpringApplicationBuilder(TestConfig.class).build();

		int randomPort = SocketUtils.findAvailableTcpPort();
		String dataFlowUri = String.format("--dataflow.uri=http://localhost:%s", serverPort);
		String dataSourceUrl = String.format("jdbc:h2:tcp://localhost:%s/mem:dataflow", randomPort);
		applicationContext = application.run(String.format("--server.port=%s", serverPort), dataFlowUri,
				"--spring.jmx.default-domain=" + System.currentTimeMillis(), "--spring.jmx.enabled=false",
				"--security.basic.enabled=false", "--spring.main.show_banner=false",
				"--spring.cloud.config.enabled=false",
				"--spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.session.SessionAutoConfiguration,org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryDeployerAutoConfiguration,org.springframework.cloud.deployer.spi.kubernetes.KubernetesAutoConfiguration",
				"--spring.datasource.url=" + dataSourceUrl,
				"--spring.cloud.dataflow.features.schedules-enabled=true");

		JLineShellComponent shell = applicationContext.getBean(JLineShellComponent.class);

		skipperClient = applicationContext.getBean(SkipperClient.class);

		if (!shell.isRunning()) {
			shell.start();
		}
		dataFlowShell = new DataFlowShell(shell);
	}
}
 
Example 11
public TaskScheduleCommandTemplate(JLineShellComponent dataFlowShell, ApplicationContext applicationContext) {
	this.dataFlowShell = dataFlowShell;

	ConfigurableListableBeanFactory beanFactory = ((AnnotationConfigServletWebServerApplicationContext) applicationContext)
			.getBeanFactory();
	schedule = Mockito.mock(SchedulerService.class);
	BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(TaskSchedulerController.class);
	builder.addConstructorArgValue(schedule);
	DefaultListableBeanFactory listableBeanFactory = (DefaultListableBeanFactory) beanFactory;
	listableBeanFactory.setAllowBeanDefinitionOverriding(true);
	listableBeanFactory.registerBeanDefinition("taskSchedulerController", builder.getBeanDefinition());
}
 
Example 12
Source Project: spring-data-dev-tools   Source File: BootShim.java    License: Apache License 2.0 5 votes vote down vote up
public ExitShellRequest run() {
	sw.start();
	String[] commandsToExecuteAndThenQuit = commandLine.getShellCommandsToExecute();
	JLineShellComponent shell = (JLineShellComponent) this.ctx.getBean("shell", JLineShellComponent.class);
	ExitShellRequest exitShellRequest;
	if (null != commandsToExecuteAndThenQuit) {
		boolean successful = false;
		exitShellRequest = ExitShellRequest.FATAL_EXIT;
		String[] arr$ = commandsToExecuteAndThenQuit;
		int len$ = commandsToExecuteAndThenQuit.length;

		for (int i$ = 0; i$ < len$; ++i$) {
			String cmd = arr$[i$];
			successful = shell.executeCommand(cmd).isSuccess();
			if (!successful) {
				break;
			}
		}

		if (successful) {
			exitShellRequest = ExitShellRequest.NORMAL_EXIT;
		}
	} else {
		shell.start();
		shell.promptLoop();
		exitShellRequest = shell.getExitShellRequest();
		if (exitShellRequest == null) {
			exitShellRequest = ExitShellRequest.NORMAL_EXIT;
		}

		shell.waitForComplete();
	}

	sw.stop();
	if (shell.isDevelopmentMode()) {
		System.out.println("Total execution time: " + sw.getLastTaskTimeMillis() + " ms");
	}

	return exitShellRequest;
}
 
Example 13
Source Project: zeppelin   Source File: LensInterpreter.java    License: Apache License 2.0 5 votes vote down vote up
private void closeShell(JLineShell shell) {
  if (shell instanceof LensJLineShellComponent) {
    ((LensJLineShellComponent) shell).stop();
  } else {
    ((JLineShellComponent) shell).stop();
  }
}
 
Example 14
Source Project: rya   Source File: AccumuloRyaConnectionCommandsIT.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void printConnectionDetails_notConnected() {
    final JLineShellComponent shell = getTestShell();

    // Run the print connection details command.
    final CommandResult printResult = shell.executeCommand( RyaConnectionCommands.PRINT_CONNECTION_DETAILS_CMD );
    final String msg = (String) printResult.getResult();

    final String expected = "The shell is not connected to anything.";
    assertEquals(expected, msg);
}
 
Example 15
Source Project: rya   Source File: AccumuloRyaConnectionCommandsIT.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void printConnectionDetails_connectedToAccumulo() throws IOException {
    final MiniAccumuloCluster cluster = getCluster();
    final Bootstrap bootstrap = getTestBootstrap();
    final JLineShellComponent shell = getTestShell();

    // Mock the user entering the correct password.
    final ApplicationContext context = bootstrap.getApplicationContext();
    final PasswordPrompt mockPrompt = context.getBean( PasswordPrompt.class );
    when(mockPrompt.getPassword()).thenReturn("password".toCharArray());

    // Connect to the mini accumulo instance.
    final String cmd =
            RyaConnectionCommands.CONNECT_ACCUMULO_CMD + " " +
                    "--username root " +
                    "--instanceName " + cluster.getInstanceName() + " "+
                    "--zookeepers " + cluster.getZooKeepers();
    shell.executeCommand(cmd);

    // Run the print connection details command.
    final CommandResult printResult = shell.executeCommand( RyaConnectionCommands.PRINT_CONNECTION_DETAILS_CMD );
    final String msg = (String) printResult.getResult();

    final String expected =
            "The shell is connected to an instance of Accumulo using the following parameters:\n" +
            "    Username: root\n" +
            "    Instance Name: " + cluster.getInstanceName() + "\n" +
            "    Zookeepers: " + cluster.getZooKeepers();
    assertEquals(expected, msg);
}
 
Example 16
Source Project: rya   Source File: MongoRyaShellIT.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void connectMongo_noAuth() throws IOException {
    final JLineShellComponent shell = getTestShell();

    // Connect to the Mongo instance.
    final String cmd =
            RyaConnectionCommands.CONNECT_MONGO_CMD + " " +
                    "--hostname " + super.getMongoHostname() + " " +
                    "--port " + super.getMongoPort();

    final CommandResult connectResult = shell.executeCommand(cmd);

    // Ensure the connection was successful.
    assertTrue(connectResult.isSuccess());
}
 
Example 17
Source Project: rya   Source File: MongoRyaShellIT.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void printConnectionDetails_notConnected() {
    final JLineShellComponent shell = getTestShell();

    // Run the print connection details command.
    final CommandResult printResult = shell.executeCommand( RyaConnectionCommands.PRINT_CONNECTION_DETAILS_CMD );
    final String msg = (String) printResult.getResult();

    final String expected = "The shell is not connected to anything.";
    assertEquals(expected, msg);
}
 
Example 18
Source Project: rya   Source File: MongoRyaShellIT.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void printConnectionDetails_connectedToMongo_auths() throws IOException {
    final Bootstrap bootstrap = getTestBootstrap();
    final JLineShellComponent shell = getTestShell();

    // Mock the user entering the correct password.
    final ApplicationContext context = bootstrap.getApplicationContext();
    final PasswordPrompt mockPrompt = context.getBean( PasswordPrompt.class );
    when(mockPrompt.getPassword()).thenReturn("password".toCharArray());

    // Connect to the Mongo instance.
    final String cmd =
            RyaConnectionCommands.CONNECT_MONGO_CMD + " " +
                    "--hostname " + super.getMongoHostname() + " " +
                    "--port " + super.getMongoPort() + " " +
                    "--username bob";
    shell.executeCommand(cmd);

    // Run the print connection details command.
    final CommandResult printResult = shell.executeCommand( RyaConnectionCommands.PRINT_CONNECTION_DETAILS_CMD );
    final String msg = (String) printResult.getResult();

    final String expected =
            "The shell is connected to an instance of MongoDB using the following parameters:\n" +
            "    Hostname: " + super.getMongoHostname() + "\n" +
            "    Port: " + super.getMongoPort() + "\n" +
            "    Username: bob\n";
    assertEquals(expected, msg);
}
 
Example 19
Source Project: rya   Source File: MongoRyaShellIT.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void connectToInstance_noAuths() throws IOException {
    final Bootstrap bootstrap = getTestBootstrap();
    final JLineShellComponent shell = getTestShell();

    // Connect to the Mongo instance.
    String cmd =
            RyaConnectionCommands.CONNECT_MONGO_CMD + " " +
                    "--hostname " + super.getMongoHostname() + " " +
                    "--port " + super.getMongoPort();
    shell.executeCommand(cmd);

    // Install an instance of rya.
    final String instanceName = "testInstance";
    final InstallConfiguration installConf = InstallConfiguration.builder().build();

    final ApplicationContext context = bootstrap.getApplicationContext();
    final InstallPrompt installPrompt = context.getBean( InstallPrompt.class );
    when(installPrompt.promptInstanceName()).thenReturn("testInstance");
    when(installPrompt.promptInstallConfiguration("testInstance")).thenReturn( installConf );
    when(installPrompt.promptVerified(instanceName, installConf)).thenReturn(true);

    CommandResult result = shell.executeCommand( RyaAdminCommands.INSTALL_CMD );
    assertTrue( result.isSuccess() );

    // Connect to the instance that was just installed.
    cmd = RyaConnectionCommands.CONNECT_INSTANCE_CMD + " --instance " + instanceName;
    result = shell.executeCommand(cmd);
    assertTrue( result.isSuccess() );

    // Verify the shell state indicates it is connected to an instance.
    final SharedShellState sharedState = context.getBean( SharedShellState.class );
    final ShellState state = sharedState.getShellState();
    assertEquals(ConnectionState.CONNECTED_TO_INSTANCE, state.getConnectionState());
}
 
Example 20
Source Project: rya   Source File: MongoRyaShellIT.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void disconnect() throws IOException {
    final JLineShellComponent shell = getTestShell();

    // Connect to the Mongo instance.
    final String cmd =
            RyaConnectionCommands.CONNECT_MONGO_CMD + " " +
                    "--hostname " + super.getMongoHostname() + " " +
                    "--port " + super.getMongoPort();
    shell.executeCommand(cmd);

    // Disconnect from it.
    final CommandResult disconnectResult = shell.executeCommand( RyaConnectionCommands.DISCONNECT_COMMAND_NAME_CMD );
    assertTrue( disconnectResult.isSuccess() );
}
 
Example 21
Source Project: hdfs-shell   Source File: BootShim.java    License: Apache License 2.0 4 votes vote down vote up
private void configureApplicationContext(ConfigurableApplicationContext annctx) {
    this.createAndRegisterBeanDefinition(annctx, JLineShellComponent.class, "shell");
    annctx.getBeanFactory().registerSingleton("commandLine", commandLine);
}
 
Example 22
Source Project: hdfs-shell   Source File: BootShim.java    License: Apache License 2.0 4 votes vote down vote up
public JLineShellComponent getJLineShellComponent() {
    return ctx.getBean("shell", JLineShellComponent.class);
}
 
Example 23
@Bean
@ConditionalOnMissingBean(JLineShell.class)
public JLineShellComponent shell() {
	return new JLineShellComponent();
}
 
Example 24
public DataFlowShell(JLineShellComponent shell) {
	this.shell = shell;
}
 
Example 25
Source Project: hudi   Source File: AbstractShellIntegrationTest.java    License: Apache License 2.0 4 votes vote down vote up
protected static JLineShellComponent getShell() {
  return shell;
}
 
Example 26
@Bean
@ConditionalOnMissingBean(JLineShell.class)
public JLineShellComponent shell(ConfigCommands configCommands, TargetHolder targetHolder) {
	return new DataflowJLineShellComponent(configCommands, targetHolder);
}
 
Example 27
public DataFlowShell(JLineShellComponent shell) {
	this.shell = shell;
}
 
Example 28
Source Project: spring-data-dev-tools   Source File: BootShim.java    License: Apache License 2.0 4 votes vote down vote up
public JLineShellComponent getJLineShellComponent() {
	return (JLineShellComponent) this.ctx.getBean("shell", JLineShellComponent.class);
}
 
Example 29
Source Project: rya   Source File: RyaShellAccumuloITBase.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * @return The shell that will be tested.
 */
public JLineShellComponent getTestShell() {
    return shell;
}
 
Example 30
Source Project: rya   Source File: AccumuloRyaCommandsIT.java    License: Apache License 2.0 4 votes vote down vote up
@Test
public void loadsAndQueryData() throws Exception {
    final MiniAccumuloCluster cluster = getCluster();
    final Bootstrap bootstrap = getTestBootstrap();
    final JLineShellComponent shell = getTestShell();

    // Mock the user entering the correct password.
    final ApplicationContext context = bootstrap.getApplicationContext();
    final PasswordPrompt mockPrompt = context.getBean( PasswordPrompt.class );
    when(mockPrompt.getPassword()).thenReturn("password".toCharArray());

    // Connect to the mini accumulo instance.
    String cmd =
            RyaConnectionCommands.CONNECT_ACCUMULO_CMD + " " +
                    "--username root " +
                    "--instanceName " + cluster.getInstanceName() + " "+
                    "--zookeepers " + cluster.getZooKeepers();
    CommandResult result = shell.executeCommand(cmd);

    // Install an instance of rya.
    final String instanceName = "testInstance";
    final InstallConfiguration installConf = InstallConfiguration.builder().build();

    final InstallPrompt installPrompt = context.getBean( InstallPrompt.class );
    when(installPrompt.promptInstanceName()).thenReturn("testInstance");
    when(installPrompt.promptInstallConfiguration("testInstance")).thenReturn( installConf );
    when(installPrompt.promptVerified(instanceName, installConf)).thenReturn(true);

    result = shell.executeCommand( RyaAdminCommands.INSTALL_CMD );
    assertTrue( result.isSuccess() );

    // Connect to the instance that was just installed.
    cmd = RyaConnectionCommands.CONNECT_INSTANCE_CMD + " --instance " + instanceName;
    result = shell.executeCommand(cmd);
    assertTrue( result.isSuccess() );

    // Load a statements file into the instance.
    cmd = RyaCommands.LOAD_DATA_CMD + " --file src/test/resources/test-statements.nt";
    result = shell.executeCommand(cmd);
    assertTrue( result.isSuccess() );

    // Query for all of the statements that were loaded.
    final SparqlPrompt sparqlPrompt = context.getBean(SparqlPrompt.class);
    when(sparqlPrompt.getSparql()).thenReturn(Optional.of("select * where { ?s ?p ?o .}"));

    cmd = RyaCommands.SPARQL_QUERY_CMD;
    result = shell.executeCommand(cmd);
    assertTrue( result.isSuccess() );
}