< prev index next >
application/tests/org.openjdk.jmc.rjmx.test/src/test/java/org/openjdk/jmc/rjmx/test/services/ServicesPackageExampleTest.java
Print this page
*** 52,87 ****
* Included in the ServicesTestSuite.
*/
// NOTE: If you change the verbatim test YOU MUST update the corresponding package.html document.
public class ServicesPackageExampleTest extends RjmxTestCase {
public void packageExampleFunctionalityVerbatim() throws Exception {
! IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); //$NON-NLS-1$
IServerHandle handle = IServerHandle.create(descriptor);
try {
! IConnectionHandle connection = handle.connect("Run Diagnostic commands"); //$NON-NLS-1$
assumeHasDiagnosticCommandsService(connection);
IDiagnosticCommandService dcmd = connection.getServiceOrThrow(IDiagnosticCommandService.class);
for (IOperation operation : dcmd.getOperations()) {
! System.out.println(dcmd.runCtrlBreakHandlerWithResult(String.format("help %s", operation.getName()))); //$NON-NLS-1$
}
} finally {
handle.dispose();
}
}
@Test
public void testPackageExampleFunctionality() throws Exception {
! IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build(); //$NON-NLS-1$
IServerHandle handle = IServerHandle.create(descriptor);
try {
! IConnectionHandle connection = handle.connect("Run Diagnostic commands"); //$NON-NLS-1$
assumeHasDiagnosticCommandsService(connection);
IDiagnosticCommandService dcmd = connection.getServiceOrThrow(IDiagnosticCommandService.class);
for (IOperation operation : dcmd.getOperations()) {
String command = operation.getName();
! assertNotNull("Could not retrieve help for the command: " + command, //$NON-NLS-1$
! dcmd.runCtrlBreakHandlerWithResult(String.format("help %s", command))); //$NON-NLS-1$
}
} finally {
handle.dispose();
}
}
--- 52,87 ----
* Included in the ServicesTestSuite.
*/
// NOTE: If you change the verbatim test YOU MUST update the corresponding package.html document.
public class ServicesPackageExampleTest extends RjmxTestCase {
public void packageExampleFunctionalityVerbatim() throws Exception {
! IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build();
IServerHandle handle = IServerHandle.create(descriptor);
try {
! IConnectionHandle connection = handle.connect("Run Diagnostic commands");
assumeHasDiagnosticCommandsService(connection);
IDiagnosticCommandService dcmd = connection.getServiceOrThrow(IDiagnosticCommandService.class);
for (IOperation operation : dcmd.getOperations()) {
! System.out.println(dcmd.runCtrlBreakHandlerWithResult(String.format("help %s", operation.getName())));
}
} finally {
handle.dispose();
}
}
@Test
public void testPackageExampleFunctionality() throws Exception {
! IConnectionDescriptor descriptor = new ConnectionDescriptorBuilder().hostName("localhost").port(0).build();
IServerHandle handle = IServerHandle.create(descriptor);
try {
! IConnectionHandle connection = handle.connect("Run Diagnostic commands");
assumeHasDiagnosticCommandsService(connection);
IDiagnosticCommandService dcmd = connection.getServiceOrThrow(IDiagnosticCommandService.class);
for (IOperation operation : dcmd.getOperations()) {
String command = operation.getName();
! assertNotNull("Could not retrieve help for the command: " + command,
! dcmd.runCtrlBreakHandlerWithResult(String.format("help %s", command)));
}
} finally {
handle.dispose();
}
}
< prev index next >