remove useMapNativeAccessor stuff

Summary:
This was quite a rabit hole of remove deps -> delete dead code -> repeat.

Waaay simpler now with less duplicate lookups, redundant type verification, and extra function calls.

Reviewed By: mdvacca

Differential Revision: D14486283

fbshipit-source-id: 035db30181755d046a1ae99760468b954b2449df
This commit is contained in:
Spencer Ahrens
2019-03-25 12:04:37 -07:00
committed by Facebook Github Bot
parent a46fba5dd3
commit b257e06bc6
6 changed files with 56 additions and 298 deletions
@@ -3,6 +3,7 @@ package com.facebook.react.tests.core;
import static org.fest.assertions.api.Assertions.assertThat;
import androidx.test.runner.AndroidJUnit4;
import com.facebook.react.bridge.NoSuchKeyException;
import com.facebook.react.bridge.UnexpectedNativeTypeException;
import com.facebook.react.bridge.WritableNativeArray;
import com.facebook.react.bridge.WritableNativeMap;
@@ -27,7 +28,6 @@ public class WritableNativeMapTest {
mMap.putMap("map", new WritableNativeMap());
mMap.putArray("array", new WritableNativeArray());
mMap.putBoolean("dvacca", true);
mMap.setUseNativeAccessor(true);
}
@Test
@@ -90,14 +90,13 @@ public class WritableNativeMapTest {
mMap.getArray("string");
}
@Ignore("Needs to be implemented")
@Test
public void testErrorMessageContainsKey() {
String key = "fkg";
try {
mMap.getString(key);
Assert.fail("Expected an UnexpectedNativeTypeException to be thrown");
} catch (UnexpectedNativeTypeException e) {
Assert.fail("Expected an NoSuchKeyException to be thrown");
} catch (NoSuchKeyException e) {
assertThat(e.getMessage()).contains(key);
}
}