This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 208476
Collapse All | Expand All

(-)selenium.server/src/org/netbeans/modules/selenium/server/Bundle.properties (+7 lines)
Lines 18-20 Link Here
18
displayName_Startup=Start on NetBeans startup
18
displayName_Startup=Start on NetBeans startup
19
desc_Startup=start server on NetBeans startup or not. Note \
19
desc_Startup=start server on NetBeans startup or not. Note \
20
that server must be running to run Selenium tests correctly.
20
that server must be running to run Selenium tests correctly.
21
22
displayName_FirefoxProfile=Firefox Profile
23
desc_FirefoxProfile=The profile directory for Firefox
24
25
displayName_SingleWindow=Single Window
26
desc_SingleWindow=Should the browser started by selenium server use <br/> \
27
multiple frames in a single window or multiple windows. 
(-)selenium.server/src/org/netbeans/modules/selenium/server/SeleniumProperties.java (+24 lines)
Lines 64-69 Link Here
64
    public static int seleniumDefaultPort = -1;
64
    public static int seleniumDefaultPort = -1;
65
    public static final String PORT = "Port";
65
    public static final String PORT = "Port";
66
    public static final String START_ON_STARTUP = "Startup";
66
    public static final String START_ON_STARTUP = "Startup";
67
    public static final String FIREFOX_PROFILE = "FirefoxProfile";
68
    public static final String SINGLE_WINDOW = "SingleWindow";
67
    private static InstanceProperties instanceProps;
69
    private static InstanceProperties instanceProps;
68
    private static final String NAMESPACE = "Selenium server properties namespace"; //NOI18N
70
    private static final String NAMESPACE = "Selenium server properties namespace"; //NOI18N
69
71
Lines 73-78 Link Here
73
        Set set = sheet.get(Sheet.PROPERTIES);
75
        Set set = sheet.get(Sheet.PROPERTIES);
74
        set.put(new ServerIntProperty(PORT, props));
76
        set.put(new ServerIntProperty(PORT, props));
75
        set.put(new ServerBoolProperty(START_ON_STARTUP, props));
77
        set.put(new ServerBoolProperty(START_ON_STARTUP, props));
78
        set.put(new ServerStringProperty(FIREFOX_PROFILE, props));
79
        set.put(new ServerBoolProperty(SINGLE_WINDOW, props));
76
        return sheet;
80
        return sheet;
77
    }
81
    }
78
82
Lines 114-119 Link Here
114
                    instanceProps = manager.createProperties(NAMESPACE);
118
                    instanceProps = manager.createProperties(NAMESPACE);
115
                    instanceProps.putInt(PORT, getSeleniumDefaultPort());
119
                    instanceProps.putInt(PORT, getSeleniumDefaultPort());
116
                    instanceProps.putBoolean(START_ON_STARTUP, true);
120
                    instanceProps.putBoolean(START_ON_STARTUP, true);
121
                    instanceProps.putString(FIREFOX_PROFILE	, "");
122
                    instanceProps.putBoolean(SINGLE_WINDOW	, false);
117
                    allProps.add(instanceProps);
123
                    allProps.add(instanceProps);
118
                }
124
                }
119
            }
125
            }
Lines 161-168 Link Here
161
167
162
    }
168
    }
163
169
170
    private static final class ServerStringProperty extends ServerProperty<String> {
164
171
172
        public ServerStringProperty(String propertyName, InstanceProperties props) {
173
            super(String.class, propertyName, props);
174
        }
165
175
176
        @Override
177
        public String getValue() throws IllegalAccessException, InvocationTargetException {
178
            return props.getString(getName(), "");
179
        }
180
181
        @Override
182
        protected void writeNewValue(String val) {
183
            props.putString(getName(), val);
184
        }
185
186
    }
187
188
189
166
    private static abstract class ServerProperty<T> extends Node.Property<T>{
190
    private static abstract class ServerProperty<T> extends Node.Property<T>{
167
191
168
        protected InstanceProperties props;
192
        protected InstanceProperties props;
(-)selenium.server/src/org/netbeans/modules/selenium/server/SeleniumServerRunner.java (+16 lines)
Lines 42-47 Link Here
42
42
43
import java.beans.PropertyChangeEvent;
43
import java.beans.PropertyChangeEvent;
44
import java.beans.PropertyChangeListener;
44
import java.beans.PropertyChangeListener;
45
import java.io.File;
45
import java.lang.reflect.InvocationTargetException;
46
import java.lang.reflect.InvocationTargetException;
46
import java.net.BindException;
47
import java.net.BindException;
47
import java.net.MalformedURLException;
48
import java.net.MalformedURLException;
Lines 192-197 Link Here
192
                SeleniumProperties.getSeleniumDefaultPort()); //NOI18N
193
                SeleniumProperties.getSeleniumDefaultPort()); //NOI18N
193
        remoteControlConfiguration.getMethod("setPort", int.class).invoke(
194
        remoteControlConfiguration.getMethod("setPort", int.class).invoke(
194
                remoteControlConfigurationInstance, port); //NOI18N
195
                remoteControlConfigurationInstance, port); //NOI18N
196
        boolean runInSingleWindow = ip.getBoolean(
197
                SeleniumProperties.SINGLE_WINDOW,
198
                false); //NOI18N
199
        remoteControlConfiguration.getMethod("setSingleWindow", boolean.class).invoke(
200
                remoteControlConfigurationInstance, runInSingleWindow); //NOI18N
201
		String firefoxProfileDir = ip.getString(
202
                SeleniumProperties.FIREFOX_PROFILE,
203
                "");
204
		if (!"".equals(firefoxProfileDir)) {
205
				File ffProfileDir = new File(firefoxProfileDir);
206
				if (ffProfileDir.exists()) {
207
					remoteControlConfiguration.getMethod("setFirefoxProfileTemplate", File.class).invoke(
208
						remoteControlConfigurationInstance, ffProfileDir); //NOI18N	
209
				}
210
		}
195
        server = seleniumServer.getConstructor(remoteControlConfiguration).
211
        server = seleniumServer.getConstructor(remoteControlConfiguration).
196
                newInstance(remoteControlConfigurationInstance);
212
                newInstance(remoteControlConfigurationInstance);
197
    }
213
    }

Return to bug 208476