Merge "Version field name consistency for new HalApiEntity"
diff --git a/src/main/java/com/android/vts/api/CoverageRestServlet.java b/src/main/java/com/android/vts/api/CoverageRestServlet.java
index 165db8d..aebd3e5 100644
--- a/src/main/java/com/android/vts/api/CoverageRestServlet.java
+++ b/src/main/java/com/android/vts/api/CoverageRestServlet.java
@@ -106,10 +106,8 @@
         List<List<String>> allCoveredHalApiList = new ArrayList();
 
         Key<TestPlanRunEntity> key = Key.create(urlSafeKey);
-        System.out.println("urlSafekey => " + urlSafeKey);
         TestPlanRunEntity testPlanRunEntity = ofy().load().key(key).safe();
 
-        System.out.println("testPlanRunEntity => " + testPlanRunEntity);
         for (Key<TestRunEntity> testRunKey : testPlanRunEntity.getTestRuns()) {
             List<ApiCoverageEntity> apiCoverageEntityList =
                     ofy().load().type(ApiCoverageEntity.class).ancestor(testRunKey).list();
diff --git a/src/main/java/com/android/vts/api/DatastoreRestServlet.java b/src/main/java/com/android/vts/api/DatastoreRestServlet.java
index 5ddf18d..fb5ac65 100644
--- a/src/main/java/com/android/vts/api/DatastoreRestServlet.java
+++ b/src/main/java/com/android/vts/api/DatastoreRestServlet.java
@@ -87,6 +87,7 @@
             return;
         }
 
+        String resultMsg = "";
         // Verify service account access token.
         if (postMessage.hasAccessToken()) {
             String accessToken = postMessage.getAccessToken();
@@ -109,15 +110,21 @@
                 }
 
                 response.setStatus(HttpServletResponse.SC_OK);
+                resultMsg = "Success!!";
             } else {
                 log.warn("service_client_id didn't match!");
                 log.debug("SERVICE_CLIENT_ID => " + tokenInfo.getIssuedTo());
+                resultMsg = "Your SERVICE_CLIENT_ID is incorrect!";
                 response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
             }
         } else {
             log.error("postMessage do not contain any accessToken!");
+            resultMsg = "Your message do not have access token!";
             response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
         }
+        response.setContentType("application/json");
+        response.setCharacterEncoding("UTF-8");
+        response.getWriter().write("{'result_msg': " + resultMsg + "}");
     }
 
     /**
@@ -446,13 +453,6 @@
         Map<com.googlecode.objectify.Key<TestRunEntity>, TestRunEntity> testRunEntityMap =
                 ofy().load().keys(() -> testRunKeyList.iterator());
 
-        testRunKeyList.forEach(
-                (v) -> {
-                    log.debug("TestRunEntity key value => " + v);
-                });
-        log.debug("testRunEntityMap value => " + testRunEntityMap.values());
-        log.debug("testRunEntityMap keySet => " + testRunEntityMap.keySet());
-
         long passCount = 0;
         long failCount = 0;
         long startTimestamp = -1;
diff --git a/src/main/java/com/android/vts/api/TestRunRestServlet.java b/src/main/java/com/android/vts/api/TestRunRestServlet.java
index 2c724ac..90fd3f9 100644
--- a/src/main/java/com/android/vts/api/TestRunRestServlet.java
+++ b/src/main/java/com/android/vts/api/TestRunRestServlet.java
@@ -16,20 +16,10 @@
 
 package com.android.vts.api;
 
-import com.android.vts.entity.CodeCoverageEntity;
 import com.android.vts.entity.TestCaseRunEntity;
 import com.android.vts.entity.TestEntity;
 import com.android.vts.entity.TestRunEntity;
-import com.android.vts.util.FilterUtil;
 import com.android.vts.util.TestRunDetails;
-import com.google.appengine.api.datastore.DatastoreService;
-import com.google.appengine.api.datastore.DatastoreServiceFactory;
-import com.google.appengine.api.datastore.Entity;
-import com.google.appengine.api.datastore.EntityNotFoundException;
-import com.google.appengine.api.datastore.FetchOptions;
-import com.google.appengine.api.datastore.Key;
-import com.google.appengine.api.datastore.KeyFactory;
-import com.google.appengine.api.datastore.Query;
 import com.google.gson.Gson;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -38,7 +28,6 @@
 import java.util.Map;
 import java.util.Objects;
 import java.util.logging.Logger;
-import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -108,10 +97,7 @@
             }
             Map<com.googlecode.objectify.Key<TestCaseRunEntity>, TestCaseRunEntity>
                     testCaseRunEntityKeyMap = ofy().load().keys(() -> testCaseKeyList.iterator());
-            for (Map.Entry<com.googlecode.objectify.Key<TestCaseRunEntity>, TestCaseRunEntity> entry :
-                    testCaseRunEntityKeyMap.entrySet()) {
-                details.addTestCase(entry.getValue());
-            }
+            testCaseRunEntityKeyMap.forEach((key, value) -> details.addTestCase(value));
         }
         return details;
     }
diff --git a/src/main/java/com/android/vts/config/ObjectifyListener.java b/src/main/java/com/android/vts/config/ObjectifyListener.java
index 5f35abd..02e0215 100644
--- a/src/main/java/com/android/vts/config/ObjectifyListener.java
+++ b/src/main/java/com/android/vts/config/ObjectifyListener.java
@@ -28,6 +28,7 @@
 import com.android.vts.entity.ProfilingPointRunEntity;
 import com.android.vts.entity.ProfilingPointSummaryEntity;
 import com.android.vts.entity.RoleEntity;
+import com.android.vts.entity.TestAcknowledgmentEntity;
 import com.android.vts.entity.TestCaseRunEntity;
 import com.android.vts.entity.TestCoverageStatusEntity;
 import com.android.vts.entity.TestEntity;
diff --git a/src/main/java/com/android/vts/entity/TestCaseRunEntity.java b/src/main/java/com/android/vts/entity/TestCaseRunEntity.java
index 30776d4..85a6c43 100644
--- a/src/main/java/com/android/vts/entity/TestCaseRunEntity.java
+++ b/src/main/java/com/android/vts/entity/TestCaseRunEntity.java
@@ -138,7 +138,9 @@
     private void onLoad() {
         if (testCaseNames.size() == results.size()) {
             for (int index = 0; index < testCaseNames.size(); index++) {
-                this.addTestCase(testCaseNames.get(index), results.get(index).intValue());
+                String name = testCaseNames.get(index);
+                int result = results.get(index).intValue();
+                this.testCases.add(new TestCase(this.id, this.testCases.size(), name, result));
             }
         }
     }
diff --git a/src/main/java/com/android/vts/util/DatastoreHelper.java b/src/main/java/com/android/vts/util/DatastoreHelper.java
index 3764c7a..782887b 100644
--- a/src/main/java/com/android/vts/util/DatastoreHelper.java
+++ b/src/main/java/com/android/vts/util/DatastoreHelper.java
@@ -166,372 +166,6 @@
   }
 
   /**
-   * Upload data from a test report message
-   *
-   * @param report The test report containing data to upload.
-   */
-  public static void insertTestReport(TestReportMessage report) {
-
-    List<Entity> testEntityList = new ArrayList<>();
-    List<Entity> branchEntityList = new ArrayList<>();
-    List<Entity> buildTargetEntityList = new ArrayList<>();
-    List<Entity> coverageEntityList = new ArrayList<>();
-    List<Entity> profilingPointRunEntityList = new ArrayList<>();
-
-    if (!report.hasStartTimestamp()
-            || !report.hasEndTimestamp()
-            || !report.hasTest()
-            || !report.hasHostInfo()
-            || !report.hasBuildInfo()) {
-      // missing information
-      return;
-    }
-    long startTimestamp = report.getStartTimestamp();
-    long endTimestamp = report.getEndTimestamp();
-    String testName = report.getTest().toStringUtf8();
-    String testBuildId = report.getBuildInfo().getId().toStringUtf8();
-    String hostName = report.getHostInfo().getHostname().toStringUtf8();
-
-    TestEntity testEntity = new TestEntity(testName);
-
-    Key testRunKey =
-            KeyFactory.createKey(
-                    testEntity.getOldKey(), TestRunEntity.KIND, report.getStartTimestamp());
-
-    long passCount = 0;
-    long failCount = 0;
-    long coveredLineCount = 0;
-    long totalLineCount = 0;
-
-    Set<Key> buildTargetKeys = new HashSet<>();
-    Set<Key> branchKeys = new HashSet<>();
-    List<TestCaseRunEntity> testCases = new ArrayList<>();
-    List<Key> profilingPointKeys = new ArrayList<>();
-    List<String> links = new ArrayList<>();
-
-    // Process test cases
-    for (TestCaseReportMessage testCase : report.getTestCaseList()) {
-      String testCaseName = testCase.getName().toStringUtf8();
-      TestCaseResult result = testCase.getTestResult();
-      // Track global pass/fail counts
-      if (result == TestCaseResult.TEST_CASE_RESULT_PASS) {
-        ++passCount;
-      } else if (result != TestCaseResult.TEST_CASE_RESULT_SKIP) {
-        ++failCount;
-      }
-      if (testCase.getSystraceCount() > 0
-              && testCase.getSystraceList().get(0).getUrlCount() > 0) {
-        String systraceLink = testCase.getSystraceList().get(0).getUrl(0).toStringUtf8();
-        links.add(systraceLink);
-      }
-
-      // Process coverage data for test case
-      for (CoverageReportMessage coverage : testCase.getCoverageList()) {
-        CoverageEntity coverageEntity =
-                CoverageEntity.fromCoverageReport(testRunKey, testCaseName, coverage);
-        if (coverageEntity == null) {
-          logger.log(Level.WARNING, "Invalid coverage report in test run " + testRunKey);
-        } else {
-          coveredLineCount += coverageEntity.getCoveredCount();
-          totalLineCount += coverageEntity.getTotalCount();
-          coverageEntityList.add(coverageEntity.toEntity());
-        }
-      }
-
-      // Process profiling data for test case
-      for (ProfilingReportMessage profiling : testCase.getProfilingList()) {
-        ProfilingPointRunEntity profilingPointRunEntity =
-                ProfilingPointRunEntity.fromProfilingReport(testRunKey, profiling);
-        if (profilingPointRunEntity == null) {
-          logger.log(Level.WARNING, "Invalid profiling report in test run " + testRunKey);
-        } else {
-          profilingPointRunEntityList.add(profilingPointRunEntity.toEntity());
-          profilingPointKeys.add(profilingPointRunEntity.getKey());
-          testEntity.setHasProfilingData(true);
-        }
-      }
-
-      int lastIndex = testCases.size() - 1;
-      if (lastIndex < 0 || testCases.get(lastIndex).isFull()) {
-        testCases.add(new TestCaseRunEntity());
-        ++lastIndex;
-      }
-      TestCaseRunEntity testCaseEntity = testCases.get(lastIndex);
-      testCaseEntity.addTestCase(testCaseName, result.getNumber());
-    }
-
-    List<Entity> testCasePuts = new ArrayList<>();
-    for (TestCaseRunEntity testCaseEntity : testCases) {
-      testCasePuts.add(testCaseEntity.toEntity());
-    }
-    List<Key> testCaseKeys = datastore.put(testCasePuts);
-
-    List<Long> testCaseIds = new ArrayList<>();
-    for (Key key : testCaseKeys) {
-      testCaseIds.add(key.getId());
-    }
-
-    // Process device information
-    long testRunType = 0;
-    for (AndroidDeviceInfoMessage device : report.getDeviceInfoList()) {
-      DeviceInfoEntity deviceInfoEntity =
-              DeviceInfoEntity.fromDeviceInfoMessage(testRunKey, device);
-      if (deviceInfoEntity == null) {
-        logger.log(Level.WARNING, "Invalid device info in test run " + testRunKey);
-      } else {
-        // Run type on devices must be the same, else set to OTHER
-        TestRunType runType = TestRunType.fromBuildId(deviceInfoEntity.getBuildId());
-        if (runType == null) {
-          testRunType = TestRunType.OTHER.getNumber();
-        } else {
-          testRunType = runType.getNumber();
-        }
-        testEntityList.add(deviceInfoEntity.toEntity());
-        BuildTargetEntity target = new BuildTargetEntity(deviceInfoEntity.getBuildFlavor());
-        if (buildTargetKeys.add(target.key)) {
-          buildTargetEntityList.add(target.toEntity());
-        }
-        BranchEntity branch = new BranchEntity(deviceInfoEntity.getBranch());
-        if (branchKeys.add(branch.key)) {
-          branchEntityList.add(branch.toEntity());
-        }
-      }
-    }
-
-    // Overall run type should be determined by the device builds unless test build is OTHER
-    if (testRunType == TestRunType.OTHER.getNumber()) {
-      testRunType = TestRunType.fromBuildId(testBuildId).getNumber();
-    } else if (TestRunType.fromBuildId(testBuildId) == TestRunType.OTHER) {
-      testRunType = TestRunType.OTHER.getNumber();
-    }
-
-    // Process global coverage data
-    for (CoverageReportMessage coverage : report.getCoverageList()) {
-      CoverageEntity coverageEntity =
-              CoverageEntity.fromCoverageReport(testRunKey, new String(), coverage);
-      if (coverageEntity == null) {
-        logger.log(Level.WARNING, "Invalid coverage report in test run " + testRunKey);
-      } else {
-        coveredLineCount += coverageEntity.getCoveredCount();
-        totalLineCount += coverageEntity.getTotalCount();
-        coverageEntityList.add(coverageEntity.toEntity());
-      }
-    }
-
-    // Process global API coverage data
-    for (ApiCoverageReportMessage apiCoverage : report.getApiCoverageList()) {
-      HalInterfaceMessage halInterfaceMessage = apiCoverage.getHalInterface();
-      List<String> halApiList = apiCoverage.getHalApiList().stream().map(h -> h.toStringUtf8())
-              .collect(
-                      Collectors.toList());
-      List<String> coveredHalApiList = apiCoverage.getCoveredHalApiList().stream()
-              .map(h -> h.toStringUtf8()).collect(
-                      Collectors.toList());
-      ApiCoverageEntity apiCoverageEntity = new ApiCoverageEntity(
-              testRunKey,
-              halInterfaceMessage.getHalPackageName().toStringUtf8(),
-              halInterfaceMessage.getHalVersionMajor(),
-              halInterfaceMessage.getHalVersionMinor(),
-              halInterfaceMessage.getHalInterfaceName().toStringUtf8(),
-              halApiList,
-              coveredHalApiList
-      );
-      com.googlecode.objectify.Key apiCoverageEntityKey = apiCoverageEntity.save();
-      if (apiCoverageEntityKey == null) {
-        logger.log(Level.WARNING, "Invalid API coverage report in test run " + testRunKey);
-      }
-    }
-
-    // Process global profiling data
-    for (ProfilingReportMessage profiling : report.getProfilingList()) {
-      ProfilingPointRunEntity profilingPointRunEntity =
-              ProfilingPointRunEntity.fromProfilingReport(testRunKey, profiling);
-      if (profilingPointRunEntity == null) {
-        logger.log(Level.WARNING, "Invalid profiling report in test run " + testRunKey);
-      } else {
-        profilingPointRunEntityList.add(profilingPointRunEntity.toEntity());
-        profilingPointKeys.add(profilingPointRunEntity.getKey());
-        testEntity.setHasProfilingData(true);
-      }
-    }
-
-    // Process log data
-    for (LogMessage log : report.getLogList()) {
-      if (log.hasUrl()) {
-        links.add(log.getUrl().toStringUtf8());
-      }
-    }
-    // Process url resource
-    for (UrlResourceMessage resource : report.getLinkResourceList()) {
-      if (resource.hasUrl()) {
-        links.add(resource.getUrl().toStringUtf8());
-      }
-    }
-
-    boolean hasCodeCoverage = totalLineCount > 0 && coveredLineCount >= 0;
-    TestRunEntity testRunEntity =
-            new TestRunEntity(
-                    testEntity.getOldKey(),
-                    testRunType,
-                    startTimestamp,
-                    endTimestamp,
-                    testBuildId,
-                    hostName,
-                    passCount,
-                    failCount,
-                    hasCodeCoverage,
-                    testCaseIds,
-                    links);
-    testEntityList.add(testRunEntity.toEntity());
-
-    CodeCoverageEntity codeCoverageEntity = new CodeCoverageEntity(
-            testRunEntity.getKey(),
-            coveredLineCount,
-            totalLineCount);
-    testEntityList.add(codeCoverageEntity.toEntity());
-
-    Entity test = testEntity.toEntity();
-
-    if (datastoreTransactionalRetry(test, testEntityList)) {
-      List<List<Entity>> auxiliaryEntityList =
-              Arrays.asList(
-                      profilingPointRunEntityList,
-                      coverageEntityList,
-                      branchEntityList,
-                      buildTargetEntityList);
-      int indexCount = 0;
-      for (List<Entity> entityList : auxiliaryEntityList) {
-        switch (indexCount) {
-          case 0:
-          case 1:
-            if (entityList.size() > MAX_ENTITY_SIZE_PER_TRANSACTION) {
-              List<List<Entity>> partitionedList =
-                      Lists.partition(entityList, MAX_ENTITY_SIZE_PER_TRANSACTION);
-              partitionedList.forEach(
-                      subEntityList -> {
-                        datastoreTransactionalRetry(
-                                new Entity(NULL_ENTITY_KIND), subEntityList);
-                      });
-            } else {
-              datastoreTransactionalRetry(new Entity(NULL_ENTITY_KIND), entityList);
-            }
-            break;
-          case 2:
-          case 3:
-            datastoreTransactionalRetryWithXG(
-                    new Entity(NULL_ENTITY_KIND), entityList, true);
-            break;
-          default:
-            break;
-        }
-        indexCount++;
-      }
-
-      if (testRunEntity.getType() == TestRunType.POSTSUBMIT.getNumber()) {
-        VtsAlertJobServlet.addTask(testRunKey);
-        if (testRunEntity.getHasCodeCoverage()) {
-          VtsCoverageAlertJobServlet.addTask(testRunKey);
-        }
-        if (profilingPointKeys.size() > 0) {
-          VtsProfilingStatsJobServlet.addTasks(profilingPointKeys);
-        }
-      } else {
-        logger.log(
-                Level.WARNING,
-                "The alert email was not sent as testRunEntity type is not POSTSUBMIT!" +
-                        " \n " + " testRunEntity type => " + testRunEntity.getType());
-      }
-    }
-  }
-
-  /**
-   * Upload data from a test plan report message
-   *
-   * @param report The test plan report containing data to upload.
-   */
-  public static void insertTestPlanReport(TestPlanReportMessage report) {
-    List<Entity> testEntityList = new ArrayList<>();
-
-    List<String> testModules = report.getTestModuleNameList();
-    List<Long> testTimes = report.getTestModuleStartTimestampList();
-    if (testModules.size() != testTimes.size() || !report.hasTestPlanName()) {
-      logger.log(Level.WARNING, "TestPlanReportMessage is missing information.");
-      return;
-    }
-
-    String testPlanName = report.getTestPlanName();
-    Entity testPlanEntity = new TestPlanEntity(testPlanName).toEntity();
-    List<Key> testRunKeys = new ArrayList<>();
-    for (int i = 0; i < testModules.size(); i++) {
-      String test = testModules.get(i);
-      long time = testTimes.get(i);
-      Key parentKey = KeyFactory.createKey(TestEntity.KIND, test);
-      Key testRunKey = KeyFactory.createKey(parentKey, TestRunEntity.KIND, time);
-      testRunKeys.add(testRunKey);
-    }
-    Map<Key, Entity> testRuns = datastore.get(testRunKeys);
-    long passCount = 0;
-    long failCount = 0;
-    long startTimestamp = -1;
-    long endTimestamp = -1;
-    String testBuildId = null;
-    long type = 0;
-    Set<DeviceInfoEntity> deviceInfoEntitySet = new HashSet<>();
-    for (Key testRunKey : testRuns.keySet()) {
-      TestRunEntity testRun = TestRunEntity.fromEntity(testRuns.get(testRunKey));
-      if (testRun == null) {
-        continue; // not a valid test run
-      }
-      passCount += testRun.getPassCount();
-      failCount += testRun.getFailCount();
-      if (startTimestamp < 0 || testRunKey.getId() < startTimestamp) {
-        startTimestamp = testRunKey.getId();
-      }
-      if (endTimestamp < 0 || testRun.getEndTimestamp() > endTimestamp) {
-        endTimestamp = testRun.getEndTimestamp();
-      }
-      type = testRun.getType();
-      testBuildId = testRun.getTestBuildId();
-      Query deviceInfoQuery = new Query(DeviceInfoEntity.KIND).setAncestor(testRunKey);
-      for (Entity deviceInfoEntity : datastore.prepare(deviceInfoQuery).asIterable()) {
-        DeviceInfoEntity device = DeviceInfoEntity.fromEntity(deviceInfoEntity);
-        if (device == null) {
-          continue; // invalid entity
-        }
-        deviceInfoEntitySet.add(device);
-      }
-    }
-    if (startTimestamp < 0 || testBuildId == null || type == 0) {
-      logger.log(Level.WARNING, "Couldn't infer test run information from runs.");
-      return;
-    }
-    TestPlanRunEntity testPlanRun =
-            new TestPlanRunEntity(
-                    testPlanEntity.getKey(),
-                    testPlanName,
-                    type,
-                    startTimestamp,
-                    endTimestamp,
-                    testBuildId,
-                    passCount,
-                    failCount,
-                    0L,
-                    0L,
-                    testRunKeys);
-
-    // Create the device infos.
-    for (DeviceInfoEntity device : deviceInfoEntitySet) {
-      testEntityList.add(device.copyWithParent(testPlanRun.key).toEntity());
-    }
-    testEntityList.add(testPlanRun.toEntity());
-
-    // Add the task to calculate total number API list.
-    testPlanRun.addCoverageApiTask();
-
-    datastoreTransactionalRetry(testPlanEntity, testEntityList);
-  }
-
-  /**
    * Datastore Transactional process for data insertion with MAX_WRITE_RETRIES times and withXG of
    * false value
    *
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
index da48606..0300f9e 100644
--- a/src/main/resources/log4j2.xml
+++ b/src/main/resources/log4j2.xml
@@ -6,10 +6,7 @@
         </Console>
     </Appenders>
     <Loggers>
-        <Logger name="com.android.vts" level="trace">
-            <AppenderRef ref="Console"/>
-        </Logger>
-        <Root level="error">
+        <Root level="trace">
             <AppenderRef ref="Console"/>
         </Root>
     </Loggers>
diff --git a/src/test/java/com/android/vts/entity/TestCaseRunEntityTest.java b/src/test/java/com/android/vts/entity/TestCaseRunEntityTest.java
new file mode 100644
index 0000000..d4abd38
--- /dev/null
+++ b/src/test/java/com/android/vts/entity/TestCaseRunEntityTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you
+ * may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package com.android.vts.entity;
+
+import com.android.vts.util.ObjectifyTestBase;
+import org.junit.jupiter.api.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static com.googlecode.objectify.ObjectifyService.factory;
+import static org.junit.Assert.assertEquals;
+
+public class TestCaseRunEntityTest extends ObjectifyTestBase {
+
+    @Test
+    public void saveTest() {
+
+        factory().register(TestCaseRunEntity.class);
+
+        List<Integer> results = Arrays.asList(1, 1, 1, 1, 1, 1, 1);
+        List<String> testCaseNames =
+                Arrays.asList(
+                        "AudioEffectsFactoryTest.EnumerateEffects(default)_32bit",
+                        "AudioEffectsFactoryTest.CreateEffect(default)_32bit",
+                        "AudioEffectsFactoryTest.GetDescriptor(default)_32bit",
+                        "AudioEffectsFactoryTest.DebugDumpArgument(default)_32bit",
+                        "AudioEffectTest.Close(default)_32bit",
+                        "AudioEffectTest.GetDescriptor(default)_32bit",
+                        "AudioEffectTest.GetSetConfig(default)_32bit");
+
+        TestCaseRunEntity testCaseRunEntity = new TestCaseRunEntity();
+        for (int index = 0; index < results.size(); index++) {
+            String testCaseName = testCaseNames.get(index);
+            int result = results.get(index);
+            testCaseRunEntity.addTestCase(testCaseName, result);
+        }
+        TestCaseRunEntity loadedTestCaseRunEntity = saveClearLoad(testCaseRunEntity);
+
+        assertEquals(loadedTestCaseRunEntity.getTestCases().size(), results.size());
+        assertEquals(
+                (Integer) loadedTestCaseRunEntity.getTestCases().get(0).result, results.get(0));
+        assertEquals(loadedTestCaseRunEntity.getTestCases().get(0).name, testCaseNames.get(0));
+    }
+}
diff --git a/src/test/resources/log4j2-test.xml b/src/test/resources/log4j2-test.xml
index efa1e35..98cfd73 100644
--- a/src/test/resources/log4j2-test.xml
+++ b/src/test/resources/log4j2-test.xml
@@ -6,10 +6,7 @@
         </Console>
     </Appenders>
     <Loggers>
-        <Logger name="com.android.vts" level="trace">
-            <AppenderRef ref="Console"/>
-        </Logger>
-        <Root level="error">
+        <Root level="info">
             <AppenderRef ref="Console"/>
         </Root>
     </Loggers>