diff --git a/deploy.info b/deploy.info
index 3f19210..b638e17 100644
--- a/deploy.info
+++ b/deploy.info
@@ -19,3 +19,6 @@ files[] = plugins/DeployProcessorMemory.inc
 files[] = plugins/DeployProcessorQueue.inc
 files[] = plugins/DeployServiceRestJSON.inc
 files[] = plugins/DeployServiceRestXML.inc
+
+files[] = deploy_test_case.php
+files[] = deploy.test
diff --git a/deploy.test b/deploy.test
new file mode 100644
index 0000000..8c4952b
--- /dev/null
+++ b/deploy.test
@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * @file
+ *
+ * Simple example test. We create a node on both servers and show
+ * that we can access them.
+ */
+
+class ExampleDeployWebTestCase extends DeployWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Deployment Example test',
+      'description' => 'Lets try to set two separate servers.',
+      'group' => 'Deployment'
+    );
+  }
+
+  /**
+   * Test itself.
+   */
+  function testExampleTest() {
+    $this->drupalCreateNode(array('title' => 'server1'));
+    $this->drupalGet('node/1');
+
+    $this->switchToServer2();
+    $this->drupalCreateNode(array('title' => 'server2'));
+    $this->drupalGet('node/1');
+  }
+}
diff --git a/deploy_test_case.php b/deploy_test_case.php
new file mode 100644
index 0000000..c96aa25
--- /dev/null
+++ b/deploy_test_case.php
@@ -0,0 +1,118 @@
+<?php
+
+class DeployWebTestCase extends DrupalWebTestCase {
+
+  // Array to keep presaved variables.
+  private $servers = array();
+
+  /**
+   * Custom implementation of setUp() method.
+   *
+   * Create two sandboxes instead of one.
+   */
+  function setUp() {
+    // Install first server. Here we should add what modules we would like
+    // to enable for first server.
+    parent::setUp('deploy');
+    $this->saveSettings(1);
+
+    // Get back to the original connection.
+    Database::renameConnection('default', 'simletest_server1');
+    Database::renameConnection('simpletest_original_default', 'default');
+    Database::setActiveConnection('default');
+
+    // Presave some of the 'original' values as during the next parent::setUp()
+    // call they will be updated with wrong data.
+    $language = $this->originalLanguage;
+    $language_default = $this->originalLanguageDefault;
+    $original_directory = $this->originalFileDirectory;
+    $original_profile = $this->originalProfile;
+    $callbacks = $this->originalShutdownCallbacks;
+
+    // Install second server. Here we should add what modules we would like
+    // to enable for second server.
+    parent::setUp('ctools', 'services');
+    $this->saveSettings(2);
+
+    Database::renameConnection('default', 'simletest_server2');
+    $this->switchToServer1();
+
+    // Restore 'original' values.
+    $this->originalLanguage = $language;
+    $this->originalLanguageDefault = $language_default;
+    $this->originalFileDirectory = $original_directory;
+    $this->originalProfile = $original_profile;
+    $this->originalShutdownCallbacks = $callbacks;
+  }
+
+  /**
+   * Custom implementation of tearDown().
+   *
+   * Remove both sandboxes.
+   */
+  function tearDown() {
+    // Cleanup server 2.
+    $this->restoreSettings(2);
+    Database::renameConnection('simletest_server2', 'default');
+    Database::setActiveConnection('default');
+    parent::tearDown();
+
+    // Cleanup server 1 manually.
+    // Delete temporary files directory.
+    file_unmanaged_delete_recursive($this->originalFileDirectory . '/simpletest/' . substr($this->servers[1]['databasePrefix'], 10));
+    // Remove database.
+    Database::setActiveConnection('simletest_server1');
+    // Remove all prefixed tables (all the tables in the schema).
+    $schema = drupal_get_schema(NULL, TRUE);
+    foreach ($schema as $name => $table) {
+      db_drop_table($name);
+    }
+    Database::setActiveConnection('default');
+    Database::removeConnection('simletest_server1');
+  }
+
+  /**
+   * Restore some $this object values.
+   *
+   * @param integer $i
+   *   Number of the server (1 or 2).
+   */
+  function restoreSettings($i) {
+    $this->cookieFile = $this->servers[$i]['cookieFile'];
+    $this->databasePrefix = $this->servers[$i]['databasePrefix'];
+    $this->curlHandle = $this->servers[$i]['curlHandle'];
+    $this->cookieFile = $this->servers[$i]['cookieFile'];
+  }
+
+  /**
+   * Presave some variables.
+   *
+   * @param integer $i
+   *   Number of server (1 or 2).
+   */
+  function saveSettings($i) {
+    if (empty($i)) {
+      return;
+    }
+    $this->servers[$i]['cookieFile'] = $this->cookieFile;
+    $this->servers[$i]['databasePrefix'] = $this->databasePrefix;
+    $this->servers[$i]['curlHandle'] = $this->curlHandle;
+    $this->servers[$i]['cookieFile'] = $this->cookieFile;
+  }
+
+  /**
+   * Switch to server 1.
+   */
+  function switchToServer1() {
+    Database::setActiveConnection('simletest_server1');
+    $this->restoreSettings(1);
+  }
+
+  /**
+   * Switch to server 2.
+   */
+  function switchToServer2() {
+    Database::setActiveConnection('simletest_server2', 'default');
+    $this->restoreSettings(2);
+  }
+}
