diff options
Diffstat (limited to 'java/droidstubs_test.go')
-rw-r--r-- | java/droidstubs_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/java/droidstubs_test.go b/java/droidstubs_test.go index 10d99f3a5..573821749 100644 --- a/java/droidstubs_test.go +++ b/java/droidstubs_test.go @@ -21,6 +21,8 @@ import ( "strings" "testing" + "github.com/google/blueprint" + "android/soong/android" ) @@ -232,6 +234,30 @@ func TestDroidstubsWithSystemModules(t *testing.T) { checkSystemModulesUseByDroidstubs(t, ctx, "stubs-prebuilt-system-modules", "prebuilt-jar.jar") } +func TestAddJSONData(t *testing.T) { + prebuiltStubsSources := PrebuiltStubsSources{} + prebuiltStubsSources.jsonDataActions = []blueprint.JSONDataAction{ + blueprint.JSONDataAction{ + Inputs: []string{}, + Outputs: []string{}, + }, + } + jsonData := map[string]interface{}{} + prebuiltStubsSources.AddJSONData(&jsonData) + if fmt.Sprint(jsonData) != fmt.Sprint( + map[string]interface{}{ + "Android": map[string]interface{}{}, + "Actions": []map[string]interface{}{ + map[string]interface{}{ + "Inputs": []string{}, + "Outputs": []string{}, + }, + }, + }) { + t.Errorf("The JSON data map isn't as expected %s.", jsonData) + } +} + func checkSystemModulesUseByDroidstubs(t *testing.T, ctx *android.TestContext, moduleName string, systemJar string) { metalavaRule := ctx.ModuleForTests(moduleName, "android_common").Rule("metalava") var systemJars []string |