Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 228873
Collapse All | Expand All

(-)src-core/org/eclipse/hyades/execution/core/util/Guid.java (-1 lines)
Lines 21-27 Link Here
21
import java.util.Hashtable;
21
import java.util.Hashtable;
22
import java.util.Random;
22
import java.util.Random;
23
23
24
import org.eclipse.hyades.automation.core.internal.resources.AutomationCoreResourceBundle;
25
import org.eclipse.hyades.execution.core.internal.resources.CoreResourceBundle;
24
import org.eclipse.hyades.execution.core.internal.resources.CoreResourceBundle;
26
import org.eclipse.osgi.util.NLS;
25
import org.eclipse.osgi.util.NLS;
27
26
(-)src-automation-client/org/eclipse/hyades/automation/tests/tutorial/Test.java (-9 / +8 lines)
Lines 18-24 Link Here
18
18
19
import org.eclipse.hyades.automation.client.adapters.java.AutomationClientAdapter;
19
import org.eclipse.hyades.automation.client.adapters.java.AutomationClientAdapter;
20
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
20
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
21
import org.eclipse.osgi.util.NLS;
22
21
23
/**
22
/**
24
 * This test tests the automatable services such as execution, interrogation and
23
 * This test tests the automatable services such as execution, interrogation and
Lines 51-57 Link Here
51
		final String ECLIPSE = "d:/development/products/tptp/4.2/client/eclipse";//$NON-NLS-1$
50
		final String ECLIPSE = "d:/development/products/tptp/4.2/client/eclipse";//$NON-NLS-1$
52
		final String WORKSPACE = "d:/development/products/tptp/4.2/workspace";//$NON-NLS-1$
51
		final String WORKSPACE = "d:/development/products/tptp/4.2/workspace";//$NON-NLS-1$
53
		final String PROJECT = "A";//$NON-NLS-1$
52
		final String PROJECT = "A";//$NON-NLS-1$
54
		final String[] SUITES = { "A.testsuite", "A.testsuite", "A.testsuite" };//$NON-NLS-1$
53
		final String[] SUITES = { "A.testsuite", "A.testsuite", "A.testsuite" };//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
55
		final String REPORT = ECLIPSE + "/reports";//$NON-NLS-1$
54
		final String REPORT = ECLIPSE + "/reports";//$NON-NLS-1$
56
		final String CONNECTION = "tptp:rac://localhost:10002/default";//$NON-NLS-1$
55
		final String CONNECTION = "tptp:rac://localhost:10002/default";//$NON-NLS-1$
57
56
Lines 92-98 Link Here
92
			// Configure service properties for this service invocation
91
			// Configure service properties for this service invocation
93
			Properties properties = new Properties();
92
			Properties properties = new Properties();
94
			properties.setProperty("connection", connection);//$NON-NLS-1$
93
			properties.setProperty("connection", connection);//$NON-NLS-1$
95
			properties.setProperty("quiet", "true");//$NON-NLS-1$
94
			properties.setProperty("quiet", "true");//$NON-NLS-1$ //$NON-NLS-2$
96
95
97
			// Execute test results interrogation service
96
			// Execute test results interrogation service
98
			adapter.execute("org.eclipse.hyades.test.tools.core.verify",//$NON-NLS-1$
97
			adapter.execute("org.eclipse.hyades.test.tools.core.verify",//$NON-NLS-1$
Lines 108-114 Link Here
108
			}
107
			}
109
108
110
			// Output that the agent controller is ready for use
109
			// Output that the agent controller is ready for use
111
			System.out.println(AutomationClientResourceBundle.Test_AGENT_CONTROLLER_UP_);
110
			System.out.println(AutomationClientResourceBundle.getString("Test_AGENT_CONTROLLER_UP_")); //$NON-NLS-1$
112
111
113
		}
112
		}
114
113
Lines 142-148 Link Here
142
141
143
			// Retrieve results back from return list
142
			// Retrieve results back from return list
144
			results = (List) properties.get("results");//$NON-NLS-1$
143
			results = (List) properties.get("results");//$NON-NLS-1$
145
			System.out.println(NLS.bind(AutomationClientResourceBundle.Test_RESULTS_COLLECTED_, results));
144
			System.out.println(AutomationClientResourceBundle.getString("Test_RESULTS_COLLECTED_", results)); //$NON-NLS-1$
146
145
147
		}
146
		}
148
147
Lines 158-164 Link Here
158
			Properties properties = new Properties();
157
			Properties properties = new Properties();
159
			properties.setProperty("workspace", workspace);//$NON-NLS-1$
158
			properties.setProperty("workspace", workspace);//$NON-NLS-1$
160
			properties.setProperty("project", project);//$NON-NLS-1$
159
			properties.setProperty("project", project);//$NON-NLS-1$
161
			properties.setProperty("quiet", "true");//$NON-NLS-1$
160
			properties.setProperty("quiet", "true");//$NON-NLS-1$ //$NON-NLS-2$
162
161
163
			// Add list to results property
162
			// Add list to results property
164
			properties.put("results", results);//$NON-NLS-1$
163
			properties.put("results", results);//$NON-NLS-1$
Lines 168-174 Link Here
168
					properties);
167
					properties);
169
168
170
			// Output verdict indicated from test results
169
			// Output verdict indicated from test results
171
			System.out.println(NLS.bind(AutomationClientResourceBundle.Test_OVERALL_TEST_RESULT_VERDICT_, properties.getProperty("verdict")));
170
			System.out.println(AutomationClientResourceBundle.getString("Test_OVERALL_TEST_RESULT_VERDICT_", properties.getProperty("verdict"))); //$NON-NLS-1$ //$NON-NLS-2$
172
171
173
		}
172
		}
174
173
Lines 183-189 Link Here
183
			properties.setProperty("workspace", workspace);//$NON-NLS-1$
182
			properties.setProperty("workspace", workspace);//$NON-NLS-1$
184
			properties.setProperty("project", project);//$NON-NLS-1$
183
			properties.setProperty("project", project);//$NON-NLS-1$
185
			properties.setProperty("report", report);//$NON-NLS-1$
184
			properties.setProperty("report", report);//$NON-NLS-1$
186
			properties.setProperty("quiet", "true");//$NON-NLS-1$
185
			properties.setProperty("quiet", "true");//$NON-NLS-1$ //$NON-NLS-2$
187
186
188
			// Add list to results property
187
			// Add list to results property
189
			properties.put("results", results);//$NON-NLS-1$
188
			properties.put("results", results);//$NON-NLS-1$
Lines 193-199 Link Here
193
					properties);
192
					properties);
194
193
195
			// Output verdict indicated from test results
194
			// Output verdict indicated from test results
196
			System.out.println(NLS.bind(AutomationClientResourceBundle.Test_OVERALL_TEST_RESULT_VERDICT_, properties.getProperty("verdict")));
195
			System.out.println(AutomationClientResourceBundle.getString("Test_OVERALL_TEST_RESULT_VERDICT_", properties.getProperty("verdict"))); //$NON-NLS-1$ //$NON-NLS-2$
197
196
198
		}
197
		}
199
198
(-)src-automation-client/org/eclipse/hyades/automation/client/adapters/ant/AutomationClientAdapter.java (-14 / +13 lines)
Lines 36-42 Link Here
36
import org.apache.tools.ant.util.FileUtils;
36
import org.apache.tools.ant.util.FileUtils;
37
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
37
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
38
import org.eclipse.hyades.automation.core.utils.ProgressiveTask;
38
import org.eclipse.hyades.automation.core.utils.ProgressiveTask;
39
import org.eclipse.osgi.util.NLS;
40
39
41
/**
40
/**
42
 * These are the two included ant task definitions, the first one, named
41
 * These are the two included ant task definitions, the first one, named
Lines 280-291 Link Here
280
						file = files[i];
279
						file = files[i];
281
					
280
					
282
					if (!quiet) {
281
					if (!quiet) {
283
						System.out.println(NLS.bind(AutomationClientResourceBundle.AutomationClientAdapter_ADDING_FILE_, theFile.getAbsolutePath()));
282
						System.out.println(AutomationClientResourceBundle.getString("AutomationClientAdapter_ADDING_FILE_", theFile.getAbsolutePath()));  //$NON-NLS-1$
284
					}					
283
					}					
285
					resultList.add(file);
284
					resultList.add(file);
286
				}
285
				}
287
				else
286
				else
288
					System.out.println(NLS.bind(AutomationClientResourceBundle.AutomationClientAdapter_FILE_NOT_EXIST_, theFile.getAbsolutePath()));
287
					System.out.println(AutomationClientResourceBundle.getString("AutomationClientAdapter_FILE_NOT_EXIST_", theFile.getAbsolutePath())); //$NON-NLS-1$
289
			}
288
			}
290
		}
289
		}
291
		
290
		
Lines 366-372 Link Here
366
				String defaultCommand = this
365
				String defaultCommand = this
367
						.getProjectProperty("tptp.automation.command");//$NON-NLS-1$
366
						.getProjectProperty("tptp.automation.command");//$NON-NLS-1$
368
				this.command = defaultCommand != null ? defaultCommand
367
				this.command = defaultCommand != null ? defaultCommand
369
						: "execute";
368
						: "execute"; //$NON-NLS-1$
370
			}
369
			}
371
			if (this.iterations == 0) {
370
			if (this.iterations == 0) {
372
				String defaultIterations = this
371
				String defaultIterations = this
Lines 608-615 Link Here
608
				putToProperties("suite", suiteList);//$NON-NLS-1$
607
				putToProperties("suite", suiteList);//$NON-NLS-1$
609
			}
608
			}
610
			
609
			
611
			if (this.getFromProperties("suite") == null && this.getFromProperties("configuration") == null) {//$NON-NLS-1$
610
			if (this.getFromProperties("suite") == null && this.getFromProperties("configuration") == null) {//$NON-NLS-1$ //$NON-NLS-2$
612
				System.out.println(AutomationClientResourceBundle.AutomationClientAdapter_NO_TEST_SPECIFIED_);
611
				System.out.println(AutomationClientResourceBundle.getString("AutomationClientAdapter_NO_TEST_SPECIFIED_")); //$NON-NLS-1$
613
				return;
612
				return;
614
			}
613
			}
615
614
Lines 629-635 Link Here
629
							(List)results, projectDir);
628
							(List)results, projectDir);
630
					getProject().addReference(resultsrefid, resultFileList);
629
					getProject().addReference(resultsrefid, resultFileList);
631
				} else {
630
				} else {
632
					System.out.println(AutomationClientResourceBundle.AutomationClientAdapter_NO_PARAM_SPECIFIED_);
631
					System.out.println(AutomationClientResourceBundle.getString("AutomationClientAdapter_NO_PARAM_SPECIFIED_")); //$NON-NLS-1$
633
				}
632
				}
634
					
633
					
635
			}
634
			}
Lines 712-718 Link Here
712
	     */
711
	     */
713
	    protected synchronized void checkConfiguration() throws BuildException {
712
	    protected synchronized void checkConfiguration() throws BuildException {
714
	        if (suite == null && filesets.size() + filelists.size() == 0) {
713
	        if (suite == null && filesets.size() + filelists.size() == 0) {
715
	            throw new BuildException(AutomationClientResourceBundle.AutomationClientAdapter_SPEICIFY_SOURCE_OF_TESTS_);
714
	            throw new BuildException(AutomationClientResourceBundle.getString("AutomationClientAdapter_SPEICIFY_SOURCE_OF_TESTS_")); //$NON-NLS-1$
716
	        }
715
	        }
717
	    }		
716
	    }		
718
717
Lines 976-982 Link Here
976
			this.execute();
975
			this.execute();
977
976
978
			// Return true if the verdict is 'pass'
977
			// Return true if the verdict is 'pass'
979
			return this.getProperty("verdict").equalsIgnoreCase("pass");//$NON-NLS-1$
978
			return this.getProperty("verdict").equalsIgnoreCase("pass");//$NON-NLS-1$ //$NON-NLS-2$
980
979
981
		}
980
		}
982
981
Lines 991-997 Link Here
991
			this.addProperty("workspace", this.workspace);//$NON-NLS-1$
990
			this.addProperty("workspace", this.workspace);//$NON-NLS-1$
992
			this.addProperty("project", this.project);//$NON-NLS-1$
991
			this.addProperty("project", this.project);//$NON-NLS-1$
993
			this.addProperty("results", this.results);//$NON-NLS-1$
992
			this.addProperty("results", this.results);//$NON-NLS-1$
994
			this.addProperty("verdict", "fail");//$NON-NLS-1$
993
			this.addProperty("verdict", "fail");//$NON-NLS-1$ //$NON-NLS-2$
995
994
996
			// If filesets or filelists have been specified, copy the
995
			// If filesets or filelists have been specified, copy the
997
			// files into the input array
996
			// files into the input array
Lines 1215-1221 Link Here
1215
			try {
1214
			try {
1216
				time = format.parse(dateTime).getTime();
1215
				time = format.parse(dateTime).getTime();
1217
			} catch (ParseException e) {
1216
			} catch (ParseException e) {
1218
				System.out.println(NLS.bind(AutomationClientResourceBundle.AutomationClientAdapter_UNABLE_PARSE_DATETIME_, dateTime));
1217
				System.out.println(AutomationClientResourceBundle.getString("AutomationClientAdapter_UNABLE_PARSE_DATETIME_", dateTime)); //$NON-NLS-1$
1219
			}
1218
			}
1220
			return Long.toString(time);
1219
			return Long.toString(time);
1221
		}
1220
		}
Lines 1245-1251 Link Here
1245
	     */
1244
	     */
1246
	    protected synchronized void checkConfiguration() throws BuildException {
1245
	    protected synchronized void checkConfiguration() throws BuildException {
1247
	        if (results == null && filesets.size() + filelists.size() == 0) {
1246
	        if (results == null && filesets.size() + filelists.size() == 0) {
1248
	            throw new BuildException(AutomationClientResourceBundle.AutomationClientAdapter_SPEICIFY_SOURCE_OF_RESULTS_);
1247
	            throw new BuildException(AutomationClientResourceBundle.getString("AutomationClientAdapter_SPEICIFY_SOURCE_OF_RESULTS_")); //$NON-NLS-1$
1249
	        }
1248
	        }
1250
//	        if (results != null && filesets.size() + filelists.size() > 0) {
1249
//	        if (results != null && filesets.size() + filelists.size() > 0) {
1251
//	            throw new BuildException("For workspace result files, specify"
1250
//	            throw new BuildException("For workspace result files, specify"
Lines 1478-1484 Link Here
1478
			this.execute();
1477
			this.execute();
1479
1478
1480
			// Return true if verified is set to true
1479
			// Return true if verified is set to true
1481
			return this.getProperty("verified").equalsIgnoreCase("true");//$NON-NLS-1$
1480
			return this.getProperty("verified").equalsIgnoreCase("true");//$NON-NLS-1$ //$NON-NLS-2$
1482
		}
1481
		}
1483
1482
1484
		/*
1483
		/*
Lines 1490-1496 Link Here
1490
1489
1491
			// Set properties and command for this execution
1490
			// Set properties and command for this execution
1492
			this.addProperty("connection", this.connection);//$NON-NLS-1$
1491
			this.addProperty("connection", this.connection);//$NON-NLS-1$
1493
			this.addProperty("verified", "false");//$NON-NLS-1$
1492
			this.addProperty("verified", "false");//$NON-NLS-1$ //$NON-NLS-2$
1494
			this.setCommand("execute");//$NON-NLS-1$
1493
			this.setCommand("execute");//$NON-NLS-1$
1495
1494
1496
			// Execute service (via automation base class)
1495
			// Execute service (via automation base class)
(-)src-automation-client/org/eclipse/hyades/automation/client/strategies/VoidStrategy.java (-1 / +1 lines)
Lines 30-36 Link Here
30
	 *      org.eclipse.hyades.automation.core.utils.ProgressiveTask.Synchronicity)
30
	 *      org.eclipse.hyades.automation.core.utils.ProgressiveTask.Synchronicity)
31
	 */
31
	 */
32
	public Object execute(Service service, ProgressiveTask.Synchronicity synchronicity) {
32
	public Object execute(Service service, ProgressiveTask.Synchronicity synchronicity) {
33
		return "";
33
		return ""; //$NON-NLS-1$
34
	}
34
	}
35
35
36
}
36
}
(-)src-automation-client/org/eclipse/hyades/automation/client/strategies/AbstractExecutionStrategy.java (-2 / +1 lines)
Lines 21-27 Link Here
21
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
21
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
22
import org.eclipse.hyades.automation.core.Service;
22
import org.eclipse.hyades.automation.core.Service;
23
import org.eclipse.hyades.automation.core.utils.ProgressiveTask;
23
import org.eclipse.hyades.automation.core.utils.ProgressiveTask;
24
import org.eclipse.osgi.util.NLS;
25
24
26
/**
25
/**
27
 * The client execution strategy to use, this strategy specifies how the command
26
 * The client execution strategy to use, this strategy specifies how the command
Lines 151-157 Link Here
151
	 */
150
	 */
152
	static void redirectConsole(Process process, final InputStream inputStream,
151
	static void redirectConsole(Process process, final InputStream inputStream,
153
			final PrintStream printStream) {
152
			final PrintStream printStream) {
154
		new Thread(NLS.bind(AutomationClientResourceBundle.AbstractExecutionStrategy_CONSOLE_REDIRECTION_, inputStream, printStream))
153
		new Thread(AutomationClientResourceBundle.getString("AbstractExecutionStrategy_CONSOLE_REDIRECTION_", inputStream, printStream)) //$NON-NLS-1$
155
		{
154
		{
156
			public void run() {
155
			public void run() {
157
				try {
156
				try {
(-)src-automation-client/org/eclipse/hyades/automation/client/strategies/InProcessStrategy.java (-1 / +1 lines)
Lines 47-53 Link Here
47
		try {
47
		try {
48
48
49
			// Find service implementation for this service identifier
49
			// Find service implementation for this service identifier
50
			IExtension extension = Platform.getExtensionRegistry().getExtension("org.eclipse.core.runtime.applications",
50
			IExtension extension = Platform.getExtensionRegistry().getExtension("org.eclipse.core.runtime.applications", //$NON-NLS-1$
51
					"org.eclipse.hyades.execution.server");//$NON-NLS-1$
51
					"org.eclipse.hyades.execution.server");//$NON-NLS-1$
52
52
53
			if (extension != null) {
53
			if (extension != null) {
(-)src-automation-client/org/eclipse/hyades/automation/client/strategies/OutOfProcessStrategy.java (-15 / +15 lines)
Lines 25-33 Link Here
25
25
26
import org.eclipse.hyades.automation.client.adapters.java.AutomationClientAdapter;
26
import org.eclipse.hyades.automation.client.adapters.java.AutomationClientAdapter;
27
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
27
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
28
import org.eclipse.hyades.automation.core.AbstractService;
28
import org.eclipse.hyades.automation.core.IAutomationServer;
29
import org.eclipse.hyades.automation.core.IAutomationServer;
29
import org.eclipse.hyades.automation.core.Service;
30
import org.eclipse.hyades.automation.core.Service;
30
import org.eclipse.hyades.automation.core.AbstractService;
31
import org.eclipse.hyades.automation.core.utils.ProgressiveTask;
31
import org.eclipse.hyades.automation.core.utils.ProgressiveTask;
32
import org.eclipse.hyades.automation.core.utils.ProgressiveTask.Synchronicity;
32
import org.eclipse.hyades.automation.core.utils.ProgressiveTask.Synchronicity;
33
33
Lines 136-142 Link Here
136
				IAutomationServer server) throws RemoteException {
136
				IAutomationServer server) throws RemoteException {
137
			if (server == null) {
137
			if (server == null) {
138
				throw new IllegalArgumentException(
138
				throw new IllegalArgumentException(
139
						AutomationClientResourceBundle.OutOfProcessStrategy_AUTOMATION_SERVER_VALUE_);
139
						AutomationClientResourceBundle.getString("OutOfProcessStrategy_AUTOMATION_SERVER_VALUE_")); //$NON-NLS-1$
140
			}
140
			}
141
			Object object = server.run(service.createMemento());
141
			Object object = server.run(service.createMemento());
142
			service.configure((Service.Memento) object);
142
			service.configure((Service.Memento) object);
Lines 218-224 Link Here
218
			
218
			
219
			// Windows requires quotes surrounding path
219
			// Windows requires quotes surrounding path
220
			boolean useQuotes = false;
220
			boolean useQuotes = false;
221
			if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1) {//$NON-NLS-1$
221
			if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1) {//$NON-NLS-1$ //$NON-NLS-2$
222
				useQuotes = true;
222
				useQuotes = true;
223
			}
223
			}
224
224
Lines 229-243 Link Here
229
			command.append("-application ");//$NON-NLS-1$
229
			command.append("-application ");//$NON-NLS-1$
230
			command
230
			command
231
					.append(AbstractExecutionStrategy.AUTOMATION_SERVER_IDENTIFIER
231
					.append(AbstractExecutionStrategy.AUTOMATION_SERVER_IDENTIFIER
232
							+ " ");
232
							+ " "); //$NON-NLS-1$
233
			String strWorkspace = p.getProperty("workspace");//$NON-NLS-1$
233
			String strWorkspace = p.getProperty("workspace");//$NON-NLS-1$
234
			if (strWorkspace == null)
234
			if (strWorkspace == null)
235
				strWorkspace = p.getProperty("tptp.test.workspace");//$NON-NLS-1$
235
				strWorkspace = p.getProperty("tptp.test.workspace");//$NON-NLS-1$
236
			if (strWorkspace != null){
236
			if (strWorkspace != null){
237
				if ((useQuotes == true)  && (strWorkspace.startsWith("\"") == false)){
237
				if ((useQuotes == true)  && (strWorkspace.startsWith("\"") == false)){ //$NON-NLS-1$
238
					strWorkspace = "\"" + strWorkspace + "\"";
238
					strWorkspace = "\"" + strWorkspace + "\""; //$NON-NLS-1$ //$NON-NLS-2$
239
				}
239
				}
240
				command.append("-data " + strWorkspace + " ");//$NON-NLS-1$
240
				command.append("-data " + strWorkspace + " ");//$NON-NLS-1$ //$NON-NLS-2$
241
			}
241
			}
242
			command.append("-vmargs ");//$NON-NLS-1$
242
			command.append("-vmargs ");//$NON-NLS-1$
243
			
243
			
Lines 253-273 Link Here
253
			if (strVMargs == null)
253
			if (strVMargs == null)
254
				strVMargs = p.getProperty("tptp.automation.vmargs");//$NON-NLS-1$
254
				strVMargs = p.getProperty("tptp.automation.vmargs");//$NON-NLS-1$
255
			if (strVMargs != null)
255
			if (strVMargs != null)
256
				command.append(strVMargs + " ");			
256
				command.append(strVMargs + " ");			 //$NON-NLS-1$
257
257
258
			// Other -D options to pass in
258
			// Other -D options to pass in
259
			command.append("-D"
259
			command.append("-D" //$NON-NLS-1$
260
					+ AbstractExecutionStrategy.AUTOMATION_COMMAND_IDENTIFIER);
260
					+ AbstractExecutionStrategy.AUTOMATION_COMMAND_IDENTIFIER);
261
			command.append("=execute ");//$NON-NLS-1$
261
			command.append("=execute ");//$NON-NLS-1$
262
			command
262
			command
263
					.append("-D"
263
					.append("-D" //$NON-NLS-1$
264
							+ AbstractExecutionStrategy.AUTOMATION_SYNCHRONICITY_DIRECTIVE);
264
							+ AbstractExecutionStrategy.AUTOMATION_SYNCHRONICITY_DIRECTIVE);
265
			command.append("=" + synchronicity.toString());
265
			command.append("=" + synchronicity.toString()); //$NON-NLS-1$
266
			command.append(" -D"
266
			command.append(" -D" //$NON-NLS-1$
267
					+ AbstractExecutionStrategy.AUTOMATION_DATA_IDENTIFIER);
267
					+ AbstractExecutionStrategy.AUTOMATION_DATA_IDENTIFIER);
268
268
269
			command.append("=" + (useQuotes ? "\"" : "")
269
			command.append("=" + (useQuotes ? "\"" : "") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
270
					+ file.getCanonicalPath() + (useQuotes ? "\"" : ""));
270
					+ file.getCanonicalPath() + (useQuotes ? "\"" : "")); //$NON-NLS-1$ //$NON-NLS-2$
271
			
271
			
272
272
273
273
Lines 358-364 Link Here
358
			String returnFileName = dataFile.getCanonicalPath();
358
			String returnFileName = dataFile.getCanonicalPath();
359
			int length = returnFileName.length();
359
			int length = returnFileName.length();
360
			returnFileName = returnFileName.substring(0, length - 4).concat(
360
			returnFileName = returnFileName.substring(0, length - 4).concat(
361
					"-out").concat(returnFileName.substring(length - 4));
361
					"-out").concat(returnFileName.substring(length - 4)); //$NON-NLS-1$
362
362
363
			// Read file contents (persisted objects)
363
			// Read file contents (persisted objects)
364
			FileInputStream fileInput = new FileInputStream(returnFileName);
364
			FileInputStream fileInput = new FileInputStream(returnFileName);
(-)src-automation-client/org/eclipse/hyades/automation/tests/AllTests.java (-2 lines)
Lines 12-19 Link Here
12
12
13
package org.eclipse.hyades.automation.tests;
13
package org.eclipse.hyades.automation.tests;
14
14
15
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
16
17
import junit.framework.Test;
15
import junit.framework.Test;
18
import junit.framework.TestSuite;
16
import junit.framework.TestSuite;
19
17
(-)src-automation-client/org/eclipse/hyades/automation/tests/TestExecution.java (-4 / +4 lines)
Lines 67-76 Link Here
67
	public void testExecute() {
67
	public void testExecute() {
68
		AutomationClientAdapter automation = new AutomationClientAdapter("d:\\development\\products\\tptp\\4.1\\unsecure\\client\\eclipse");//$NON-NLS-1$
68
		AutomationClientAdapter automation = new AutomationClientAdapter("d:\\development\\products\\tptp\\4.1\\unsecure\\client\\eclipse");//$NON-NLS-1$
69
		Properties properties = new Properties();
69
		Properties properties = new Properties();
70
		properties.setProperty("workspace", "D:\\development\\products\\tptp\\4.1\\unsecure\\workspace");//$NON-NLS-1$
70
		properties.setProperty("workspace", "D:\\development\\products\\tptp\\4.1\\unsecure\\workspace");//$NON-NLS-1$ //$NON-NLS-2$
71
		properties.setProperty("project", "A");//$NON-NLS-1$
71
		properties.setProperty("project", "A");//$NON-NLS-1$ //$NON-NLS-2$
72
		properties.setProperty("suite", "A.testsuite");//$NON-NLS-1$
72
		properties.setProperty("suite", "A.testsuite");//$NON-NLS-1$ //$NON-NLS-2$
73
		properties.setProperty("vmArgs", "-Xj9");//$NON-NLS-1$
73
		properties.setProperty("vmArgs", "-Xj9");//$NON-NLS-1$ //$NON-NLS-2$
74
		automation.execute("org.eclipse.hyades.test.tools.core.execute", properties);//$NON-NLS-1$
74
		automation.execute("org.eclipse.hyades.test.tools.core.execute", properties);//$NON-NLS-1$
75
	}
75
	}
76
76
(-)src-automation-core/org/eclipse/hyades/automation/core/AbstractService.java (-2 / +2 lines)
Lines 218-224 Link Here
218
	 * @see org.eclipse.hyades.automation.core.Service#getRoot()
218
	 * @see org.eclipse.hyades.automation.core.Service#getRoot()
219
	 */
219
	 */
220
	public String getRoot() {
220
	public String getRoot() {
221
		return "";
221
		return ""; //$NON-NLS-1$
222
	}
222
	}
223
223
224
	/**
224
	/**
Lines 228-234 Link Here
228
	 * @return false is output is not suppressed
228
	 * @return false is output is not suppressed
229
	 */
229
	 */
230
	protected boolean isQuiet() {
230
	protected boolean isQuiet() {
231
		return Boolean.valueOf(this.getProperty("quiet", "false"))//$NON-NLS-1$
231
		return Boolean.valueOf(this.getProperty("quiet", "false"))//$NON-NLS-1$ //$NON-NLS-2$
232
				.booleanValue();
232
				.booleanValue();
233
	}
233
	}
234
234
(-)src-automation-client/org/eclipse/hyades/automation/client/adapters/java/AutomationClientAdapter.java (-6 / +2 lines)
Lines 20-29 Link Here
20
import org.eclipse.hyades.automation.client.strategies.AbstractExecutionStrategy;
20
import org.eclipse.hyades.automation.client.strategies.AbstractExecutionStrategy;
21
import org.eclipse.hyades.automation.core.Service;
21
import org.eclipse.hyades.automation.core.Service;
22
import org.eclipse.hyades.automation.core.utils.ProgressiveTask;
22
import org.eclipse.hyades.automation.core.utils.ProgressiveTask;
23
import org.eclipse.osgi.util.NLS;
24
25
26
import com.ibm.icu.text.MessageFormat;
27
23
28
/**
24
/**
29
 * The Java automation client adapter provides a front-end to external Java code
25
 * The Java automation client adapter provides a front-end to external Java code
Lines 191-200 Link Here
191
	// error if a path is set as the project name
187
	// error if a path is set as the project name
192
	
188
	
193
	private boolean checkProjectProperty(Properties properties){
189
	private boolean checkProjectProperty(Properties properties){
194
		String proj = properties.getProperty("project");
190
		String proj = properties.getProperty("project"); //$NON-NLS-1$
195
		if (proj != null){
191
		if (proj != null){
196
			if (proj.indexOf('\\') >= 0 || proj.indexOf('/') >= 0){
192
			if (proj.indexOf('\\') >= 0 || proj.indexOf('/') >= 0){
197
				System.out.println(NLS.bind(AutomationClientResourceBundle.AutomationClientAdapter_INVALID_PROJECT_, proj));
193
				System.out.println(AutomationClientResourceBundle.getString("AutomationClientAdapter_INVALID_PROJECT_", proj));  //$NON-NLS-1$
198
				return false;
194
				return false;
199
			}
195
			}
200
			
196
			
(-)src-automation-client/org/eclipse/hyades/automation/client/adapters/shell/CommandLineArgumentParser.java (-4 / +4 lines)
Lines 19-25 Link Here
19
import java.util.ArrayList;
19
import java.util.ArrayList;
20
import java.util.Properties;
20
import java.util.Properties;
21
21
22
import com.ibm.icu.text.MessageFormat;
22
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
23
23
24
/**
24
/**
25
 * The command line parser class is used to parse the specified program
25
 * The command line parser class is used to parse the specified program
Lines 101-111 Link Here
101
			if (parameterSet[parmNumber] == true && !processingConfigFile) {
101
			if (parameterSet[parmNumber] == true && !processingConfigFile) {
102
				Object[] obj = new Object[1];
102
				Object[] obj = new Object[1];
103
				obj[0] = str[count];
103
				obj[0] = str[count];
104
				message.append(MessageFormat.format((Messages.getString("ParseCmdLineArgs.1")), obj));//$NON-NLS-1$
104
				message.append(AutomationClientResourceBundle.getString("ParseCmdLineArgs.1", obj));//$NON-NLS-1$
105
			} else if (configurationParameterSet[parmNumber] == true && processingConfigFile) {
105
			} else if (configurationParameterSet[parmNumber] == true && processingConfigFile) {
106
				Object[] obj = new Object[1];
106
				Object[] obj = new Object[1];
107
				obj[0] = str[count];
107
				obj[0] = str[count];
108
				message.append(MessageFormat.format((Messages.getString("ParseCmdLineArgs.3")), obj));//$NON-NLS-1$
108
				message.append(AutomationClientResourceBundle.getString("ParseCmdLineArgs.3", obj));//$NON-NLS-1$
109
			} else if (!parameterSet[parmNumber]) {
109
			} else if (!parameterSet[parmNumber]) {
110
				if (strCompare.compareTo(ICommandLineParameters.CMD_QUIET) == 0) {
110
				if (strCompare.compareTo(ICommandLineParameters.CMD_QUIET) == 0) {
111
					properties.setProperty(strCompare, "");//$NON-NLS-1$
111
					properties.setProperty(strCompare, "");//$NON-NLS-1$
Lines 265-271 Link Here
265
					Object[] obj = new Object[1];
265
					Object[] obj = new Object[1];
266
					obj[0] = configfilepath;
266
					obj[0] = configfilepath;
267
					message
267
					message
268
							.append(MessageFormat.format((Messages.getString("ParseCmdLineArgs.5")), obj) + lineSeparator);//$NON-NLS-1$
268
							.append(AutomationClientResourceBundle.getString("ParseCmdLineArgs.5", obj) + lineSeparator);//$NON-NLS-1$
269
				}
269
				}
270
			} catch (IOException e) {
270
			} catch (IOException e) {
271
271
(-)src-automation-client/org/eclipse/hyades/automation/client/adapters/shell/messages.properties (-83 lines)
Removed Link Here
1
###############################################################################
2
# Copyright (c) 2005, 2008 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# $Id: messages.properties,v 1.9 2008/03/24 17:12:24 jkubasta Exp $
8
# 
9
# Contributors:
10
#     IBM Corporation - initial API and implementation
11
###############################################################################
12
13
AutomationClientAdapter.0=Due to the above errors, no attempt was made to run a test, there are no results to view.
14
AutomationClientAdapter.1=\r\nTEST COMMENT: {0}
15
AutomationClientAdapter.5=Error, eclipse was not specified and was not found automatically.
16
AutomationClientAdapter.6=Error, the path given for eclipsehome: {0}, is not a valid directory.\r\n
17
AutomationClientAdapter.9=Error, the path given for workspace: {0}, is not a valid directory.
18
AutomationClientAdapter.18=\nDue to the above errors, no attempt was made to run a test, there are no results to view.
19
AutomationClientAdapter.19=Parameters accepted, starting the test run.
20
AutomationClientAdapter.20=Error, a required jar file was not found: {0}
21
AutomationClientAdapter.21=\r\nTPTP 4.1.0 Automation Client Adapter Help\r\n\r\n
22
AutomationClientAdapter.22=Automatable services published through the automatable services framework are available for command through this\r\n
23
AutomationClientAdapter.221=command line interface.  The test execution service has named and more strongly typed parameters than the invocation\r\n
24
AutomationClientAdapter.222=of an arbitrary published automatable service although both can be commanded and thus executed through this interface.\r\n\r\n
25
AutomationClientAdapter.23=\ \ usage: automation-client-adapter -parm1 <parm1value> -parm2 <parm2value> (etc...)\r\n\r\n
26
AutomationClientAdapter.25=Below is the usage definition and valid named parameters that may be used in any order (values containing spaces\r\nmust be in quotes):\r\n\r\n
27
AutomationClientAdapter.26=\ \ -configfile <directorypath>\r\n
28
AutomationClientAdapter.27=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Specify command line parameters via a user supplied config file.\r\n
29
AutomationClientAdapter.28=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -configfile .\\example.config\r\n
30
AutomationClientAdapter.29=\ \ -eclipse <directorypath>\r\n
31
AutomationClientAdapter.30=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the full path to eclipse, usually detected automatically.\r\n
32
AutomationClientAdapter.31=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -eclipse "C:\\eclipse"\r\n
33
AutomationClientAdapter.32=\ \ -workspace <directorypath>\r\n
34
AutomationClientAdapter.33=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the full path to the desired workspace.\r\n
35
AutomationClientAdapter.34=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -workspace c:\\workspace\r\n
36
AutomationClientAdapter.35=\ \ -project <relativedirectorypath>\r\n
37
AutomationClientAdapter.36=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the location of the desired project relative to the workspace.\r\n
38
AutomationClientAdapter.37=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -project testproj\r\n
39
AutomationClientAdapter.41=\ \ -suite <relativefilepath>\r\n
40
AutomationClientAdapter.42=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the location of the test suite to run relative to the project.\r\n
41
AutomationClientAdapter.43=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ examples: -suite mytest OR -suite tests\\mytest\r\n
42
AutomationClientAdapter.44=\ \ -results <relativefilepath>\r\n
43
AutomationClientAdapter.45=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the namepath for the results relative to the project.\r\n
44
AutomationClientAdapter.46=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ examples: -result myresults OR -result results\\myresults\r\n
45
AutomationClientAdapter.47=\ \ -overwrite <true or false>\r\n
46
AutomationClientAdapter.48=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if "true" the specified results will be overwritten.\r\n
47
AutomationClientAdapter.49=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -overwrite true  (default is false).\r\n
48
AutomationClientAdapter.50=\ \ -deployment <relativefilepath>\r\n
49
AutomationClientAdapter.51=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the namepath for the deployment relative to the project.\r\n
50
AutomationClientAdapter.52=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ examples: -deployment mydeployment OR -deployment deployments\\mydeployment\r\n
51
AutomationClientAdapter.85=\ \ -configuration <relativefilepath>\r\n
52
AutomationClientAdapter.86=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the namepath for the launch configuration relative to the project.\r\n
53
AutomationClientAdapter.87=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ examples: -configuration mylaunch.launch OR -configuration launches\\mylaunch.launch.\r\n
54
AutomationClientAdapter.88=\ \ -connection <connectionstring>\r\n
55
AutomationClientAdapter.89=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the connection string specifying the agent controller to use.\r\n
56
AutomationClientAdapter.90=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ format:  <specification>:<class>://<host>:<port>/<instance>?user=<user>&password=<password>\r\n
57
AutomationClientAdapter.91=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -connection tptp:rac://server.rtp.ibm.com:10002/default\r\n
58
AutomationClientAdapter.92=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -connection tptp:iac://localhost/default\r\n
59
AutomationClientAdapter.93=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -connection server.rtp.ibm.com\r\n
60
AutomationClientAdapter.94=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -connection localhost:11010\r\n
61
AutomationClientAdapter.53=\ \ -vmargs  <string of VM args>\r\n
62
AutomationClientAdapter.54=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ The JVM arguments specified will be used in launching the Eclipse instance.\r\n
63
AutomationClientAdapter.55=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -vmargs "-Xmx756 -Xquickstart"\r\n
64
AutomationClientAdapter.59=\ \ -service <servicename>\r\n
65
AutomationClientAdapter.60=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Rather than running test execution service, this\r\n
66
AutomationClientAdapter.61=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specifies running another published automatable service.\r\n
67
AutomationClientAdapter.62=\r\nA simple and typical usage example:\r\n\r\n
68
AutomationClientAdapter.63=\ \ automation-client-adapter -workspace c:\\myworkspace -project myproj -suite mytest\r\n
69
AutomationClientAdapter.66=\r\nIn a configfile, any of the above may be specified as a name=value pair.  There are no leading hyphens permitted\r\nbetween name and value.
70
AutomationClientAdapter.67=Each name=value pair must be on a separate line.  Extra spaces around the name and value are\r\naccepted.\r\n\r\n
71
AutomationClientAdapter.68=Config file example:\r\n\r\n
72
AutomationClientAdapter.69=\ \ workspace = c:\\myworkspace\r\n
73
AutomationClientAdapter.70=\ \ project = mytestproject\r\n
74
AutomationClientAdapter.71=\ \ suite = mysuite\r\n
75
AutomationClientAdapter.72=\ \ results = myresults\r\n
76
AutomationClientAdapter.73=\ \ overwrite = true\r\n\r\n
77
AutomationClientAdapter.74=Any supplied command line parameters values will override the value in the configuration file.  The minimal set of\r\nparameter values are a specified eclipse instance (usually automatic), the workspace to use, the project, and the name\r\nof a suite to run.  You may omit the ".testsuite" file extension.\r\n\r\n
78
AutomationClientAdapter.79=Use standard shell commands to redirect output to a file. For example, in a Windows command prompt, do the following\r\nto redirect output to a file:\r\n\r\n
79
AutomationClientAdapter.81=\ \ automation-client-adapter --help > c:\\mylog\\help.txt\r\n\r\n
80
AutomationClientAdapter.84=This help is available via --help, -help, -?, or ?\r\n
81
ParseCmdLineArgs.1=Error, {0} specified more than once on the command line.\r\n
82
ParseCmdLineArgs.3=Error, {0} specified more than once in the configfile.\r\n
83
ParseCmdLineArgs.5=The config file specified was not found: {0}\r\n
(-)src-automation-client/org/eclipse/hyades/automation/client/adapters/shell/Messages.java (-22 / +11 lines)
Lines 1-5 Link Here
1
/********************************************************************** 
1
/********************************************************************** 
2
 * Copyright (c) 2005 IBM Corporation and others. 
2
 * Copyright (c) 2005, 2008 IBM Corporation and others. 
3
 * All rights reserved.   This program and the accompanying materials 
3
 * All rights reserved.   This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0 
4
 * are made available under the terms of the Eclipse Public License v1.0 
5
 * which accompanies this distribution, and is available at 
5
 * which accompanies this distribution, and is available at 
Lines 9-43 Link Here
9
 * Contributors: 
9
 * Contributors: 
10
 * IBM - Initial API and implementation 
10
 * IBM - Initial API and implementation 
11
 **********************************************************************/
11
 **********************************************************************/
12
13
package org.eclipse.hyades.automation.client.adapters.shell;
12
package org.eclipse.hyades.automation.client.adapters.shell;
14
13
15
import java.util.MissingResourceException;
14
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
16
import java.util.ResourceBundle;
17
15
18
/**
16
/**
19
 * Message properties class for retrieving resource strings from resource
17
 * Message properties class for retrieving resource strings from resource
20
 * bundle. Currently, the shell automation client adapter has messages and
18
 * bundle. Currently, the shell automation client adapter has messages and
21
 * parameter names that are not localized (although this will be planned as
19
 * parameter names that are not localized (although this will be planned as
22
 * appropriate in future releases).
20
 * appropriate in future releases).
21
 * </p>
22
 * 
23
 * 
23
 * 
24
 * @author Duwayne J. Morris
24
 * @author     Duwayne J. Morris
25
 * @author Scott E. Schneider
25
 * @author     Scott E. Schneider
26
 * @author     Paul E. Slauenwhite
27
 * @version    April 25, 2008
28
 * @since      October 7, 2005
29
 * @deprecated As of TPTP 4.5.0, use {@link AutomationClientResourceBundle}.
26
 */
30
 */
27
class Messages {
31
class Messages {
28
32
29
	/**
33
	/**
30
	 * The name of the resource bundle associated with the shell automation
31
	 * client adapter
32
	 */
33
	private static final String BUNDLE_NAME = "org.eclipse.hyades.automation.client.adapters.shell.messages"; //$NON-NLS-1$
34
35
	/**
36
	 * The resource bundle associated with the shell automation client adapters.
37
	 */
38
	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
39
40
	/**
41
	 * Retrieves a string with the given key
34
	 * Retrieves a string with the given key
42
	 * 
35
	 * 
43
	 * @param key
36
	 * @param key
Lines 46-56 Link Here
46
	 * @return the message or string related to the given key
39
	 * @return the message or string related to the given key
47
	 */
40
	 */
48
	public static String getString(String key) {
41
	public static String getString(String key) {
49
		try {
42
		return (AutomationClientResourceBundle.getString(key));
50
			return RESOURCE_BUNDLE.getString(key);
51
		} catch (MissingResourceException e) {
52
			return '!' + key + '!';
53
		}
54
	}
43
	}
55
44
56
	/**
45
	/**
(-)src-automation-client/org/eclipse/hyades/automation/client/adapters/shell/AutomationClientAdapter.java (-71 / +68 lines)
Lines 1-5 Link Here
1
/********************************************************************** 
1
/********************************************************************** 
2
 * Copyright (c) 2006 IBM Corporation and others. 
2
 * Copyright (c) 2006, 2008 IBM Corporation and others. 
3
 * All rights reserved.   This program and the accompanying materials 
3
 * All rights reserved.   This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0 
4
 * are made available under the terms of the Eclipse Public License v1.0 
5
 * which accompanies this distribution, and is available at 
5
 * which accompanies this distribution, and is available at 
Lines 15-21 Link Here
15
import java.io.File;
15
import java.io.File;
16
import java.util.Properties;
16
import java.util.Properties;
17
17
18
import com.ibm.icu.text.MessageFormat;
18
import org.eclipse.hyades.automation.client.internal.resources.AutomationClientResourceBundle;
19
19
20
/**
20
/**
21
 * Shell automation client adapter -- provides a command line interface to the
21
 * Shell automation client adapter -- provides a command line interface to the
Lines 134-140 Link Here
134
				bError = true;
134
				bError = true;
135
			}
135
			}
136
			if (bError == true)
136
			if (bError == true)
137
				message.append(Messages.getString("AutomationClientAdapter.5") + //$NON-NLS-1$
137
				message.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.5") + //$NON-NLS-1$
138
						lineSeparator);
138
						lineSeparator);
139
139
140
		} else {
140
		} else {
Lines 142-149 Link Here
142
			if (!file.isDirectory()) {
142
			if (!file.isDirectory()) {
143
				Object[] obj = new Object[1];
143
				Object[] obj = new Object[1];
144
				obj[0] = eclipseHome;
144
				obj[0] = eclipseHome;
145
				message.append(MessageFormat.format((Messages
145
				message.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.6", obj));//$NON-NLS-1$
146
						.getString("AutomationClientAdapter.6")), obj));//$NON-NLS-1$
147
			}
146
			}
148
		}
147
		}
149
148
Lines 156-163 Link Here
156
				Object[] obj = new Object[1];
155
				Object[] obj = new Object[1];
157
				obj[0] = workspace;
156
				obj[0] = workspace;
158
				message
157
				message
159
						.append(MessageFormat.format((Messages
158
						.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.9", obj) + lineSeparator);//$NON-NLS-1$
160
								.getString("AutomationClientAdapter.9")), obj) + lineSeparator);//$NON-NLS-1$
161
			}
159
			}
162
		}
160
		}
163
161
Lines 190-197 Link Here
190
			Object[] obj = new Object[1];
188
			Object[] obj = new Object[1];
191
			obj[0] = args[1];
189
			obj[0] = args[1];
192
			System.out
190
			System.out
193
					.println(MessageFormat.format((Messages
191
					.println(AutomationClientResourceBundle.getString("AutomationClientAdapter.1", obj) + lineSeparator); //$NON-NLS-1$
194
							.getString("AutomationClientAdapter.1")), obj) + lineSeparator); //$NON-NLS-1$
195
		}
192
		}
196
193
197
		properties = new Properties();
194
		properties = new Properties();
Lines 209-215 Link Here
209
			fatalError = true;
206
			fatalError = true;
210
			message.insert(0, lineSeparator);
207
			message.insert(0, lineSeparator);
211
			message.append(lineSeparator
208
			message.append(lineSeparator
212
					+ Messages.getString("AutomationClientAdapter.0") + //$NON-NLS-1$
209
					+ AutomationClientResourceBundle.getString("AutomationClientAdapter.0") + //$NON-NLS-1$
213
					lineSeparator);
210
					lineSeparator);
214
			System.out.println(message);
211
			System.out.println(message);
215
		}
212
		}
Lines 241-306 Link Here
241
	 */
238
	 */
242
	private static void printHelp() {
239
	private static void printHelp() {
243
		StringBuffer bufHelp = new StringBuffer();
240
		StringBuffer bufHelp = new StringBuffer();
244
		bufHelp.append(Messages.getString("AutomationClientAdapter.21")); //$NON-NLS-1$
241
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.21")); //$NON-NLS-1$
245
		bufHelp.append(Messages.getString("AutomationClientAdapter.22")); //$NON-NLS-1$
242
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.22")); //$NON-NLS-1$
246
		bufHelp.append(Messages.getString("AutomationClientAdapter.221")); //$NON-NLS-1$
243
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.221")); //$NON-NLS-1$
247
		bufHelp.append(Messages.getString("AutomationClientAdapter.222")); //$NON-NLS-1$
244
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.222")); //$NON-NLS-1$
248
		bufHelp.append(Messages.getString("AutomationClientAdapter.25")); //$NON-NLS-1$
245
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.25")); //$NON-NLS-1$
249
		bufHelp.append(Messages.getString("AutomationClientAdapter.23")); //$NON-NLS-1$
246
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.23")); //$NON-NLS-1$
250
		bufHelp.append(Messages.getString("AutomationClientAdapter.26")); //$NON-NLS-1$
247
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.26")); //$NON-NLS-1$
251
		bufHelp.append(Messages.getString("AutomationClientAdapter.27")); //$NON-NLS-1$
248
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.27")); //$NON-NLS-1$
252
		bufHelp.append(Messages.getString("AutomationClientAdapter.28")); //$NON-NLS-1$
249
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.28")); //$NON-NLS-1$
253
		bufHelp.append(Messages.getString("AutomationClientAdapter.29")); //$NON-NLS-1$
250
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.29")); //$NON-NLS-1$
254
		bufHelp.append(Messages.getString("AutomationClientAdapter.30")); //$NON-NLS-1$
251
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.30")); //$NON-NLS-1$
255
		bufHelp.append(Messages.getString("AutomationClientAdapter.31")); //$NON-NLS-1$
252
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.31")); //$NON-NLS-1$
256
		bufHelp.append(Messages.getString("AutomationClientAdapter.59")); //$NON-NLS-1$
253
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.59")); //$NON-NLS-1$
257
		bufHelp.append(Messages.getString("AutomationClientAdapter.60")); //$NON-NLS-1$
254
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.60")); //$NON-NLS-1$
258
		bufHelp.append(Messages.getString("AutomationClientAdapter.61")); //$NON-NLS-1$
255
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.61")); //$NON-NLS-1$
259
		bufHelp.append(Messages.getString("AutomationClientAdapter.53")); //$NON-NLS-1$
256
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.53")); //$NON-NLS-1$
260
		bufHelp.append(Messages.getString("AutomationClientAdapter.54")); //$NON-NLS-1$
257
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.54")); //$NON-NLS-1$
261
		bufHelp.append(Messages.getString("AutomationClientAdapter.55")); //$NON-NLS-1$
258
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.55")); //$NON-NLS-1$
262
		bufHelp.append(Messages.getString("AutomationClientAdapter.32")); //$NON-NLS-1$
259
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.32")); //$NON-NLS-1$
263
		bufHelp.append(Messages.getString("AutomationClientAdapter.33")); //$NON-NLS-1$
260
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.33")); //$NON-NLS-1$
264
		bufHelp.append(Messages.getString("AutomationClientAdapter.34")); //$NON-NLS-1$
261
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.34")); //$NON-NLS-1$
265
		bufHelp.append(Messages.getString("AutomationClientAdapter.35")); //$NON-NLS-1$
262
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.35")); //$NON-NLS-1$
266
		bufHelp.append(Messages.getString("AutomationClientAdapter.36")); //$NON-NLS-1$
263
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.36")); //$NON-NLS-1$
267
		bufHelp.append(Messages.getString("AutomationClientAdapter.37")); //$NON-NLS-1$
264
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.37")); //$NON-NLS-1$
268
		bufHelp.append(Messages.getString("AutomationClientAdapter.41")); //$NON-NLS-1$
265
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.41")); //$NON-NLS-1$
269
		bufHelp.append(Messages.getString("AutomationClientAdapter.42")); //$NON-NLS-1$
266
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.42")); //$NON-NLS-1$
270
		bufHelp.append(Messages.getString("AutomationClientAdapter.43")); //$NON-NLS-1$
267
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.43")); //$NON-NLS-1$
271
		bufHelp.append(Messages.getString("AutomationClientAdapter.50")); //$NON-NLS-1$
268
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.50")); //$NON-NLS-1$
272
		bufHelp.append(Messages.getString("AutomationClientAdapter.51")); //$NON-NLS-1$
269
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.51")); //$NON-NLS-1$
273
		bufHelp.append(Messages.getString("AutomationClientAdapter.52")); //$NON-NLS-1$
270
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.52")); //$NON-NLS-1$
274
		bufHelp.append(Messages.getString("AutomationClientAdapter.44")); //$NON-NLS-1$
271
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.44")); //$NON-NLS-1$
275
		bufHelp.append(Messages.getString("AutomationClientAdapter.45")); //$NON-NLS-1$
272
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.45")); //$NON-NLS-1$
276
		bufHelp.append(Messages.getString("AutomationClientAdapter.46")); //$NON-NLS-1$
273
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.46")); //$NON-NLS-1$
277
		bufHelp.append(Messages.getString("AutomationClientAdapter.47")); //$NON-NLS-1$
274
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.47")); //$NON-NLS-1$
278
		bufHelp.append(Messages.getString("AutomationClientAdapter.48")); //$NON-NLS-1$
275
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.48")); //$NON-NLS-1$
279
		bufHelp.append(Messages.getString("AutomationClientAdapter.49")); //$NON-NLS-1$
276
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.49")); //$NON-NLS-1$
280
		bufHelp.append(Messages.getString("AutomationClientAdapter.88")); //$NON-NLS-1$
277
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.88")); //$NON-NLS-1$
281
		bufHelp.append(Messages.getString("AutomationClientAdapter.89")); //$NON-NLS-1$
278
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.89")); //$NON-NLS-1$
282
		bufHelp.append(Messages.getString("AutomationClientAdapter.90")); //$NON-NLS-1$
279
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.90")); //$NON-NLS-1$
283
		bufHelp.append(Messages.getString("AutomationClientAdapter.91")); //$NON-NLS-1$
280
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.91")); //$NON-NLS-1$
284
		bufHelp.append(Messages.getString("AutomationClientAdapter.92")); //$NON-NLS-1$
281
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.92")); //$NON-NLS-1$
285
		bufHelp.append(Messages.getString("AutomationClientAdapter.93")); //$NON-NLS-1$
282
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.93")); //$NON-NLS-1$
286
		bufHelp.append(Messages.getString("AutomationClientAdapter.94")); //$NON-NLS-1$
283
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.94")); //$NON-NLS-1$
287
		bufHelp.append(Messages.getString("AutomationClientAdapter.85")); //$NON-NLS-1$
284
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.85")); //$NON-NLS-1$
288
		bufHelp.append(Messages.getString("AutomationClientAdapter.86")); //$NON-NLS-1$
285
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.86")); //$NON-NLS-1$
289
		bufHelp.append(Messages.getString("AutomationClientAdapter.87")); //$NON-NLS-1$
286
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.87")); //$NON-NLS-1$
290
		bufHelp.append(Messages.getString("AutomationClientAdapter.62")); //$NON-NLS-1$
287
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.62")); //$NON-NLS-1$
291
		bufHelp.append(Messages.getString("AutomationClientAdapter.63")); //$NON-NLS-1$
288
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.63")); //$NON-NLS-1$
292
		bufHelp.append(Messages.getString("AutomationClientAdapter.66")); //$NON-NLS-1$
289
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.66")); //$NON-NLS-1$
293
		bufHelp.append(Messages.getString("AutomationClientAdapter.67")); //$NON-NLS-1$
290
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.67")); //$NON-NLS-1$
294
		bufHelp.append(Messages.getString("AutomationClientAdapter.68")); //$NON-NLS-1$
291
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.68")); //$NON-NLS-1$
295
		bufHelp.append(Messages.getString("AutomationClientAdapter.69")); //$NON-NLS-1$
292
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.69")); //$NON-NLS-1$
296
		bufHelp.append(Messages.getString("AutomationClientAdapter.70")); //$NON-NLS-1$
293
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.70")); //$NON-NLS-1$
297
		bufHelp.append(Messages.getString("AutomationClientAdapter.71")); //$NON-NLS-1$
294
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.71")); //$NON-NLS-1$
298
		bufHelp.append(Messages.getString("AutomationClientAdapter.72")); //$NON-NLS-1$
295
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.72")); //$NON-NLS-1$
299
		bufHelp.append(Messages.getString("AutomationClientAdapter.73")); //$NON-NLS-1$
296
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.73")); //$NON-NLS-1$
300
		bufHelp.append(Messages.getString("AutomationClientAdapter.74")); //$NON-NLS-1$
297
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.74")); //$NON-NLS-1$
301
		bufHelp.append(Messages.getString("AutomationClientAdapter.79")); //$NON-NLS-1$
298
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.79")); //$NON-NLS-1$
302
		bufHelp.append(Messages.getString("AutomationClientAdapter.81")); //$NON-NLS-1$
299
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.81")); //$NON-NLS-1$
303
		bufHelp.append(Messages.getString("AutomationClientAdapter.84")); //$NON-NLS-1$
300
		bufHelp.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.84")); //$NON-NLS-1$
304
		System.out.println(bufHelp);
301
		System.out.println(bufHelp);
305
	}
302
	}
306
303
Lines 310-316 Link Here
310
	 */
307
	 */
311
	private static void writeMessagesToUser() {
308
	private static void writeMessagesToUser() {
312
		if (message.length() > 0) {
309
		if (message.length() > 0) {
313
			message.append(Messages.getString("AutomationClientAdapter.18") + //$NON-NLS-1$
310
			message.append(AutomationClientResourceBundle.getString("AutomationClientAdapter.18") + //$NON-NLS-1$
314
					lineSeparator);
311
					lineSeparator);
315
			System.out.println(message);
312
			System.out.println(message);
316
		}
313
		}
(-)src-automation-core/org/eclipse/hyades/automation/core/internal/resources/AutomationCoreResourceBundle.java (-38 lines)
Removed Link Here
1
/**********************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * $Id: 
8
 * 
9
 * Contributors: 
10
 * IBM - Initial API and implementation
11
 **********************************************************************/
12
package org.eclipse.hyades.automation.core.internal.resources;
13
14
import org.eclipse.osgi.util.NLS;
15
16
/**
17
 * Automation core resource bundle.
18
 * <p>
19
 * 
20
 * 
21
 * @author      Tony Wang
22
 * @version     March 11, 2008
23
 * @since       March 11, 2008
24
 */
25
public final class AutomationCoreResourceBundle extends NLS {
26
27
	private static final String BUNDLE_NAME = "org.eclipse.hyades.automation.core.internal.resources.messages";//$NON-NLS-1$
28
29
	private AutomationCoreResourceBundle() {
30
		// Do not instantiate
31
	}
32
33
	public static String Guid_DUPLICATE_TIME_;
34
	
35
	static {
36
		NLS.initializeMessages(BUNDLE_NAME, AutomationCoreResourceBundle.class);
37
	}
38
}
(-)src-automation-core/org/eclipse/hyades/automation/core/internal/resources/messages.properties (-22 lines)
Removed Link Here
1
###############################################################################
2
# Copyright (c) 2008 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
6
# http://www.eclipse.org/legal/epl-v10.html
7
# $Id: messages.properties,v 1.3 2008/03/24 18:35:53 jkubasta Exp $ 
8
#
9
# Contributors:
10
#     IBM Corporation - initial API and implementation
11
###############################################################################
12
#
13
# messages.properties
14
#
15
# NOTE:  When using substitution parameters, all single quote characters (e.g. ') must be escaped with a preceding single quote character (e.g. ''text in single quotes'').
16
#
17
# NLS_MESSAGEFORMAT_VAR
18
# NLS_ENCODING=UTF-8
19
20
21
# Guid.java message(s):
22
Guid_DUPLICATE_TIME_ = \"{0}\" has been duplicated {1} time(s).
(-)src-automation-core/org/eclipse/hyades/automation/core/utils/Guid.java (-16 / +2 lines)
Lines 21-29 Link Here
21
import java.util.Hashtable;
21
import java.util.Hashtable;
22
import java.util.Random;
22
import java.util.Random;
23
23
24
import org.eclipse.hyades.automation.core.internal.resources.AutomationCoreResourceBundle;
25
import org.eclipse.osgi.util.NLS;
26
27
/**
24
/**
28
 * Abstract from IETF Specification:
25
 * Abstract from IETF Specification:
29
 * <p>
26
 * <p>
Lines 529-535 Link Here
529
526
530
	private static byte[] getByteArrayFromString(String s) {
527
	private static byte[] getByteArrayFromString(String s) {
531
		int dataLength = s.length();
528
		int dataLength = s.length();
532
		s += "  ";
529
		s += "  "; //$NON-NLS-1$
533
530
534
		String hcs = new String(hexChars);
531
		String hcs = new String(hexChars);
535
		byte[] data = new byte[dataLength / 2];
532
		byte[] data = new byte[dataLength / 2];
Lines 623-642 Link Here
623
		return (hexString.trim());
620
		return (hexString.trim());
624
	}
621
	}
625
622
626
	// /**
627
	// * Utility function. Must be empty for production build!
628
	// */
629
	// private static void debugPrint(String str)
630
	// {
631
	// System.out.println(str);
632
	// }
633
634
	/**
635
	 */
636
	public static void main(String[] args) {
623
	public static void main(String[] args) {
637
624
638
		Hashtable generatedGuids = new Hashtable();
625
		Hashtable generatedGuids = new Hashtable();
639
		String guid = "";
626
		String guid = ""; //$NON-NLS-1$
640
627
641
		for (int counter = 0; counter < 10; counter++) {
628
		for (int counter = 0; counter < 10; counter++) {
642
629
Lines 654-660 Link Here
654
641
655
		while (enumeration.hasMoreElements()) {
642
		while (enumeration.hasMoreElements()) {
656
			guid = ((String) (enumeration.nextElement()));
643
			guid = ((String) (enumeration.nextElement()));
657
			System.out.println(NLS.bind(AutomationCoreResourceBundle.Guid_DUPLICATE_TIME_, guid, generatedGuids.get(guid)));
658
		}
644
		}
659
	}
645
	}
660
}
646
}
(-)src-automation-client/org/eclipse/hyades/automation/client/internal/resources/AutomationClientResourceBundle.java (-26 / +179 lines)
Lines 11-53 Link Here
11
 **********************************************************************/
11
 **********************************************************************/
12
package org.eclipse.hyades.automation.client.internal.resources;
12
package org.eclipse.hyades.automation.client.internal.resources;
13
13
14
import java.text.MessageFormat;
15
import java.util.MissingResourceException;
16
import java.util.ResourceBundle;
17
14
import org.eclipse.osgi.util.NLS;
18
import org.eclipse.osgi.util.NLS;
15
19
16
/**
20
/**
17
 * Automation client resource bundle.
21
 * Automation client resource bundle.
18
 * <p>
22
 * <p/>
23
 * Message formatting is handled by either OSGi, ICU or Java, based on the following steps:
24
 * <p/>
25
 * <ol>
26
 * <li>If OSGi is available at run-time, message formatting is handled by {@link NLS#bind(String, Object[])}.</li>
27
 * <li>Otherwise, if ICU is available at run-time, message formatting is handled by {@link com.ibm.icu.text.MessageFormat#format(String, Object[])}.</li>
28
 * <li>Otherwise, message formatting is handled by {@link MessageFormat#format(String, Object[])}.</li>
29
 * </ol>
30
 * </p>
19
 * 
31
 * 
20
 * 
32
 * 
21
 * @author      Tony Wang
33
 * @author      Tony Wang
22
 * @version     March 12, 2008
34
 * @author      Paul E. Slauenwhite
35
 * @version     April 25, 2008
23
 * @since       March 12, 2008
36
 * @since       March 12, 2008
24
 */
37
 */
25
public final class AutomationClientResourceBundle extends NLS {
38
public final class AutomationClientResourceBundle {
39
    
40
	/**
41
     * Static flag for quickly determining if the
42
     * ICU classes are available on the class path.
43
     * <p/>
44
     * By default, the ICU classes are assumed to 
45
     * be available on the class path.
46
     */
47
    private static boolean isICUAvailable = true;
48
49
	/**
50
     * Static flag for quickly determining if the
51
     * OSGi classes are available on the class path.
52
     * <p/>
53
     * By default, the OSGi classes are assumed to 
54
     * be available on the class path.
55
     */
56
    private static boolean isOSGiAvailable = true;
57
58
	/**
59
     * The resource bundle.
60
     */
61
    protected static ResourceBundle resourceBundle = null;
26
62
63
	/**
64
     * The name of the resource bundle.
65
     */
27
	private static final String BUNDLE_NAME = "org.eclipse.hyades.automation.client.internal.resources.messages";//$NON-NLS-1$
66
	private static final String BUNDLE_NAME = "org.eclipse.hyades.automation.client.internal.resources.messages";//$NON-NLS-1$
28
67
29
	private AutomationClientResourceBundle() {
68
    /**
30
		// Do not instantiate
69
     * Resolves the localized message associated with the parameter <code>key</code>
31
	}
70
     * from the resource bundle.
32
71
     * <p/>
33
	public static String AutomationClientAdapter_ADDING_FILE_;
72
     * If the <code>key</code> does not exist in the resource bundle, the <code>key</code> 
34
	public static String AutomationClientAdapter_FILE_NOT_EXIST_;
73
     * is returned.
35
	public static String AutomationClientAdapter_NO_TEST_SPECIFIED_;
74
     * <p/>
36
	public static String AutomationClientAdapter_NO_PARAM_SPECIFIED_;
75
     * Noteworthy, the resultant message is not formatted (e.g. no message parameter substitution). 
37
	public static String AutomationClientAdapter_SPEICIFY_SOURCE_OF_TESTS_;
76
     * <p/>
38
	public static String AutomationClientAdapter_SPEICIFY_SOURCE_OF_RESULTS_;
77
     * 
39
	public static String AutomationClientAdapter_UNABLE_PARSE_DATETIME_;
78
     * @param key The <code>key</code> of the message in the resource bundle.
40
	public static String AutomationClientAdapter_INVALID_PROJECT_;
79
     * @return The localized message associated with the parameter <code>key</code> from the resource bundle, otherwise the <code>key</code>.
80
     */
81
    public static String getString(String key) {
82
            
83
    	if (resourceBundle == null ) {                
84
85
    		//Resolve the resource bundle:
86
    		try {
87
    			resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
88
    		}
89
    		catch (MissingResourceException m) {
90
    			return key;
91
    		}
92
    	}       
93
94
    	try{
95
    		return (resourceBundle.getString(key.trim()).trim());    
96
    	}
97
    	catch(Exception e){
98
    		//Ignore and return the key.
99
    	}
100
101
        return key;
102
    }
103
104
    /**
105
     * Resolves the localized and formatted message associated with the parameter <code>key</code>
106
     * and message parameter from the resource bundle.
107
     * <p/>
108
	 * Message formatting is handled by either OSGi, ICU or Java, based on the following steps:
109
     * <p/>
110
	 * <ol>
111
	 * <li>If OSGi is available at run-time, message formatting is handled by {@link NLS#bind(String, Object[])}.</li>
112
	 * <li>Otherwise, if ICU is available at run-time, message formatting is handled by {@link com.ibm.icu.text.MessageFormat#format(String, Object[])}.</li>
113
	 * <li>Otherwise, message formatting is handled by {@link MessageFormat#format(String, Object[])}.</li>
114
	 * </ol>
115
     * <p/>
116
     * If the <code>key</code> does not exist in the resource bundle, the <code>key</code> is
117
     * returned.
118
     * <p/>
119
     * 
120
     * @param key The <code>key</code> of the message in the resource bundle.
121
     * @param argument The first message parameter for formatting in the localized and formatted message.
122
     * @return The localized and formatted message associated with the parameter <code>key</code> from the resource bundle, otherwise the <code>key</code>.
123
     */
124
    public static String getString(String key, Object argument) {
125
        return (getString(key, new Object[] { argument}));
126
    }
127
128
    /**
129
     * Resolves the localized and formatted message associated with the parameter <code>key</code>
130
     * and message parameters from the resource bundle.
131
     * <p/>
132
	 * Message formatting is handled by either OSGi, ICU or Java, based on the following steps:
133
     * <p/>
134
	 * <ol>
135
	 * <li>If OSGi is available at run-time, message formatting is handled by {@link NLS#bind(String, Object[])}.</li>
136
	 * <li>Otherwise, if ICU is available at run-time, message formatting is handled by {@link com.ibm.icu.text.MessageFormat#format(String, Object[])}.</li>
137
	 * <li>Otherwise, message formatting is handled by {@link MessageFormat#format(String, Object[])}.</li>
138
	 * </ol>
139
     * <p/>
140
     * If the <code>key</code> does not exist in the resource bundle, the <code>key</code> is
141
     * returned.
142
     * <p/>
143
     * 
144
     * @param key The <code>key</code> of the message in the resource bundle.
145
     * @param argumentA The first message parameter for formatting in the localized and formatted message.
146
     * @param argumentB The second message parameter for formatting in the localized and formatted message.
147
     * @return The localized and formatted message associated with the parameter <code>key</code> from the resource bundle, otherwise the <code>key</code>.
148
     */
149
    public static String getString(String key, Object argumentA, Object argumentB) {
150
        return (getString(key, new Object[] { argumentA, argumentB}));
151
    }
152
153
    /**
154
     * Resolves the localized and formatted message associated with the parameter <code>key</code>
155
     * and message parameters from the resource bundle.
156
     * <p/>
157
	 * Message formatting is handled by either OSGi, ICU or Java, based on the following steps:
158
     * <p/>
159
	 * <ol>
160
	 * <li>If OSGi is available at run-time, message formatting is handled by {@link NLS#bind(String, Object[])}.</li>
161
	 * <li>Otherwise, if ICU is available at run-time, message formatting is handled by {@link com.ibm.icu.text.MessageFormat#format(String, Object[])}.</li>
162
	 * <li>Otherwise, message formatting is handled by {@link MessageFormat#format(String, Object[])}.</li>
163
	 * </ol>
164
     * <p/>
165
     * If the <code>key</code> does not exist in the resource bundle, the <code>key</code> is
166
     * returned.
167
     * <p/>
168
     * 
169
     * @param key The <code>key</code> of the message in the resource bundle.
170
     * @param arguments The array of message parameters for formatting in the localized and formatted message.
171
     * @return The localized and formatted message associated with the parameter <code>key</code> from the resource bundle, otherwise the <code>key</code>.
172
     */    public static String getString(String key, Object[] arguments) {
173
174
    	try {
175
	    	
176
    		if(isICUAvailable){
177
		    	
178
	    		try {
179
		    		return (NLS.bind(getString(key), arguments));
180
		    	} 
181
		    	catch (NoClassDefFoundError n) {
182
		    		
183
		    		//OSGi is not available at run-time, so try ICU.
184
		    		isICUAvailable = false;
185
		    	}
186
	    	}
41
	
187
	
42
    public static String AbstractExecutionStrategy_CONSOLE_REDIRECTION_;
188
	    	if(isOSGiAvailable){
43
    
189
		    	
44
    public static String OutOfProcessStrategy_AUTOMATION_SERVER_VALUE_;
190
	    		try {
45
    
191
	        		return (com.ibm.icu.text.MessageFormat.format(getString(key), arguments));
46
    public static String Test_AGENT_CONTROLLER_UP_;
192
	        	} 
47
    public static String Test_RESULTS_COLLECTED_;
193
	        	catch (NoClassDefFoundError n) {
48
    public static String Test_OVERALL_TEST_RESULT_VERDICT_;
194
	        		
49
    
195
	        		//OSGi is not available at run-time, so default to Java.
50
	static {
196
	        		isOSGiAvailable = false;
51
		NLS.initializeMessages(BUNDLE_NAME, AutomationClientResourceBundle.class);
197
	        	}
52
	}
198
	    	}
199
	
200
        	return (MessageFormat.format(getString(key), arguments));
201
		} 
202
		catch (Exception e) {
203
			return key;
204
		}
205
    }
53
}
206
}
(-)src-automation-client/org/eclipse/hyades/automation/client/internal/resources/messages.properties (+76 lines)
Lines 37-39 Link Here
37
Test_AGENT_CONTROLLER_UP_ = --> The agent controller is up and running
37
Test_AGENT_CONTROLLER_UP_ = --> The agent controller is up and running
38
Test_RESULTS_COLLECTED_ = --> Results collected: {0}
38
Test_RESULTS_COLLECTED_ = --> Results collected: {0}
39
Test_OVERALL_TEST_RESULT_VERDICT_ = --> Overall test result verdict: \"{0}\"
39
Test_OVERALL_TEST_RESULT_VERDICT_ = --> Overall test result verdict: \"{0}\"
40
41
# AutomationClientAdapter.java messages(s):
42
AutomationClientAdapter.0=Due to the above errors, no attempt was made to run a test, there are no results to view.
43
AutomationClientAdapter.1=\r\nTEST COMMENT: {0}
44
AutomationClientAdapter.5=Error, eclipse was not specified and was not found automatically.
45
AutomationClientAdapter.6=Error, the path given for eclipsehome: {0}, is not a valid directory.\r\n
46
AutomationClientAdapter.9=Error, the path given for workspace: {0}, is not a valid directory.
47
AutomationClientAdapter.18=\nDue to the above errors, no attempt was made to run a test, there are no results to view.
48
AutomationClientAdapter.19=Parameters accepted, starting the test run.
49
AutomationClientAdapter.20=Error, a required jar file was not found: {0}
50
AutomationClientAdapter.21=\r\nTPTP 4.1.0 Automation Client Adapter Help\r\n\r\n
51
AutomationClientAdapter.22=Automatable services published through the automatable services framework are available for command through this\r\n
52
AutomationClientAdapter.221=command line interface.  The test execution service has named and more strongly typed parameters than the invocation\r\n
53
AutomationClientAdapter.222=of an arbitrary published automatable service although both can be commanded and thus executed through this interface.\r\n\r\n
54
AutomationClientAdapter.23=\ \ usage: automation-client-adapter -parm1 <parm1value> -parm2 <parm2value> (etc...)\r\n\r\n
55
AutomationClientAdapter.25=Below is the usage definition and valid named parameters that may be used in any order (values containing spaces\r\nmust be in quotes):\r\n\r\n
56
AutomationClientAdapter.26=\ \ -configfile <directorypath>\r\n
57
AutomationClientAdapter.27=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Specify command line parameters via a user supplied config file.\r\n
58
AutomationClientAdapter.28=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -configfile .\\example.config\r\n
59
AutomationClientAdapter.29=\ \ -eclipse <directorypath>\r\n
60
AutomationClientAdapter.30=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the full path to eclipse, usually detected automatically.\r\n
61
AutomationClientAdapter.31=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -eclipse "C:\\eclipse"\r\n
62
AutomationClientAdapter.32=\ \ -workspace <directorypath>\r\n
63
AutomationClientAdapter.33=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the full path to the desired workspace.\r\n
64
AutomationClientAdapter.34=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -workspace c:\\workspace\r\n
65
AutomationClientAdapter.35=\ \ -project <relativedirectorypath>\r\n
66
AutomationClientAdapter.36=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the location of the desired project relative to the workspace.\r\n
67
AutomationClientAdapter.37=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -project testproj\r\n
68
AutomationClientAdapter.41=\ \ -suite <relativefilepath>\r\n
69
AutomationClientAdapter.42=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the location of the test suite to run relative to the project.\r\n
70
AutomationClientAdapter.43=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ examples: -suite mytest OR -suite tests\\mytest\r\n
71
AutomationClientAdapter.44=\ \ -results <relativefilepath>\r\n
72
AutomationClientAdapter.45=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the namepath for the results relative to the project.\r\n
73
AutomationClientAdapter.46=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ examples: -result myresults OR -result results\\myresults\r\n
74
AutomationClientAdapter.47=\ \ -overwrite <true or false>\r\n
75
AutomationClientAdapter.48=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ if "true" the specified results will be overwritten.\r\n
76
AutomationClientAdapter.49=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -overwrite true  (default is false).\r\n
77
AutomationClientAdapter.50=\ \ -deployment <relativefilepath>\r\n
78
AutomationClientAdapter.51=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the namepath for the deployment relative to the project.\r\n
79
AutomationClientAdapter.52=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ examples: -deployment mydeployment OR -deployment deployments\\mydeployment\r\n
80
AutomationClientAdapter.85=\ \ -configuration <relativefilepath>\r\n
81
AutomationClientAdapter.86=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the namepath for the launch configuration relative to the project.\r\n
82
AutomationClientAdapter.87=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ examples: -configuration mylaunch.launch OR -configuration launches\\mylaunch.launch.\r\n
83
AutomationClientAdapter.88=\ \ -connection <connectionstring>\r\n
84
AutomationClientAdapter.89=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specify the connection string specifying the agent controller to use.\r\n
85
AutomationClientAdapter.90=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ format:  <specification>:<class>://<host>:<port>/<instance>?user=<user>&password=<password>\r\n
86
AutomationClientAdapter.91=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -connection tptp:rac://server.rtp.ibm.com:10002/default\r\n
87
AutomationClientAdapter.92=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -connection tptp:iac://localhost/default\r\n
88
AutomationClientAdapter.93=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -connection server.rtp.ibm.com\r\n
89
AutomationClientAdapter.94=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -connection localhost:11010\r\n
90
AutomationClientAdapter.53=\ \ -vmargs  <string of VM args>\r\n
91
AutomationClientAdapter.54=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ The JVM arguments specified will be used in launching the Eclipse instance.\r\n
92
AutomationClientAdapter.55=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ example: -vmargs "-Xmx756 -Xquickstart"\r\n
93
AutomationClientAdapter.59=\ \ -service <servicename>\r\n
94
AutomationClientAdapter.60=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Rather than running test execution service, this\r\n
95
AutomationClientAdapter.61=\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ specifies running another published automatable service.\r\n
96
AutomationClientAdapter.62=\r\nA simple and typical usage example:\r\n\r\n
97
AutomationClientAdapter.63=\ \ automation-client-adapter -workspace c:\\myworkspace -project myproj -suite mytest\r\n
98
AutomationClientAdapter.66=\r\nIn a configfile, any of the above may be specified as a name=value pair.  There are no leading hyphens permitted\r\nbetween name and value.
99
AutomationClientAdapter.67=Each name=value pair must be on a separate line.  Extra spaces around the name and value are\r\naccepted.\r\n\r\n
100
AutomationClientAdapter.68=Config file example:\r\n\r\n
101
AutomationClientAdapter.69=\ \ workspace = c:\\myworkspace\r\n
102
AutomationClientAdapter.70=\ \ project = mytestproject\r\n
103
AutomationClientAdapter.71=\ \ suite = mysuite\r\n
104
AutomationClientAdapter.72=\ \ results = myresults\r\n
105
AutomationClientAdapter.73=\ \ overwrite = true\r\n\r\n
106
AutomationClientAdapter.74=Any supplied command line parameters values will override the value in the configuration file.  The minimal set of\r\nparameter values are a specified eclipse instance (usually automatic), the workspace to use, the project, and the name\r\nof a suite to run.  You may omit the ".testsuite" file extension.\r\n\r\n
107
AutomationClientAdapter.79=Use standard shell commands to redirect output to a file. For example, in a Windows command prompt, do the following\r\nto redirect output to a file:\r\n\r\n
108
AutomationClientAdapter.81=\ \ automation-client-adapter --help > c:\\mylog\\help.txt\r\n\r\n
109
AutomationClientAdapter.84=This help is available via --help, -help, -?, or ?\r\n
110
111
# CommandLineArgumentParser.java message(s):
112
ParseCmdLineArgs.1=Error, {0} specified more than once on the command line.\r\n
113
ParseCmdLineArgs.3=Error, {0} specified more than once in the configfile.\r\n
114
ParseCmdLineArgs.5=The config file specified was not found: {0}\r\n
115

Return to bug 228873