/*
 +Copyright 2014 Appium contributors
 +Copyright 2014 Software Freedom Conservancy
 +
 +Licensed under the Apache License, Version 2.0 (the "License");
 +you may not use this file except in compliance with the License.
 +You may obtain a copy of the License at
 +
 +     http://www.apache.org/licenses/LICENSE-2.0
 +
 +Unless required by applicable law or agreed to in writing, software
 +distributed under the License is distributed on an "AS IS" BASIS,
 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +See the License for the specific language governing permissions and
 +limitations under the License.
 + */

package io.appium.java_client;

import io.appium.java_client.remote.MobileCapabilityType;

import java.io.File;
import java.net.URL;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.remote.DesiredCapabilities;

/**
 * Test Mobile Driver features
 */
public class AndroidGestureTest {
  private AppiumDriver driver;

  @Before
  public void setup() throws Exception {
    File appDir = new File("src/test/java/io/appium/java_client");
    File app = new File(appDir, "ApiDemos-debug.apk");
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
    capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
    capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
    driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
  }

  @After
  public void tearDown() throws Exception {
    driver.quit();
  }

  @Test
  public void MultiGestureSingleActionTest() throws InterruptedException {
    //the underlying java library for Appium doesn't like multi-gestures with only a single action.
    //but java-client should handle it, silently falling back to just performing a single action.

    MultiTouchAction multiTouch = new MultiTouchAction(driver);
    TouchAction action0 = new TouchAction(driver).tap(100,300);
    multiTouch.add(action0).perform();
  }

  @Test
  public void TapSingleFingerTest() {
    driver.tap(1,100,200,1000);
  }
}

@@ -668,16 +668,50 @@
 lient;%0A%0A
+import static org.junit.Assert.*;%0A
 import i
@@ -876,16 +876,86 @@
 t.Test;%0A
+import org.openqa.selenium.By;%0Aimport org.openqa.selenium.WebElement;%0A
 import o
@@ -2277,32 +2277,919 @@
 perform();%0A  %7D%0A%0A
+  @Test%0A  public void dragNDropTest() %7B%0A%09  driver.scrollToExact(%22Views%22).click();%0A%09  driver.findElement(MobileBy.AndroidUIAutomator(%22description(%5C%22Drag and Drop%5C%22)%22)).click();%0A%09  WebElement actionBarTitle = driver.findElement(By.id(%22android:id/action_bar_title%22));%0A%0A%09  assertEquals(%22Wrong title.%22, %22Views/Drag and Drop%22, actionBarTitle.getText());%0A%09  WebElement dragDot1 = driver.findElement(By.id(%22com.example.android.apis:id/drag_dot_1%22));%0A%09  WebElement dragDot3 = driver.findElement(By.id(%22com.example.android.apis:id/drag_dot_3%22));%0A%0A%09  WebElement dragText = driver.findElement(By.id(%22com.example.android.apis:id/drag_text%22));%0A%09  assertEquals(%22Drag text not empty%22, %22%22, dragText.getText());%0A%0A%09  TouchAction dragNDrop = new TouchAction(driver).longPress(dragDot1).moveTo(dragDot3).release();%0A%09  dragNDrop.perform();%0A%0A%09  assertNotEquals(%22Drag text empty%22, %22%22, dragText.getText());%0A  %7D%0A%0A
   @Test%0A  public

Add drag'n'drop test.