Java test code clean-up

Remove unused parameters and make testJava return the config.

Test: Ran all java tests.
Change-Id: Iaa123f3fd93188e2f55452b887e1d340429cc710
diff --git a/java/androidmk_test.go b/java/androidmk_test.go
index 107837d..fbf2baa 100644
--- a/java/androidmk_test.go
+++ b/java/androidmk_test.go
@@ -15,18 +15,20 @@
 package java
 
 import (
-	"android/soong/android"
 	"bytes"
 	"io"
 	"io/ioutil"
 	"strings"
 	"testing"
+
+	"android/soong/android"
 )
 
 type testAndroidMk struct {
 	*testing.T
 	body []byte
 }
+
 type testAndroidMkModule struct {
 	*testing.T
 	props map[string]string
@@ -115,30 +117,26 @@
 }
 
 func TestRequired(t *testing.T) {
-	config := testConfig(nil)
-	ctx := testContext(config, `
+	ctx, config := testJava(t, `
 		java_library {
 			name: "foo",
 			srcs: ["a.java"],
 			required: ["libfoo"],
 		}
-	`, nil)
-	run(t, ctx, config)
+	`)
 
 	mk := getAndroidMk(t, ctx, config, "foo")
 	mk.moduleFor("foo").hasRequired("libfoo")
 }
 
 func TestHostdex(t *testing.T) {
-	config := testConfig(nil)
-	ctx := testContext(config, `
+	ctx, config := testJava(t, `
 		java_library {
 			name: "foo",
 			srcs: ["a.java"],
 			hostdex: true,
 		}
-	`, nil)
-	run(t, ctx, config)
+	`)
 
 	mk := getAndroidMk(t, ctx, config, "foo")
 	mk.moduleFor("foo")
@@ -146,16 +144,14 @@
 }
 
 func TestHostdexRequired(t *testing.T) {
-	config := testConfig(nil)
-	ctx := testContext(config, `
+	ctx, config := testJava(t, `
 		java_library {
 			name: "foo",
 			srcs: ["a.java"],
 			hostdex: true,
 			required: ["libfoo"],
 		}
-	`, nil)
-	run(t, ctx, config)
+	`)
 
 	mk := getAndroidMk(t, ctx, config, "foo")
 	mk.moduleFor("foo").hasRequired("libfoo")
@@ -163,8 +159,7 @@
 }
 
 func TestHostdexSpecificRequired(t *testing.T) {
-	config := testConfig(nil)
-	ctx := testContext(config, `
+	ctx, config := testJava(t, `
 		java_library {
 			name: "foo",
 			srcs: ["a.java"],
@@ -175,8 +170,7 @@
 				},
 			},
 		}
-	`, nil)
-	run(t, ctx, config)
+	`)
 
 	mk := getAndroidMk(t, ctx, config, "foo")
 	mk.moduleFor("foo").hasNoRequired("libfoo")