Add core-oj to bootclasspath

Also clear the bootclasspath for device builds so javac doesn't
fall back to the default rt.jar bootclasspath.

Test: java_test.go
Change-Id: Ia21f55c7d45db560e2f44be81b2f46587d9026f2
diff --git a/java/java_test.go b/java/java_test.go
index eb116c9..d73ae0b 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -20,6 +20,7 @@
 	"io/ioutil"
 	"os"
 	"path/filepath"
+	"reflect"
 	"strings"
 	"testing"
 )
@@ -62,7 +63,7 @@
 	ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
 	ctx.Register()
 
-	extraModules := []string{"core-libart", "frameworks", "sdk_v14"}
+	extraModules := []string{"core-oj", "core-libart", "frameworks", "sdk_v14"}
 
 	for _, extra := range extraModules {
 		bp += fmt.Sprintf(`
@@ -173,10 +174,11 @@
 		bootclasspathLib
 	)
 
-	check := func(module, dep string, depType depType) {
-		if dep != "" {
-			dep = filepath.Join(buildDir, ".intermediates", dep, "classes-full-debug.jar")
+	check := func(module string, depType depType, deps ...string) {
+		for i := range deps {
+			deps[i] = filepath.Join(buildDir, ".intermediates", deps[i], "classes-full-debug.jar")
 		}
+		dep := strings.Join(deps, ":")
 
 		javac := ctx.ModuleForTests(module, "").Rule("javac")
 
@@ -192,12 +194,18 @@
 			}
 		}
 
-		if len(javac.Implicits) != 1 || javac.Implicits[0].String() != dep {
-			t.Errorf("module %q implicits != [%q]", dep)
+		if !reflect.DeepEqual(javac.Implicits.Strings(), deps) {
+			t.Errorf("module %q implicits %q != %q", module, javac.Implicits.Strings(), deps)
 		}
 	}
 
-	check("foo1", "core-libart", bootclasspathLib)
+	check("foo1", bootclasspathLib, "core-oj", "core-libart")
+	check("foo2", bootclasspathLib, "core-oj", "core-libart")
+	// TODO(ccross): these need the arch mutator to run to work correctly
+	//check("foo3", bootclasspathLib, "sdk_v14")
+	//check("foo4", bootclasspathLib, "android_stubs_current")
+	//check("foo5", bootclasspathLib, "android_system_stubs_current")
+	//check("foo6", bootclasspathLib, "android_test_stubs_current")
 }
 
 func TestPrebuilts(t *testing.T) {