Remove guava dependency (#309)

Summary:
It's only used in `JavascriptSessionTest`, and seems fine to keep it in tests

Resolves #172
Pull Request resolved: https://github.com/facebook/flipper/pull/309

Reviewed By: passy

Differential Revision: D12840362

Pulled By: jknoxville

fbshipit-source-id: 4ead5a4bf0c08d792abcadef713f907930a3e4e7
This commit is contained in:
Zac Sweers
2018-10-31 07:48:36 -07:00
committed by Facebook Github Bot
parent f3833a6e5a
commit 62b913d844
2 changed files with 11 additions and 16 deletions

View File

@@ -45,7 +45,6 @@ android {
compileOnly deps.lithoAnnotations
implementation project(':fbjni')
implementation deps.soloader
implementation deps.guava
implementation deps.jsr305
implementation deps.supportAppCompat
implementation deps.stetho

View File

@@ -9,9 +9,9 @@ package com.facebook.flipper.plugins.console;
import static org.junit.Assert.assertEquals;
import com.google.common.collect.ImmutableMap;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -42,12 +42,10 @@ public class JavascriptSessionTest {
@Test
public void testVariablesGetBoundCorrectly() throws Exception {
JavascriptSession session =
new JavascriptSession(
mContextFactory,
ImmutableMap.<String, Object>of(
"a", 2,
"b", 2));
Map<String, Object> data = new HashMap<>();
data.put("a", 2);
data.put("b", 2);
JavascriptSession session = new JavascriptSession(mContextFactory, data);
JSONObject json = session.evaluateCommand("a+b");
assertEquals("json", json.getString("type"));
assertEquals(4, json.getInt("value"));
@@ -65,10 +63,9 @@ public class JavascriptSessionTest {
@Test
public void testJavaObjectEvaluation() throws Exception {
JavascriptSession session =
new JavascriptSession(
mContextFactory,
ImmutableMap.<String, Object>of("object", new HashMap<String, String>()));
Map<String, Object> data = new HashMap<>();
data.put("object", new HashMap<String, String>());
JavascriptSession session = new JavascriptSession(mContextFactory, data);
JSONObject json = session.evaluateCommand("object");
assertEquals("javaObject", json.getString("type"));
assertEquals("{}", json.getJSONObject("value").getString("toString"));
@@ -76,10 +73,9 @@ public class JavascriptSessionTest {
@Test
public void testJavaMethodEvaluation() throws Exception {
JavascriptSession session =
new JavascriptSession(
mContextFactory,
ImmutableMap.<String, Object>of("object", new HashMap<String, String>()));
Map<String, Object> data = new HashMap<>();
data.put("object", new HashMap<String, String>());
JavascriptSession session = new JavascriptSession(mContextFactory, data);
JSONObject json = session.evaluateCommand("object.get");
assertEquals("method", json.getString("type"));
}