@Test public void testTranslate_build() { EntityReferenceTranslator translator = new EntityReferenceTranslator(getProject(), "build-instance", new SimpleCache()); RestInvocations.loadMetadata(handler, "build-instance"); RestInvocations.loadMetadata(handler, "build-type"); handler.addRequest(false, "GET", "/qcbin/rest/domains/domain/projects/project/build-instances?fields=product,category,id,status,build-system-url,type,test-coverage,start-date,description,duration,test-fail,running,label,vts,name,notes,number,qa-status,release,revision,sid,test-skip,status-message,test-ok,timestamp,test-success,version&query={id[4546]}&order-by={}", 200) .content("entity_build.xml"); handler.addRequest(false, "GET", "/qcbin/rest/domains/domain/projects/project/build-types?fields=category,server,id,product,default,defect-filter,description,enabled,last,vts,name,release,sid,version,product-group-id&query={id[110]}&order-by={}", 200) .content("entity_build_type.xml"); handler.async(); String name = translator.translate("4546", new ValueCallback() { @Override public void value(final String value) { handler.done(new Runnable() { @Override public void run() { Assert.assertEquals("myApp #1563", value); } }); } }); Assert.assertNull(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();  }