protected String retrieveSessionId(HttpParameters parameters) { final String sessionId = parameters.get("sessionId"); if (null == sessionId) { throw new CommandParsingException("ERROR: No sessionId provided. Most likely your original newBrowserSession command failed."); } return sessionId; } }
protected String retrieveSessionId(HttpParameters parameters) { final String sessionId = parameters.get("sessionId"); if (null == sessionId) { throw new CommandParsingException("ERROR: No sessionId provided. Most likely your original newBrowserSession command failed."); } return sessionId; } }
public SeleneseCommand parse(EnvironmentManager environmentManager) { final String command = parameters.get("cmd"); if (command.equals(NEW_BROWSER_SESSION)) { final Environment environment; final String environmentName; environmentName = parameters.get("1"); environment = environmentManager.environment(environmentName); if (null == environment) { throw new CommandParsingException("ERROR: Unknown environment '" + environmentName + "'"); } parameters.put("1", environment.browser()); return new NewBrowserSessionCommand(environment, parameters); } else if (command.equals(TEST_COMPLETE)) { return new TestCompleteCommand(retrieveSessionId(parameters), parameters); } else { return new SeleneseCommand(retrieveSessionId(parameters), parameters); } }
public SeleneseCommand parse(EnvironmentManager environmentManager) { final String command = parameters.get("cmd"); if (command.equals(NEW_BROWSER_SESSION)) { final Environment environment; final String environmentName; environmentName = parameters.get("1"); environment = environmentManager.environment(environmentName); if (null == environment) { throw new CommandParsingException("ERROR: Unknown environment '" + environmentName + "'"); } parameters.put("1", environment.browser()); return new NewBrowserSessionCommand(environment, parameters); } else if (command.equals(TEST_COMPLETE)) { return new TestCompleteCommand(retrieveSessionId(parameters), parameters); } else { return new SeleneseCommand(retrieveSessionId(parameters), parameters); } }