@Test public void testTranslate_cache() { SimpleCache cache = new SimpleCache(); Entity defect = new Entity("defect", 86); defect.setProperty("name", "yes"); cache.add(defect); EntityReferenceTranslator translator = new EntityReferenceTranslator(getProject(), "defect", cache); String name = translator.translate("86", new ValueCallback() { @Override public void value(final String value) { Assert.fail("not expected"); } }); Assert.assertEquals("yes", name); }
@Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); }
EntityReferenceTranslator implements Translator { @Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); } }
EntityReferenceTranslator implements Translator { @Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); } EntityReferenceTranslator(Project project, String targetType, SimpleCache cache); }
EntityReferenceTranslator implements Translator { @Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); } EntityReferenceTranslator(Project project, String targetType, SimpleCache cache); @Override String translate(String value, ValueCallback callback); String getTargetType(); }
EntityReferenceTranslator implements Translator { @Override public String translate(String value, ValueCallback callback) { return new Execution(callback).perform(value); } EntityReferenceTranslator(Project project, String targetType, SimpleCache cache); @Override String translate(String value, ValueCallback callback); String getTargetType();  }