Code example for ByteArrayOutputStream

Methods: toString

0
    protected String getWritePropertyReq(String value) {
        return "/system-property=" + PROP_NAME + ":write-attribute(name=\"value\",value=" + value + ")";
    } 
 
    protected String getValue() {
        final String response = cliOut.toString();
        final int start = response.indexOf(RESPONSE_VALUE_PREFIX);
        if(start < 0) {
            Assert.fail("Value not found in the response: " + response);
        } 
        final int end = response.indexOf('"', start + RESPONSE_VALUE_PREFIX.length() + 1);
        if(end < 0) {
            Assert.fail("Couldn't locate the closing quote: " + response);
        } 
        return response.substring(start + RESPONSE_VALUE_PREFIX.length(), end);
    } 
}