Projects >> operaprestodriver >>786dcf20c95f4ade921762069a4cd191222c79b1

Chunk
Conflicting content
	 *
	 * @param settings settings for binary path to Opera, prefs directory, and arguments
	 */
<<<<<<< HEAD
  @Deprecated
	public OperaDesktopDriver(OperaDriverSettings settings) {
		this(settings.getCapabilities());
	}

	/**
	 * Constructor that starts Opera if it's not running.
	 *
	 * @param c Settings for binary path to Opera, prefs directory, arguments and more.
	 */
=======
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
	public OperaDesktopDriver(DesiredCapabilities c) {
		// OperaDriver constructor will initialize services and start Opera
		// if the binaryPath is set in settings (by calling init in OperaDriver)
Solution content
	 *
	 * @param settings settings for binary path to Opera, prefs directory, and arguments
	 */
  @Deprecated
	public OperaDesktopDriver(OperaDriverSettings settings) {
		this(settings.getCapabilities());
	}

	/**
	 * Constructor that starts Opera if it's not running.
	 *
	 * @param c Settings for binary path to Opera, prefs directory, arguments and more.
	 */
	public OperaDesktopDriver(DesiredCapabilities c) {
		// OperaDriver constructor will initialize services and start Opera
		// if the binaryPath is set in settings (by calling init in OperaDriver)
File
OperaDesktopDriver.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Method declaration
Chunk
Conflicting content
  /**

public class OperaDriver extends RemoteWebDriver implements TakesScreenshot {

<<<<<<< HEAD
  // Want to thin some of these out, but will need some re-thinking.

  /**
   * (String) Path to the Opera binary to use.
   */
  public static final String BINARY = "opera.binary";

  /**
   * (String) The host Opera should connect to. Unless you're starting Opera
   * manually you won't need this.
   */
  public static final String HOST = "opera.host";

  /**
   * (Integer) The port to Opera should connect to. 0 = Random,
   * -1 = Opera default (for use with Opera < 12)
   */
  public static final String PORT = "opera.port";

  /**
   * (String) Path to the launcher binary to use.
   */
  public static final String LAUNCHER = "opera.launcher";

  /**
   * (String) Arguments to pass to Opera, separated by spaces.
   */
  public static final String ARGUMENTS = "opera.arguments";

  /**
   * (Boolean) Whether to use Opera idle.
   */
  public static final String USE_OPERAIDLE = "opera.use_operaidle";

  /**
   * (Integer) The X display to use.  (Only works on *nix OSes.)
   */
  public static final String DISPLAY = "opera.display";

  /**
   * (Boolean) Whether to auto-start Opera.
   */
  public static final String AUTOSTART = "opera.autostart";

   * (Boolean) Whether to restart.
   */
  public static final String NO_RESTART = "opera.no_restart";

  /**
   * (Boolean) Whether to quit Opera when OperaDriver is shut down.
   */
  public static final String NO_QUIT = "opera.no_quit";

  /**
   * (Boolean) Whether to guess the path to Opera if it isn't set in
   * opera.binary.
   */
  public static final String GUESS_BINARY_PATH = "opera.guess_binary_path";

  /**
   * (String) The profile configuration we are using, for example
   * "desktop" or "core-gogi".
   */
  public static final String BINARY_PROFILE = "opera.binary_profile";
=======
  // Want to this some of these out, but will need some rethinking.
  public static final String BINARY = "binary";
  public static final String LAUNCHER = "launcher";
  public static final String LAUNCHER_PORT = "launcher_port";
  public static final String ARGUMENTS = "arguments";
  public static final String USE_OPERAIDLE = "use_operaide";
  public static final String DISPLAY = "display";

  public static final String AUTOSTART = "autostart";
  public static final String RUN_LAUNCHER = "run_launcher";
  public static final String NO_RESTART = "no_restart";
  public static final String NO_QUIT = "no_quit";
  public static final String GUESS_BINARY_PATH = "guess_binary_path";
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2

  /*
   * These are "protected" and not "private" so that we can extend this class
Solution content
public class OperaDriver extends RemoteWebDriver implements TakesScreenshot {

  // Want to thin some of these out, but will need some re-thinking.

  /**
   * (String) Path to the Opera binary to use.
   */
  public static final String BINARY = "opera.binary";

  /**
   * (String) The host Opera should connect to. Unless you're starting Opera
   * manually you won't need this.
   */
  public static final String HOST = "opera.host";

  /**
   * (Integer) The port to Opera should connect to. 0 = Random,
   * -1 = Opera default (for use with Opera < 12)
   */
  public static final String PORT = "opera.port";

  /**
   * (String) Path to the launcher binary to use.
   */
  public static final String LAUNCHER = "opera.launcher";

  /**
   * (String) Arguments to pass to Opera, separated by spaces.
   */
  public static final String ARGUMENTS = "opera.arguments";

  /**
   * (Boolean) Whether to use Opera idle.
   */
  public static final String USE_OPERAIDLE = "opera.use_operaidle";

  /**
   * (Integer) The X display to use.  (Only works on *nix OSes.)
   */
  public static final String DISPLAY = "opera.display";

  /**
   * (Boolean) Whether to auto-start Opera.
   */
  public static final String AUTOSTART = "opera.autostart";

  /**
   * (Boolean) Whether to restart.
   */
  public static final String NO_RESTART = "opera.no_restart";

  /**
   * (Boolean) Whether to quit Opera when OperaDriver is shut down.
   */
  public static final String NO_QUIT = "opera.no_quit";

  /**
   * (Boolean) Whether to guess the path to Opera if it isn't set in
   * opera.binary.
   */
  public static final String GUESS_BINARY_PATH = "opera.guess_binary_path";

  /**
   * (String) The profile configuration we are using, for example
   * "desktop" or "core-gogi".
   */
  public static final String BINARY_PROFILE = "opera.binary_profile";

  /*
   * These are "protected" and not "private" so that we can extend this class
File
OperaDriver.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
  public OperaDriver() {
    this((DesiredCapabilities) null);
<<<<<<< HEAD
  }

  @Deprecated
  public OperaDriver(OperaDriverSettings settings) {
    this(settings.getCapabilities());
=======
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
  }

  /**
Solution content
  public OperaDriver() {
    this((DesiredCapabilities) null);
  }

  @Deprecated
  public OperaDriver(OperaDriverSettings settings) {
    this(settings.getCapabilities());
  }

  /**
File
OperaDriver.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method invocation
Method signature
Chunk
Conflicting content
   */
  public OperaDriver(DesiredCapabilities c) {
    capabilities = getDefaultCapabilities();
<<<<<<< HEAD

    if (c != null) {
      capabilities.merge(c);
    }

    if ((Boolean) capabilities.getCapability(AUTOSTART)) {
        OperaPaths paths = new OperaPaths();

      if (((Boolean) capabilities.getCapability(GUESS_BINARY_PATH)) &&
          capabilities.getCapability(BINARY) == null) {
        capabilities.setCapability(BINARY, paths.operaPath());
      } else if (capabilities.getCapability(BINARY) == null) {
          // Don't guess, only check environment variable
          String path = System.getenv("OPERA_PATH");

          if (path != null && path.length() > 0) {
          capabilities.setCapability(BINARY, path);
          }
        }

      if (capabilities.getCapability(LAUNCHER) == null) {
        capabilities.setCapability(LAUNCHER, paths.launcherPath());
        }

      // If port is 0, try to find a random port.
      if ((Integer) capabilities.getCapability(PORT) == 0) {
        capabilities.setCapability(PORT, PortProber.findFreePort());
      }

      if (capabilities.getCapability(BINARY) != null) {
        this.operaRunner = new OperaLauncherRunner(capabilities);
        }
    } else {
      // If we're not autostarting then we don't want to randomise the port.
      capabilities.setCapability(PORT, -1);
=======

    if (c != null) {
      capabilities.merge(c);
    }

    if ((Boolean) capabilities.getCapability(AUTOSTART)) {
      OperaPaths paths = new OperaPaths();

      if (((Boolean) capabilities.getCapability(GUESS_BINARY_PATH)) &&
          capabilities.getCapability(BINARY) == null) {
        capabilities.setCapability(BINARY, paths.operaPath());
      } else if (capabilities.getCapability(BINARY) == null) {
        // Don't guess, only check environment variable
        String path = System.getenv("OPERA_PATH");

        if (path != null && path.length() > 0) {
          capabilities.setCapability(BINARY, path);
        }
      }

      if (capabilities.getCapability(LAUNCHER) == null) {
        capabilities.setCapability(LAUNCHER, paths.launcherPath());
      }

      if (capabilities.getCapability(BINARY) != null) {
        this.operaRunner = new OperaLauncherRunner(capabilities);
      }
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
    }

    start();
Solution content
   */
  public OperaDriver(DesiredCapabilities c) {
    capabilities = getDefaultCapabilities();

    if (c != null) {
      capabilities.merge(c);
    }

    if ((Boolean) capabilities.getCapability(AUTOSTART)) {
        OperaPaths paths = new OperaPaths();

      if (((Boolean) capabilities.getCapability(GUESS_BINARY_PATH)) &&
          capabilities.getCapability(BINARY) == null) {
        capabilities.setCapability(BINARY, paths.operaPath());
      } else if (capabilities.getCapability(BINARY) == null) {
          // Don't guess, only check environment variable
          String path = System.getenv("OPERA_PATH");

          if (path != null && path.length() > 0) {
          capabilities.setCapability(BINARY, path);
          }
        }

      if (capabilities.getCapability(LAUNCHER) == null) {
        capabilities.setCapability(LAUNCHER, paths.launcherPath());
        }

      // If port is 0, try to find a random port.
      if ((Integer) capabilities.getCapability(PORT) == 0) {
        capabilities.setCapability(PORT, PortProber.findFreePort());
      }

      if (capabilities.getCapability(BINARY) != null) {
        this.operaRunner = new OperaLauncherRunner(capabilities);
        }
    } else {
      // If we're not autostarting then we don't want to randomise the port.
      capabilities.setCapability(PORT, -1);
    }

    start();
File
OperaDriver.java
Developer's decision
Version 1
Kind of conflict
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
    capabilities.setJavascriptEnabled(true);

    capabilities.setCapability(BINARY, (String) null);
<<<<<<< HEAD
    // Default = 127.0.0.1, but need to set to null for backwards compat.
    // with Opera versions that don't support -autotestmode host:port
    capabilities.setCapability(HOST, "127.0.0.1");
    // 0 = Random, -1 = Opera default (7001). See above.
    capabilities.setCapability(PORT, 0);
    capabilities.setCapability(ARGUMENTS, "");

    capabilities.setCapability(LAUNCHER, (String) null);

    capabilities.setCapability(DISPLAY, (Integer) null);

=======
    capabilities.setCapability(ARGUMENTS, "");

    capabilities.setCapability(LAUNCHER, (String) null);
    capabilities.setCapability(LAUNCHER_PORT, 9999);
    capabilities.setCapability(RUN_LAUNCHER, true);

    capabilities.setCapability(DISPLAY, (Integer) null);

    capabilities.setCapability(PROFILE, (String) null);

>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
    capabilities.setCapability(AUTOSTART, true);
    capabilities.setCapability(NO_RESTART, false);
    capabilities.setCapability(NO_QUIT, false);
Solution content
    capabilities.setJavascriptEnabled(true);

    capabilities.setCapability(BINARY, (String) null);
    // Default = 127.0.0.1, but need to set to null for backwards compat.
    // with Opera versions that don't support -autotestmode host:port
    capabilities.setCapability(HOST, "127.0.0.1");
    // 0 = Random, -1 = Opera default (7001). See above.
    capabilities.setCapability(PORT, 0);
    capabilities.setCapability(ARGUMENTS, "");

    capabilities.setCapability(LAUNCHER, (String) null);

    capabilities.setCapability(DISPLAY, (Integer) null);

    capabilities.setCapability(PROFILE, (String) null);

    capabilities.setCapability(AUTOSTART, true);
    capabilities.setCapability(NO_RESTART, false);
    capabilities.setCapability(NO_QUIT, false);
File
OperaDriver.java
Developer's decision
Combination
Kind of conflict
Comment
Method invocation
Chunk
Conflicting content
    logger.fine("init() done");
  }

<<<<<<< HEAD
=======


>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
  @Deprecated
  public void shutdown() {
    quit();
Solution content
    logger.fine("init() done");
  }

  @Deprecated
  public void shutdown() {
    quit();
File
OperaDriver.java
Developer's decision
Version 1
Kind of conflict
Blank
Chunk
Conflicting content
import java.util.logging.Logger;

import org.openqa.selenium.WebDriverException;
<<<<<<< HEAD
import org.openqa.selenium.net.PortProber;
import org.openqa.selenium.remote.DesiredCapabilities;

import com.google.protobuf.GeneratedMessage;
=======
import org.openqa.selenium.remote.DesiredCapabilities;

import com.google.protobuf.GeneratedMessage;
import com.opera.core.systems.OperaDesktopDriver;
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
import com.opera.core.systems.OperaDriver;
import com.opera.core.systems.model.ScreenShotReply;
import com.opera.core.systems.runner.OperaRunner;
Solution content
import java.util.logging.Logger;

import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.net.PortProber;
import org.openqa.selenium.remote.DesiredCapabilities;

import com.google.protobuf.GeneratedMessage;
import com.opera.core.systems.OperaDriver;
import com.opera.core.systems.model.ScreenShotReply;
import com.opera.core.systems.runner.OperaRunner;
File
OperaLauncherRunner.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
  private OperaLauncherProtocol launcherProtocol = null;
  private String crashlog = null;

<<<<<<< HEAD
  @Deprecated
  public OperaLauncherRunner(OperaDriverSettings settings) {
    this(settings.getCapabilities());
  }

=======
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
  public OperaLauncherRunner(DesiredCapabilities capabilities) {
    logger.fine("Creating OperaLauncherRunner");
    this.capabilities = capabilities;
Solution content
  private OperaLauncherProtocol launcherProtocol = null;
  private String crashlog = null;

  @Deprecated
  public OperaLauncherRunner(OperaDriverSettings settings) {
    this(settings.getCapabilities());
  }

  public OperaLauncherRunner(DesiredCapabilities capabilities) {
    logger.fine("Creating OperaLauncherRunner");
    this.capabilities = capabilities;
File
OperaLauncherRunner.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Chunk
Conflicting content
    this.capabilities = capabilities;

    if (this.capabilities.getCapability(OperaDriver.LAUNCHER) == null) {
<<<<<<< HEAD
      throw new WebDriverException("Launcher path not set");
=======
      throw new WebDriverException( "Launcher path not set");
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
    }

    if (this.capabilities.getCapability(OperaDriver.BINARY) == null) {
Solution content
    this.capabilities = capabilities;

    if (this.capabilities.getCapability(OperaDriver.LAUNCHER) == null) {
      throw new WebDriverException("Launcher path not set");
    }

    if (this.capabilities.getCapability(OperaDriver.BINARY) == null) {
File
OperaLauncherRunner.java
Developer's decision
Version 1
Kind of conflict
Throw statement
Chunk
Conflicting content
      throw new WebDriverException("You need to set Opera's path to use opera-launcher");
    }

<<<<<<< HEAD
    logger.fine("Running launcher from OperaDriver");
    Integer launcherPort = PortProber.findFreePort();

    List stringArray = new ArrayList();
    stringArray.add("-host");
    stringArray.add("127.0.0.1");
    stringArray.add("-port");
    stringArray.add(launcherPort.toString());
    if (this.capabilities.getCapability(OperaDriver.DISPLAY) != null) {
      stringArray.add("-display");
      stringArray.add(":" + Integer.toString((Integer) this.capabilities.getCapability(OperaDriver.DISPLAY)));
    }
=======
    if ((Boolean) this.capabilities.getCapability(OperaDriver.RUN_LAUNCHER)) {
      logger.fine("Running launcher from OperaDriver");

      List stringArray = new ArrayList();
      stringArray.add("-host");
      stringArray.add("127.0.0.1");
      stringArray.add("-port");
      stringArray.add(Integer.toString((Integer) this.capabilities.getCapability(OperaDriver.LAUNCHER_PORT)));

      if (this.capabilities.getCapability(OperaDriver.DISPLAY) != null) {
        stringArray.add("-display");
        stringArray.add(":" + Integer.toString((Integer) this.capabilities.getCapability(OperaDriver.DISPLAY)));
      }

      if ((Boolean) this.capabilities.getCapability(OperaDriver.NO_QUIT)) {
        stringArray.add("-noquit");
      }
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2

    if (logger.isLoggable(Level.FINEST)) {
      stringArray.add("-console");
Solution content
      throw new WebDriverException("You need to set Opera's path to use opera-launcher");
    }

    logger.fine("Running launcher from OperaDriver");
    Integer launcherPort = PortProber.findFreePort();
    List stringArray = new ArrayList();
    stringArray.add("-host");
    stringArray.add("127.0.0.1");
    stringArray.add("-port");
    stringArray.add(launcherPort.toString());
    if (this.capabilities.getCapability(OperaDriver.DISPLAY) != null) {
      stringArray.add("-display");
      stringArray.add(":" + Integer.toString((Integer) this.capabilities.getCapability(OperaDriver.DISPLAY)));
    }

    if (logger.isLoggable(Level.FINEST)) {
      stringArray.add("-console");
File
OperaLauncherRunner.java
Developer's decision
Version 1
Kind of conflict
If statement
Method invocation
Variable
Chunk
Conflicting content
      stringArray.add("FINEST");
    }

<<<<<<< HEAD
    String binary_profile = (String) capabilities.getCapability(OperaDriver.BINARY_PROFILE);
    if (binary_profile != null && !binary_profile.isEmpty()) {
      stringArray.add("-profile");
      stringArray.add(binary_profile);
    }

    // Note any launcher arguments must be before this line!
=======
      // Note any launcher arguments must be before this line!

      stringArray.add("-bin");
      stringArray.add((String) this.capabilities.getCapability(OperaDriver.BINARY));

      /*
       * We read in environmental variable OPERA_ARGS in addition to existing
       * arguments passed down from OperaDriverSettings. These are combined
       * and sent to the browser.
       *
       * Note that this is a deviation from the principle of arguments normally
       * overwriting environmental variables.
       */
      String binaryArguments = (String) this.capabilities.getCapability(OperaDriver.ARGUMENTS);
      if (binaryArguments == null) {
        binaryArguments = "";
      }
      String environmentArguments = System.getenv("OPERA_ARGS");
      if (environmentArguments != null && environmentArguments.length() > 0) {
        binaryArguments = environmentArguments + " " + binaryArguments;
      }
      // Arguments are split by single space.
      StringTokenizer tokenizer = new StringTokenizer(binaryArguments, " ");
      while (tokenizer.hasMoreTokens()) {
        stringArray.add(tokenizer.nextToken());
      }
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2

    if ((Boolean) this.capabilities.getCapability(OperaDriver.NO_QUIT)) {
      stringArray.add("-noquit");
Solution content
      stringArray.add("FINEST");
    }

    String binary_profile = (String) capabilities.getCapability(OperaDriver.BINARY_PROFILE);
    if (binary_profile != null && !binary_profile.isEmpty()) {
      stringArray.add("-profile");
      stringArray.add(binary_profile);
    }

    // Note any launcher arguments must be before this line!

    if ((Boolean) this.capabilities.getCapability(OperaDriver.NO_QUIT)) {
      stringArray.add("-noquit");
File
OperaLauncherRunner.java
Developer's decision
Version 1
Kind of conflict
Cast expression
Comment
If statement
Method invocation
Variable
While statement
Chunk
Conflicting content
      binaryArguments = environmentArguments + " " + binaryArguments;
    }

<<<<<<< HEAD
    // Arguments are split by single space.
    StringTokenizer tokenizer = new StringTokenizer(binaryArguments, " ");
    while (tokenizer.hasMoreTokens()) {
      stringArray.add(tokenizer.nextToken());
    }

    logger.fine("Launcher arguments: " + stringArray);

    // Enable auto test mode, always starts Opera on opera:debug and prevents
    // interrupting dialogues appearing
    if (!stringArray.contains("-autotestmode")) {
      stringArray.add("-autotestmode");
    }

    int port = (Integer) this.capabilities.getCapability(OperaDriver.PORT);
    if (port != -1) {
      // Provide defaults if one hasn't been set
      String host = (String) this.capabilities.getCapability(OperaDriver.HOST);
      stringArray.add("-debugproxy");
      stringArray.add(host+":"+port);
    }

    System.out.println("command line: "+stringArray.toString());

    launcherRunner = new OperaLauncherBinary(
      (String) this.capabilities.getCapability(OperaDriver.LAUNCHER),
      stringArray.toArray(new String[stringArray.size()])
    );

=======
      {
        String profile = (String) this.capabilities.getCapability(OperaDriver.PROFILE);
        if (profile != null) {
          logger.fine("Using profile in: "+ profile);
          stringArray.add("-pd");
          stringArray.add(profile);
        }
      }

      launcherRunner = new OperaLauncherBinary(
        (String) this.capabilities.getCapability(OperaDriver.LAUNCHER),
        stringArray.toArray(new String[stringArray.size()])
      );
    }

    int launcherPort = (Integer) this.capabilities.getCapability(OperaDriver.LAUNCHER_PORT);
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
    logger.fine("Waiting for Opera Launcher connection on port " + launcherPort);

    try {
Solution content
      binaryArguments = environmentArguments + " " + binaryArguments;
    }

    // Arguments are split by single space.
    StringTokenizer tokenizer = new StringTokenizer(binaryArguments, " ");
    while (tokenizer.hasMoreTokens()) {
      stringArray.add(tokenizer.nextToken());
    }

    logger.fine("Launcher arguments: " + stringArray);

    // Enable auto test mode, always starts Opera on opera:debug and prevents
    // interrupting dialogues appearing
    if (!stringArray.contains("-autotestmode")) {
      stringArray.add("-autotestmode");
    }

    int port = (Integer) this.capabilities.getCapability(OperaDriver.PORT);
    if (port != -1) {
      // Provide defaults if one hasn't been set
      String host = (String) this.capabilities.getCapability(OperaDriver.HOST);
      stringArray.add("-debugproxy");
      stringArray.add(host+":"+port);
    }

    System.out.println("command line: "+stringArray.toString());

    {
      String profile = (String) this.capabilities.getCapability(OperaDriver.PROFILE);
      if (profile != null) {
        logger.fine("Using profile in: "+ profile);
        stringArray.add("-pd");
        stringArray.add(profile);
      }
    }

    launcherRunner = new OperaLauncherBinary(
      (String) this.capabilities.getCapability(OperaDriver.LAUNCHER),
      stringArray.toArray(new String[stringArray.size()])
    );

    logger.fine("Waiting for Opera Launcher connection on port " + launcherPort);

    try {
File
OperaLauncherRunner.java
Developer's decision
Combination
Kind of conflict
Attribute
Cast expression
Comment
If statement
Method invocation
Variable
While statement
Chunk
Conflicting content
        throw new OperaRunnerException("Did not get Opera launcher handshake");
      }
    } catch (SocketTimeoutException e) {
<<<<<<< HEAD
      throw new OperaRunnerException("Timeout waiting for Opera Launcher to connect on port " + launcherPort, e);
    } catch (IOException e) {
      throw new OperaRunnerException("Unable to listen to Opera launcher port " + launcherPort, e);
=======
      throw new OperaRunnerException("Timeout waiting for Opera Launcher to connect on port "
          + launcherPort, e);
    } catch (IOException e) {
      throw new OperaRunnerException("Unable to listen to opera launcher port "
          + launcherPort, e);
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
    }
  }
Solution content
        throw new OperaRunnerException("Did not get Opera launcher handshake");
      }
    } catch (SocketTimeoutException e) {
      throw new OperaRunnerException("Timeout waiting for Opera Launcher to connect on port " + launcherPort, e);
    } catch (IOException e) {
      throw new OperaRunnerException("Unable to listen to Opera launcher port " + launcherPort, e);
    }
  }
File
OperaLauncherRunner.java
Developer's decision
Version 1
Kind of conflict
Catch clause
Throw statement
Chunk
Conflicting content
  public void shutdown() {
    try {
<<<<<<< HEAD
      // Send a shutdown command to the launcher.
      try {
        launcherProtocol.sendRequestWithoutResponse(MessageType.MSG_SHUTDOWN, null);
      } catch (Exception e) {
        e.printStackTrace();
=======
      // Send a shutdown to the launcher!
      if ((Boolean) this.capabilities.getCapability(OperaDriver.RUN_LAUNCHER)) {
        try {
          launcherProtocol.sendRequestWithoutResponse(MessageType.MSG_SHUTDOWN,
              null);
        } catch (Exception e) {
          // will give us read-response issues!
          e.printStackTrace();
        }
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
      }

      // Then shutdown the protocol connection.
Solution content
  public void shutdown() {
    try {
      // Send a shutdown command to the launcher.
      try {
        launcherProtocol.sendRequestWithoutResponse(MessageType.MSG_SHUTDOWN, null);
      } catch (Exception e) {
        e.printStackTrace();
      }

      // Then shutdown the protocol connection.
File
OperaLauncherRunner.java
Developer's decision
Version 1
Kind of conflict
Catch clause
Comment
If statement
Method invocation
Try statement
Chunk
Conflicting content
import org.openqa.selenium.remote.DesiredCapabilities;

import com.opera.core.systems.OperaDriver;
<<<<<<< HEAD
import com.opera.core.systems.settings.OperaDriverSettings;
=======
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2

/**
 * Class to manage browser profile
Solution content
import org.openqa.selenium.remote.DesiredCapabilities;

import com.opera.core.systems.OperaDriver;
import com.opera.core.systems.settings.OperaDriverSettings;

/**
 * Class to manage browser profile
File
ProfileUtils.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
	private String cachePrefsFolder;
	private DesiredCapabilities capabilities;

<<<<<<< HEAD
	@Deprecated
	public ProfileUtils(String largePrefsFolder, String smallPrefsFolder, String cachePrefsFolder, OperaDriverSettings settings) {
		this(largePrefsFolder, smallPrefsFolder, cachePrefsFolder, settings.getCapabilities());
	}

	public ProfileUtils(String largePrefsFolder, String smallPrefsFolder, String cachePrefsFolder, DesiredCapabilities capabilities) {
=======
	public ProfileUtils(String largePrefsFolder, String smallPrefsFolder, String cachePrefsFolder, DesiredCapabilities capabilities){
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
		this.capabilities = capabilities;
		this.largePrefsFolder = largePrefsFolder;
		this.smallPrefsFolder = smallPrefsFolder;
Solution content
	@Deprecated
	private String cachePrefsFolder;
	private DesiredCapabilities capabilities;

	public ProfileUtils(String largePrefsFolder, String smallPrefsFolder, String cachePrefsFolder, OperaDriverSettings settings) {
		this(largePrefsFolder, smallPrefsFolder, cachePrefsFolder, settings.getCapabilities());
	}

	public ProfileUtils(String largePrefsFolder, String smallPrefsFolder, String cachePrefsFolder, DesiredCapabilities capabilities) {
		this.capabilities = capabilities;
		this.largePrefsFolder = largePrefsFolder;
		this.smallPrefsFolder = smallPrefsFolder;
File
ProfileUtils.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Method signature
Chunk
Conflicting content
  public void testNullOperaArguments() throws Exception {
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability(OperaDriver.ARGUMENTS, (String) null);
<<<<<<< HEAD

    OperaDriver driver = new TestOperaDriver(caps);
    Assert.assertNotNull(driver);
    driver.quit();
  }

  @Test
  public void testNullOperaArgumentsSettings() throws Exception {
    OperaDriverSettings settings = new OperaDriverSettings();
    settings.setOperaBinaryArguments(null);
=======
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2

    OperaDriver driver = new TestOperaDriver(caps);
    Assert.assertNotNull(driver);
Solution content
  public void testNullOperaArguments() throws Exception {
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability(OperaDriver.ARGUMENTS, (String) null);

    OperaDriver driver = new TestOperaDriver(caps);
    Assert.assertNotNull(driver);
    driver.quit();
  }

  @Test
  public void testNullOperaArgumentsSettings() throws Exception {
    OperaDriverSettings settings = new OperaDriverSettings();
    settings.setOperaBinaryArguments(null);

    OperaDriver driver = new TestOperaDriver(settings);
    Assert.assertNotNull(driver);
File
OperaDriverTest.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method invocation
Method signature
Variable
Chunk
Conflicting content
  }
  public void testOperaDriverSettings() {
    capabilities = OperaDriver.getDefaultCapabilities();
    Assert.assertNotNull(capabilities);
<<<<<<< HEAD
=======
  }

  @Test
  public void testDefaultDoRunOperaLauncherFromOperaDriver() {
    // default is to run launcher from the driver, so this should always be true
    Assert.assertTrue((Boolean) capabilities.getCapability(OperaDesktopDriver.RUN_LAUNCHER));

  @Test
  public void testSetRunOperaLauncherFromOperaDriver() {
    capabilities.setCapability(OperaDesktopDriver.RUN_LAUNCHER, false);
    Assert.assertFalse((Boolean) capabilities.getCapability(OperaDesktopDriver.RUN_LAUNCHER));
  }

  @Test
  public void testDefaultLauncherListeningPort() {
    // the listening port should default to 9999
    Assert.assertEquals(9999, capabilities.getCapability(OperaDesktopDriver.LAUNCHER_PORT));
  }

  @Test
  public void testSetLauncherListeningPort() {
    capabilities.setCapability(OperaDesktopDriver.LAUNCHER_PORT, 5555);
    Assert.assertEquals(5555, capabilities.getCapability(OperaDesktopDriver.LAUNCHER_PORT));
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
  }

  @Test
Solution content
  public void testOperaDriverSettings() {
    capabilities = OperaDriver.getDefaultCapabilities();
    Assert.assertNotNull(capabilities);
  }

  @Test
File
OperaLauncherRunnerTest.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Method invocation
Method signature
Chunk
Conflicting content
  public void testOperaLauncherRunnerConstructorWithSettings() {
    OperaPaths paths = new OperaPaths();

<<<<<<< HEAD
=======
    capabilities.setCapability(OperaDriver.RUN_LAUNCHER, true);
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
    capabilities.setCapability(OperaDriver.ARGUMENTS, "");
    capabilities.setCapability(OperaDriver.BINARY, paths.operaPath());
    capabilities.setCapability(OperaDriver.LAUNCHER, paths.launcherPath());
Solution content
  public void testOperaLauncherRunnerConstructorWithSettings() {
    OperaPaths paths = new OperaPaths();

    capabilities.setCapability(OperaDriver.ARGUMENTS, "");
    capabilities.setCapability(OperaDriver.BINARY, paths.operaPath());
    capabilities.setCapability(OperaDriver.LAUNCHER, paths.launcherPath());
File
OperaLauncherRunnerTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
  @Test
  public void testOperaLauncherRunnerConstructorWithSettings2() {
<<<<<<< HEAD
=======
    capabilities.setCapability(OperaDriver.RUN_LAUNCHER, true);
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
    capabilities.setCapability(OperaDriver.ARGUMENTS, "-geometry 1024x768");
    runner = new OperaLauncherRunner(capabilities);
    runner.startOpera();
Solution content
  @Test
  public void testOperaLauncherRunnerConstructorWithSettings2() {
    capabilities.setCapability(OperaDriver.ARGUMENTS, "-geometry 1024x768");
    runner = new OperaLauncherRunner(capabilities);
    runner.startOpera();
File
OperaLauncherRunnerTest.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    super();
  }

<<<<<<< HEAD
  public TestOperaDriver(OperaDriverSettings settings) {
    this(settings.getCapabilities());
=======
  public TestOperaDriver(DesiredCapabilities capabilities) {
    super(capabilities);
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
  }

  public TestOperaDriver(DesiredCapabilities capabilities) {
Solution content
    super();
  }

  public TestOperaDriver(OperaDriverSettings settings) {
    this(settings.getCapabilities());
  }

  public TestOperaDriver(DesiredCapabilities capabilities) {
File
TestBase.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Method signature
Chunk
Conflicting content
  public TestOperaDriver(DesiredCapabilities capabilities) {
    super(capabilities);
  }
<<<<<<< HEAD

  public OperaRunner getRunner() {
    return operaRunner;
  }
=======
>>>>>>> bed163d3a5916ef24b6b0251389587097c621db2
}
Solution content
  public TestOperaDriver(DesiredCapabilities capabilities) {
    super(capabilities);
  }

  public OperaRunner getRunner() {
    return operaRunner;
  }
}
File
TestBase.java
Developer's decision
Version 1
Kind of conflict
Method declaration