Split up testJavaWithEnvFs

Instead of passing all the options to testJavaWithEnvFs, split it
up into testConfig, testContext, and run.  Tests that don't need
any special options can continue to use testJava, more complicated
tests can call the three functions manually.  This gives more
flexibility in complicated tests for the next patch.

Test: soong java tests
Change-Id: Ifd5dcb40cf08e4cbf69bf8e02c5698adbfbcdcb3
diff --git a/java/app_test.go b/java/app_test.go
index 8e50b9f..37489f5 100644
--- a/java/app_test.go
+++ b/java/app_test.go
@@ -34,14 +34,27 @@
 	}
 )
 
-func testApp(t *testing.T, bp string) *android.TestContext {
-	appFs := map[string][]byte{}
-
-	for _, file := range resourceFiles {
-		appFs[file] = nil
+func testAppContext(config android.Config, bp string, fs map[string][]byte) *android.TestContext {
+	appFS := map[string][]byte{}
+	for k, v := range fs {
+		appFS[k] = v
 	}
 
-	return testJavaWithEnvFs(t, bp, nil, appFs)
+	for _, file := range resourceFiles {
+		appFS[file] = nil
+	}
+
+	return testContext(config, bp, appFS)
+}
+
+func testApp(t *testing.T, bp string) *android.TestContext {
+	config := testConfig(nil)
+
+	ctx := testAppContext(config, bp, nil)
+
+	run(t, ctx, config)
+
+	return ctx
 }
 
 func TestApp(t *testing.T) {