diff options
author | 2022-01-07 15:42:18 +0800 | |
---|---|---|
committer | 2022-01-10 21:28:37 +0800 | |
commit | fe310a93052d43c0b8134a3c3504f620739de1a8 (patch) | |
tree | 8144a29721354d152f92f03a3dc9eed2d6f92af4 /java/droidstubs_test.go | |
parent | fe306aba98780d495601e29a54055db868f57182 (diff) |
Update droidstubs to support putting action inputs/outputs into the module-graph.json.
Test: local test
Change-Id: I6ce657f2ad53c261bcbdd317c266cf179a0cc6e9
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 |