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 109880
Collapse All | Expand All

(-)AutoGUIExecObjAdapter.java (-3 / +53 lines)
Lines 11-21 Link Here
11
 **********************************************************************/
11
 **********************************************************************/
12
package org.eclipse.tptp.test.auto.gui.internal.runner;
12
package org.eclipse.tptp.test.auto.gui.internal.runner;
13
13
14
import org.eclipse.emf.common.util.EList;
14
import org.eclipse.hyades.execution.core.IExecutableObject;
15
import org.eclipse.hyades.execution.core.IExecutableObject;
15
import org.eclipse.hyades.execution.harness.IExecutableObjectAdapter;
16
import org.eclipse.hyades.execution.harness.IExecutableObjectAdapter;
16
import org.eclipse.hyades.execution.harness.XMLExecutionDataProcessor;
17
import org.eclipse.hyades.execution.harness.XMLExecutionDataProcessor;
17
import org.eclipse.hyades.execution.local.JavaProcessExecutableObjectStub;
18
import org.eclipse.hyades.execution.local.JavaProcessExecutableObjectStub;
18
import org.eclipse.hyades.models.common.configuration.CFGClass;
19
import org.eclipse.hyades.models.common.configuration.CFGClass;
20
import org.eclipse.hyades.models.common.configuration.CFGComparableProperty;
21
import org.eclipse.hyades.models.common.configuration.CFGConfigurableObject;
22
import org.eclipse.hyades.models.common.configuration.CFGPropertyGroup;
19
import org.eclipse.hyades.models.common.facades.behavioral.IImplementor;
23
import org.eclipse.hyades.models.common.facades.behavioral.IImplementor;
20
import org.eclipse.hyades.models.common.testprofile.TPFDeployment;
24
import org.eclipse.hyades.models.common.testprofile.TPFDeployment;
21
25
Lines 27-32 Link Here
27
 */
31
 */
28
public class AutoGUIExecObjAdapter implements IExecutableObjectAdapter
32
public class AutoGUIExecObjAdapter implements IExecutableObjectAdapter
29
{
33
{
34
	
35
	// TODO: where are these strings really defined?
36
	public static final String WORKSPACE_DIRECTORY = "workspaceDirectory";
37
	public static final String PROGRAM_ARGUMENTS = "programArguments";
38
	public static final String VM_ARGUMENTS = "vmArguments";
39
	
30
	/**
40
	/**
31
	 * @see org.eclipse.hyades.execution.harness.IExecutableObjectAdapter#setupExecutableObject(org.eclipse.hyades.execution.core.IExecutableObject, org.eclipse.hyades.models.common.testprofile.TPFTestSuite, org.eclipse.hyades.models.common.testprofile.TPFTest)
41
	 * @see org.eclipse.hyades.execution.harness.IExecutableObjectAdapter#setupExecutableObject(org.eclipse.hyades.execution.core.IExecutableObject, org.eclipse.hyades.models.common.testprofile.TPFTestSuite, org.eclipse.hyades.models.common.testprofile.TPFTest)
32
	 */
42
	 */
Lines 51-64 Link Here
51
		jvmArgs += "-Dtptp.automated.gui.executor=" + XMLExecutionDataProcessor.IID + " ";  
61
		jvmArgs += "-Dtptp.automated.gui.executor=" + XMLExecutionDataProcessor.IID + " ";  
52
		
62
		
53
		/* The runner */
63
		/* The runner */
54
		jvmArgs += "org.eclipse.core.launcher.Main -clean -data ";
55
		jvmArgs += "TPTP-Auto-Workspace-" + System.currentTimeMillis();	
56
		
64
		
57
		//jvmArgs += "org.eclipse.hyades.test.tools.ui.auto.gui.internal.runner.RunnerWrapper ";
65
		String workspaceDirectory = "TPTP-Auto-Workspace-" + System.currentTimeMillis();
66
		String programArguments = "";
67
		String vmArguments = "";
58
68
69
		// NOTE: Code stolen from AutoGUIExecObjAdapter, seems like this
70
		// should be consolidated into the TPFDeployment interface.
59
		
71
		
72
		// Dig out a workspaceDirectory, programArguments and vmArguments from the deployment.
73
		EList locations = deployment.getRefLocations();
74
		boolean searchingForContext = true;
75
		if (locations != null && locations.size() > 0)
76
		{
77
			/* For every location */
78
			OUTER:	
79
			for (int i = 0, locationSize = locations.size(); i < locationSize && searchingForContext; i++)
80
			{
81
				EList propertyGroups = ((CFGConfigurableObject)locations.get(i)).getPropertyGroups();
82
				/* For every property group */
83
				for (int j = 0, propertyGroupSize = propertyGroups.size(); j < propertyGroupSize && searchingForContext; j++)
84
				{
85
					EList properties = ((CFGPropertyGroup)propertyGroups.get(j)).getProperties();
86
					
87
					/* For every property in a property group */
88
					for (int k = 0, propertiesSize = properties.size(); k < propertiesSize;k++)
89
					{
90
						CFGComparableProperty currentProperty = (CFGComparableProperty)properties.get(k);
91
						String name = currentProperty.getName();
92
						String value = currentProperty.getValue();
93
						System.out.println("property=" + currentProperty.getName() + ",value=" + currentProperty.getValue());
94
						if (WORKSPACE_DIRECTORY.equals(name))
95
						{
96
							workspaceDirectory = currentProperty.getValue() + " ";
97
						} else if (PROGRAM_ARGUMENTS.equals(name)) {
98
							programArguments = value + " ";
99
						} else if (VM_ARGUMENTS.equals(name)) {
100
							vmArguments = value + " ";
101
						}
102
					}
103
				}
104
			}
105
		}
106
		jvmArgs += vmArguments + "org.eclipse.core.launcher.Main -data " + workspaceDirectory + programArguments;
107
60
		objectStub.setArgs(jvmArgs); //$NON-NLS-1$
108
		objectStub.setArgs(jvmArgs); //$NON-NLS-1$
61
		
109
		
110
		//jvmArgs += "org.eclipse.hyades.test.tools.ui.auto.gui.internal.runner.RunnerWrapper ";
111
		
62
		/* Send over the script */
112
		/* Send over the script */
63
		objectStub.setAgentData(theImplementor.getResource());
113
		objectStub.setAgentData(theImplementor.getResource());
64
		
114
		

Return to bug 109880