package edu.wm.translationengine.uiautomator;

import java.io.IOException;

import edu.wm.translationengine.trans.FileModifier;

public class UiAutomatorFileModifier extends FileModifier{

	public void setupFileImports() throws IOException {
		// TODO Auto-generated method stub
		UiAutomatorTranslator.toWrite.add("import com.android.uiautomator.core.UiDevice;\n");
		UiAutomatorTranslator.toWrite.add("import com.android.uiautomator.core.UiObject;\n");
		UiAutomatorTranslator.toWrite.add("import com.android.uiautomator.core.UiObjectNotFoundException;\n");
		UiAutomatorTranslator.toWrite.add("import com.android.uiautomator.core.UiSelector;\n");
		UiAutomatorTranslator.toWrite.add("import com.android.uiautomator.testrunner.UiAutomatorTestCase;\n\n");
	}

	public void setupTestMethodHeader(String packageName, String mainActivity) {
		// TODO Auto-generated method stub
		UiAutomatorTranslator.toWrite.add("public class TestBackPress extends UiAutomatorTestCase {\n");
		UiAutomatorTranslator.toWrite.add("\tpublic void uiautomator_test() throws UiObjectNotFoundException{\n");
	}

	public void closeTestMethod() {
		// TODO Auto-generated method stub
		UiAutomatorTranslator.toWrite.add("\t}\n");
		UiAutomatorTranslator.toWrite.add(0, "package [Test_package_name_here]\n\n");
	}

}

@@ -119,16 +119,25 @@
 Modifier
+Interface
 ;%0A%0Apubli
@@ -168,22 +168,25 @@
 odifier 
-extend
+implement
 s FileMo
@@ -191,16 +191,25 @@
 Modifier
+Interface
 %7B%0A%0A%09publ
@@ -1040,16 +1040,21 @@
 ic void 
+test_
 uiautoma
@@ -1060,13 +1060,8 @@
 ator
-_test
 () t
@@ -1214,16 +1214,17 @@
 d(%22%5Ct%7D%5Cn
+%7D
 %22);%0A%09%09Ui

Update UiAutomatorFileModifier.java