|
@@ -98,7 +98,7 @@ public class ABeanPropertyTest {
|
|
|
bean.$width = 8;
|
|
bean.$width = 8;
|
|
|
assertEquals(8, map.get("width"));
|
|
assertEquals(8, map.get("width"));
|
|
|
assertEquals(5*8, map.get("area"));
|
|
assertEquals(5*8, map.get("area"));
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
map.get("height");
|
|
map.get("height");
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -135,7 +135,7 @@ public class ABeanPropertyTest {
|
|
|
Wrapper<Object> w3 = p3.bind(bean);
|
|
Wrapper<Object> w3 = p3.bind(bean);
|
|
|
w3.set(4);
|
|
w3.set(4);
|
|
|
assertEquals(4, bean.$height);
|
|
assertEquals(4, bean.$height);
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
w3.get();
|
|
w3.get();
|
|
|
});
|
|
});
|
|
|
assertFalse(p3.isReadable());
|
|
assertFalse(p3.isReadable());
|
|
@@ -143,7 +143,7 @@ public class ABeanPropertyTest {
|
|
|
|
|
|
|
|
BeanProperty p4 = model.property("area").get();
|
|
BeanProperty p4 = model.property("area").get();
|
|
|
assertEquals(4*17, p4.get(bean));
|
|
assertEquals(4*17, p4.get(bean));
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p4.set(bean, 6);
|
|
p4.set(bean, 6);
|
|
|
});
|
|
});
|
|
|
assertTrue(p4.isReadable());
|
|
assertTrue(p4.isReadable());
|
|
@@ -237,12 +237,12 @@ public class ABeanPropertyTest {
|
|
|
BeanProperty p3 = model.property("arrayOW").get();
|
|
BeanProperty p3 = model.property("arrayOW").get();
|
|
|
assertTrue(p3.isWritable());
|
|
assertTrue(p3.isWritable());
|
|
|
assertFalse(p3.isReadable());
|
|
assertFalse(p3.isReadable());
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p3.get(bean);
|
|
p3.get(bean);
|
|
|
});
|
|
});
|
|
|
p3.set(bean, Arrays.asList("a","b","c"));
|
|
p3.set(bean, Arrays.asList("a","b","c"));
|
|
|
assertArrayEquals(new String[]{"a","b","c"}, bean.$arrayOW);
|
|
assertArrayEquals(new String[]{"a","b","c"}, bean.$arrayOW);
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p3.get(bean);
|
|
p3.get(bean);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -250,10 +250,10 @@ public class ABeanPropertyTest {
|
|
|
BeanProperty p4 = model.property("arrayOR").get();
|
|
BeanProperty p4 = model.property("arrayOR").get();
|
|
|
assertFalse(p4.isWritable());
|
|
assertFalse(p4.isWritable());
|
|
|
assertTrue(p4.isReadable());
|
|
assertTrue(p4.isReadable());
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p4.set(bean, Arrays.asList("41","42"));
|
|
p4.set(bean, Arrays.asList("41","42"));
|
|
|
});
|
|
});
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p4.set(bean, null);
|
|
p4.set(bean, null);
|
|
|
});
|
|
});
|
|
|
assertNull(p4.get(bean));
|
|
assertNull(p4.get(bean));
|
|
@@ -270,7 +270,7 @@ public class ABeanPropertyTest {
|
|
|
assertEquals(new TypeToken<List<String>>(){}, p5.type());
|
|
assertEquals(new TypeToken<List<String>>(){}, p5.type());
|
|
|
Wrapper<List<String>> w5 = p5.$bind(bean);
|
|
Wrapper<List<String>> w5 = p5.$bind(bean);
|
|
|
assertNull(w5.get());
|
|
assertNull(w5.get());
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
w5.set(Arrays.asList("q51","q52","q53"));
|
|
w5.set(Arrays.asList("q51","q52","q53"));
|
|
|
});
|
|
});
|
|
|
bean.$arrayIR = new String[]{"51","52","53"};
|
|
bean.$arrayIR = new String[]{"51","52","53"};
|
|
@@ -359,12 +359,12 @@ public class ABeanPropertyTest {
|
|
|
BeanProperty p3 = model.property("listOW").get();
|
|
BeanProperty p3 = model.property("listOW").get();
|
|
|
assertTrue(p3.isWritable());
|
|
assertTrue(p3.isWritable());
|
|
|
assertFalse(p3.isReadable());
|
|
assertFalse(p3.isReadable());
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p3.get(bean);
|
|
p3.get(bean);
|
|
|
});
|
|
});
|
|
|
p3.set(bean, Arrays.asList("a","b","c"));
|
|
p3.set(bean, Arrays.asList("a","b","c"));
|
|
|
assertEquals(Arrays.asList("a","b","c"), bean.$listOW);
|
|
assertEquals(Arrays.asList("a","b","c"), bean.$listOW);
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p3.get(bean);
|
|
p3.get(bean);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -372,10 +372,10 @@ public class ABeanPropertyTest {
|
|
|
BeanProperty p4 = model.property("listOR").get();
|
|
BeanProperty p4 = model.property("listOR").get();
|
|
|
assertFalse(p4.isWritable());
|
|
assertFalse(p4.isWritable());
|
|
|
assertTrue(p4.isReadable());
|
|
assertTrue(p4.isReadable());
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p4.set(bean, Arrays.asList("41","42"));
|
|
p4.set(bean, Arrays.asList("41","42"));
|
|
|
});
|
|
});
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p4.set(bean, null);
|
|
p4.set(bean, null);
|
|
|
});
|
|
});
|
|
|
assertNull(p4.get(bean));
|
|
assertNull(p4.get(bean));
|
|
@@ -392,7 +392,7 @@ public class ABeanPropertyTest {
|
|
|
assertEquals(new TypeToken<List<String>>(){}, p5.type());
|
|
assertEquals(new TypeToken<List<String>>(){}, p5.type());
|
|
|
Wrapper<List<String>> w5 = p5.$bind(bean);
|
|
Wrapper<List<String>> w5 = p5.$bind(bean);
|
|
|
assertNull(w5.get());
|
|
assertNull(w5.get());
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
w5.set(Arrays.asList("q51","q52","q53"));
|
|
w5.set(Arrays.asList("q51","q52","q53"));
|
|
|
});
|
|
});
|
|
|
bean.$listIR = Arrays.asList("51","52","53");
|
|
bean.$listIR = Arrays.asList("51","52","53");
|
|
@@ -425,12 +425,12 @@ public class ABeanPropertyTest {
|
|
|
BeanProperty p3 = model.property("listIW").get();
|
|
BeanProperty p3 = model.property("listIW").get();
|
|
|
assertTrue(p3.isWritable());
|
|
assertTrue(p3.isWritable());
|
|
|
assertFalse(p3.isReadable());
|
|
assertFalse(p3.isReadable());
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p3.get(bean);
|
|
p3.get(bean);
|
|
|
});
|
|
});
|
|
|
p3.set(bean, Arrays.asList("a","b","c"));
|
|
p3.set(bean, Arrays.asList("a","b","c"));
|
|
|
assertEquals(Arrays.asList("a","b","c"), bean.$listIW);
|
|
assertEquals(Arrays.asList("a","b","c"), bean.$listIW);
|
|
|
- assertThrows(IReflectiveException.class, ()->{
|
|
|
|
|
|
|
+ assertThrows(UnsupportedOperationException.class, IReflectiveException.class, ()->{
|
|
|
p3.get(bean);
|
|
p3.get(bean);
|
|
|
});
|
|
});
|
|
|
|
|
|