Package org.testng.remote.strprotocol
Class MessageHelper
- java.lang.Object
-
- org.testng.remote.strprotocol.MessageHelper
-
public class MessageHelper extends java.lang.Object
Marshal/unmarshal tool forIStringMessage
s.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACK_MSG
static char
DELIMITER
static int
FAILED_ON_PERCENTAGE_TEST
static int
FAILED_TEST
static int
GENERIC_SUITE_COUNT
private static char
LINE_SEP_DELIMITER_1
private static char
LINE_SEP_DELIMITER_2
static char
PARAM_DELIMITER
static int
PASSED_TEST
static int
SKIPPED_TEST
static java.lang.String
STOP_MSG
static int
SUITE
static int
SUITE_FINISH
static int
SUITE_START
static int
TEST
static int
TEST_FINISH
static int
TEST_RESULT
static int
TEST_START
static int
TEST_STARTED
-
Constructor Summary
Constructors Constructor Description MessageHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SuiteMessage
createSuiteMessage(java.lang.String message)
static TestMessage
createTestMessage(java.lang.String message)
static int
getMessageType(java.lang.String message)
private static java.lang.String[]
parseMessage(java.lang.String message)
private static java.lang.String[]
parseParameters(java.lang.String messagePart)
private static java.lang.String
quoteReplacement(java.lang.String s)
Implementation according to JDK5 String.replace(CharSequence,CharSequence)private static java.lang.String
replace(java.lang.String original, java.lang.CharSequence target, java.lang.CharSequence replacement)
Implementation according to JDK5 String.replace(CharSequence,CharSequence)static java.lang.String
replaceAsciiCharactersWithUnicode(java.lang.String message)
static java.lang.String
replaceNewLine(java.lang.String message)
static java.lang.String
replaceNewLineReplacer(java.lang.String message)
static java.lang.String
replaceUnicodeCharactersWithAscii(java.lang.String message)
private static java.lang.String[]
tokenize(java.lang.String message, char separator)
static GenericMessage
unmarshallGenericMessage(java.lang.String message)
static TestResultMessage
unmarshallTestResultMessage(java.lang.String message)
-
-
-
Field Detail
-
DELIMITER
public static final char DELIMITER
- See Also:
- Constant Field Values
-
PARAM_DELIMITER
public static final char PARAM_DELIMITER
- See Also:
- Constant Field Values
-
LINE_SEP_DELIMITER_1
private static final char LINE_SEP_DELIMITER_1
- See Also:
- Constant Field Values
-
LINE_SEP_DELIMITER_2
private static final char LINE_SEP_DELIMITER_2
- See Also:
- Constant Field Values
-
GENERIC_SUITE_COUNT
public static final int GENERIC_SUITE_COUNT
- See Also:
- Constant Field Values
-
SUITE
public static final int SUITE
- See Also:
- Constant Field Values
-
SUITE_START
public static final int SUITE_START
- See Also:
- Constant Field Values
-
SUITE_FINISH
public static final int SUITE_FINISH
- See Also:
- Constant Field Values
-
TEST
public static final int TEST
- See Also:
- Constant Field Values
-
TEST_START
public static final int TEST_START
- See Also:
- Constant Field Values
-
TEST_FINISH
public static final int TEST_FINISH
- See Also:
- Constant Field Values
-
TEST_RESULT
public static final int TEST_RESULT
- See Also:
- Constant Field Values
-
PASSED_TEST
public static final int PASSED_TEST
- See Also:
- Constant Field Values
-
FAILED_TEST
public static final int FAILED_TEST
- See Also:
- Constant Field Values
-
SKIPPED_TEST
public static final int SKIPPED_TEST
- See Also:
- Constant Field Values
-
FAILED_ON_PERCENTAGE_TEST
public static final int FAILED_ON_PERCENTAGE_TEST
- See Also:
- Constant Field Values
-
TEST_STARTED
public static final int TEST_STARTED
- See Also:
- Constant Field Values
-
STOP_MSG
public static final java.lang.String STOP_MSG
- See Also:
- Constant Field Values
-
ACK_MSG
public static final java.lang.String ACK_MSG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMessageType
public static int getMessageType(java.lang.String message)
-
unmarshallGenericMessage
public static GenericMessage unmarshallGenericMessage(java.lang.String message)
-
createSuiteMessage
public static SuiteMessage createSuiteMessage(java.lang.String message)
-
createTestMessage
public static TestMessage createTestMessage(java.lang.String message)
-
unmarshallTestResultMessage
public static TestResultMessage unmarshallTestResultMessage(java.lang.String message)
-
replaceNewLine
public static java.lang.String replaceNewLine(java.lang.String message)
-
replaceUnicodeCharactersWithAscii
public static java.lang.String replaceUnicodeCharactersWithAscii(java.lang.String message)
-
replaceAsciiCharactersWithUnicode
public static java.lang.String replaceAsciiCharactersWithUnicode(java.lang.String message)
-
replaceNewLineReplacer
public static java.lang.String replaceNewLineReplacer(java.lang.String message)
-
parseParameters
private static java.lang.String[] parseParameters(java.lang.String messagePart)
-
parseMessage
private static java.lang.String[] parseMessage(java.lang.String message)
-
tokenize
private static java.lang.String[] tokenize(java.lang.String message, char separator)
-
replace
private static final java.lang.String replace(java.lang.String original, java.lang.CharSequence target, java.lang.CharSequence replacement)
Implementation according to JDK5 String.replace(CharSequence,CharSequence)
-
quoteReplacement
private static java.lang.String quoteReplacement(java.lang.String s)
Implementation according to JDK5 String.replace(CharSequence,CharSequence)
-
-