Example usage for org.apache.commons.ssl.asn1 Strings split

List of usage examples for org.apache.commons.ssl.asn1 Strings split

Introduction

In this page you can find the example usage for org.apache.commons.ssl.asn1 Strings split.

Prototype

public static String[] split(String input, char delimiter) 

Source Link

Usage

From source file:org.apache.whirr.actions.integration.PhaseExecutionBarrierTest.java

@Test(timeout = TestConstants.ITEST_TIMEOUT)
public void testNoRemoteExecutionOverlap() throws Exception {
    ClusterSpec spec = getTestClusterSpec();
    ClusterController controller = (new ClusterControllerFactory()).create(spec.getServiceName());

    try {//from ww  w  .j a v a2 s  .  c o m
        controller.launchCluster(spec);
        Map<? extends NodeMetadata, ExecResponse> responseMap = controller.runScriptOnNodesMatching(spec,
                Predicates.<NodeMetadata>alwaysTrue(),
                exec("cat /tmp/bootstrap-start /tmp/bootstrap-end /tmp/configure-start"));
        ExecResponse response = Iterables.get(responseMap.values(), 0);
        LOG.info("Got response: {}", response);

        String[] parts = Strings.split(response.getOutput(), '\n');

        int bootstrapStart = parseInt(deleteWhitespace(parts[0]));
        int bootstrapEnd = parseInt(deleteWhitespace(parts[1]));
        int configureStart = parseInt(deleteWhitespace(parts[2]));

        assertTrue(bootstrapStart < bootstrapEnd);
        assertTrue(bootstrapEnd < configureStart);

    } finally {
        controller.destroyCluster(spec);
    }

    assertNoOverlapOnLocalMachine();
}