|
|
@@ -13,6 +13,8 @@ import net.ranides.assira.reflection.adapter.model2.Image2error;
|
|
|
import net.ranides.assira.reflection.adapter.model2.Screen2;
|
|
|
import net.ranides.assira.reflection.adapter.model3.Image3;
|
|
|
import net.ranides.assira.reflection.adapter.model3.Screen3;
|
|
|
+import net.ranides.assira.reflection.adapter.example.LongInterface;
|
|
|
+import net.ranides.assira.reflection.adapter.example.LongMock;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
@@ -177,5 +179,14 @@ public class AdapterFactoryTest {
|
|
|
assertEquals("Adapter{Internal{168:72} => IRecord2}", target2.toString());
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testUnsafe() {
|
|
|
+ LongMock mock = new LongMock();
|
|
|
+ LongInterface adapter = AdapterFactory.getSystem().cast(IClass.typeinfo(LongInterface.class), mock);
|
|
|
+
|
|
|
+ adapter.putNumbers("name", 1200L, "-", -5L);
|
|
|
+ assertEquals(33L, adapter.parseMe("33"));
|
|
|
|
|
|
+ assertEquals(Arrays.asList("putNumbers name:1200:-:-5", "parseMe 33"), mock.calls);
|
|
|
+ }
|
|
|
}
|