1 /******************************************************************************* 2 * Copyright (c) 2000, 2018 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 *******************************************************************************/ 14 package org.eclipse.jdt.internal.junit.runner; 15 16 /** 17 * Message identifiers for messages sent by the 18 * RemoteTestRunner. 19 * 20 * @see RemoteTestRunner 21 */ 22 public class MessageIds { 23 /** 24 * The header length of a message, all messages 25 * have a fixed header length 26 */ 27 public static final int MSG_HEADER_LENGTH= 8; 28 29 /** 30 * Notification that a test trace has started. 31 * The end of the trace is signaled by a TRACE_END 32 * message. In between the TRACE_START and TRACE_END 33 * the stack trace is submitted as multiple lines. 34 */ 35 public static final String TRACE_START= "%TRACES "; //$NON-NLS-1$ 36 /** 37 * Notification that a trace ends. 38 */ 39 public static final String TRACE_END= "%TRACEE "; //$NON-NLS-1$ 40 /** 41 * Notification that the expected result has started. 42 * The end of the expected result is signaled by a Trace_END. 43 */ 44 public static final String EXPECTED_START= "%EXPECTS"; //$NON-NLS-1$ 45 /** 46 * Notification that an expected result ends. 47 */ 48 public static final String EXPECTED_END= "%EXPECTE"; //$NON-NLS-1$ 49 /** 50 * Notification that the expected result has started. 51 * The end of the expected result is signaled by a Trace_END. 52 */ 53 public static final String ACTUAL_START= "%ACTUALS"; //$NON-NLS-1$ 54 /** 55 * Notification that an expected result ends. 56 */ 57 public static final String ACTUAL_END= "%ACTUALE"; //$NON-NLS-1$ 58 /** 59 * Notification that a trace for a reran test has started. 60 * The end of the trace is signaled by a RTrace_END 61 * message. 62 */ 63 public static final String RTRACE_START= "%RTRACES"; //$NON-NLS-1$ 64 /** 65 * Notification that a trace of a reran trace ends. 66 */ 67 public static final String RTRACE_END= "%RTRACEE"; //$NON-NLS-1$ 68 /** 69 * Notification that a test run has started. 70 * MessageIds.TEST_RUN_START + testCount.toString + " " + version 71 */ 72 public static final String TEST_RUN_START= "%TESTC "; //$NON-NLS-1$ 73 /** 74 * Notification that a test has started. 75 * MessageIds.TEST_START + testID + "," + testName 76 */ 77 public static final String TEST_START= "%TESTS "; //$NON-NLS-1$ 78 /** 79 * Notification that a test has ended. 80 * TEST_END + testID + "," + testName 81 */ 82 public static final String TEST_END= "%TESTE "; //$NON-NLS-1$ 83 /** 84 * Notification that a test had an error. 85 * TEST_ERROR + testID + "," + testName. 86 * After the notification follows the stack trace. 87 */ 88 public static final String TEST_ERROR= "%ERROR "; //$NON-NLS-1$ 89 /** 90 * Notification that a test had a failure. 91 * TEST_FAILED + testID + "," + testName. 92 * After the notification follows the stack trace. 93 */ 94 public static final String TEST_FAILED= "%FAILED "; //$NON-NLS-1$ 95 /** 96 * Notification that a test run has ended. 97 * TEST_RUN_END + elapsedTime.toString(). 98 */ 99 public static final String TEST_RUN_END="%RUNTIME"; //$NON-NLS-1$ 100 /** 101 * Notification that a test run was successfully stopped. 102 */ 103 public static final String TEST_STOPPED="%TSTSTP "; //$NON-NLS-1$ 104 /** 105 * Notification that a test was reran. 106 * TEST_RERAN + testId + " " + testClass + " " + testName + STATUS. 107 * Status = "OK" or "FAILURE". 108 */ 109 public static final String TEST_RERAN= "%TSTRERN"; //$NON-NLS-1$ 110 111 /** 112 * Notification about a test inside the test suite. <br> 113 * TEST_TREE + testId + "," + testName + "," + isSuite + "," + testcount + "," + isDynamicTest + 114 * "," + parentId + "," + displayName + "," + parameterTypes + "," + uniqueId <br> 115 * isSuite = "true" or "false" <br> 116 * isDynamicTest = "true" or "false" <br> 117 * parentId = the unique id of its parent if it is a dynamic test, otherwise can be "-1" <br> 118 * displayName = the display name of the test <br> 119 * parameterTypes = comma-separated list of method parameter types if applicable, otherwise an 120 * empty string <br> 121 * uniqueId = the unique ID of the test provided by JUnit launcher, otherwise an empty string 122 * <br> 123 * See: ITestRunListener2#testTreeEntry 124 * 125 */ 126 public static final String TEST_TREE= "%TSTTREE"; //$NON-NLS-1$ 127 /** 128 * Request to stop the current test run. 129 */ 130 public static final String TEST_STOP= ">STOP "; //$NON-NLS-1$ 131 /** 132 * Request to rerun a test. 133 * TEST_RERUN + testId + " " + testClass + " "+testName 134 */ 135 public static final String TEST_RERUN= ">RERUN "; //$NON-NLS-1$ 136 137 /** 138 * MessageFormat to encode test method identifiers: 139 * testMethod(testClass) 140 */ 141 public static final String TEST_IDENTIFIER_MESSAGE_FORMAT= "{0}({1})"; //$NON-NLS-1$ 142 143 /** 144 * Test identifier prefix for ignored tests. 145 */ 146 public static final String IGNORED_TEST_PREFIX= "@Ignore: "; //$NON-NLS-1$ 147 148 /** 149 * Test identifier prefix for tests with assumption failures. 150 */ 151 public static final String ASSUMPTION_FAILED_TEST_PREFIX= "@AssumptionFailure: "; //$NON-NLS-1$ 152 MessageIds()153 private MessageIds() { 154 } 155 } 156 157 158