8485868788899091929394
m.resolveType("Bean"); c.setReturnValue(IntHolder.class); replayControls(); IntHolder ih = (IntHolder) t.translate(m, Object.class, "Bean,value=37", null); assertEquals(37, ih.getValue()); verifyControls(); }
105106107108109110111112113114115
replayControls(); try { t.translate(m, null, PrivateObject.class.getName(), null); unreachable(); } catch (ApplicationRuntimeException ex) { assertExceptionSubstring(
4142434445464748495051
public void testNull() { InstanceTranslator t = new InstanceTranslator(); assertNull(t.translate(null, null, null, null)); } public void testBadClass() throws Exception { InstanceTranslator t = new InstanceTranslator();
6162636465666768697071
replayControls(); try { t.translate(m, null, "bad.class.Name", null); } catch (ApplicationRuntimeException ex) { assertExceptionSubstring(ex, "Could not load class bad.class.Name"); }
8889909192939495969798
6263646566676869707172
replayControls(); try { t.translate(m, null, "bad.class.Name", null); } catch (ApplicationRuntimeException ex) { assertSame(cause, ex); }