mirror of https://github.com/apache/cloudstack.git
test fix: no assertion on the number of fileds returned
Removed the assertion on the number of fields from ReflectUtil because it did not work with bytecode manipulation like what sonar works with. Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
This commit is contained in:
parent
fa0c685bcb
commit
982db550eb
|
|
@ -115,7 +115,6 @@ public final class ReflectUtilTest {
|
|||
public void getAllFieldsForClassWithFoo() throws NoSuchFieldException, SecurityException {
|
||||
Set<Field> fooFields = ReflectUtil.getAllFieldsForClass(Foo.class, new Class<?> [] {});
|
||||
Assert.assertNotNull(fooFields);
|
||||
Assert.assertEquals(2, fooFields.size());
|
||||
Assert.assertTrue(fooFields.contains(Foo.class.getDeclaredField("fooField")));
|
||||
Assert.assertTrue(fooFields.contains(Foo.class.getDeclaredField("fooIntField")));
|
||||
}
|
||||
|
|
@ -124,7 +123,6 @@ public final class ReflectUtilTest {
|
|||
public void getAllFieldsForClassWithBar() throws NoSuchFieldException, SecurityException {
|
||||
Set<Field> barFields = ReflectUtil.getAllFieldsForClass(Bar.class, new Class<?> [] {});
|
||||
Assert.assertNotNull(barFields);
|
||||
Assert.assertEquals(4, barFields.size());
|
||||
Assert.assertTrue(barFields.contains(Foo.class.getDeclaredField("fooField")));
|
||||
Assert.assertTrue(barFields.contains(Foo.class.getDeclaredField("fooIntField")));
|
||||
Assert.assertTrue(barFields.contains(Bar.class.getDeclaredField("barField")));
|
||||
|
|
@ -135,7 +133,6 @@ public final class ReflectUtilTest {
|
|||
public void getAllFieldsForClassWithBarWithoutFoo() throws NoSuchFieldException, SecurityException {
|
||||
Set<Field> barFields = ReflectUtil.getAllFieldsForClass(Bar.class, new Class<?> [] {Foo.class});
|
||||
Assert.assertNotNull(barFields);
|
||||
Assert.assertEquals(2, barFields.size());
|
||||
Assert.assertTrue(barFields.contains(Bar.class.getDeclaredField("barField")));
|
||||
Assert.assertTrue(barFields.contains(Bar.class.getDeclaredField("barIntField")));
|
||||
}
|
||||
|
|
@ -144,7 +141,6 @@ public final class ReflectUtilTest {
|
|||
public void getAllFieldsForClassWithBazWithoutBar() throws NoSuchFieldException, SecurityException {
|
||||
Set<Field> bazFields = ReflectUtil.getAllFieldsForClass(Baz.class, new Class<?> [] {Bar.class});
|
||||
Assert.assertNotNull(bazFields);
|
||||
Assert.assertEquals(4, bazFields.size());
|
||||
Assert.assertTrue(bazFields.contains(Foo.class.getDeclaredField("fooField")));
|
||||
Assert.assertTrue(bazFields.contains(Foo.class.getDeclaredField("fooIntField")));
|
||||
Assert.assertTrue(bazFields.contains(Baz.class.getDeclaredField("bazField")));
|
||||
|
|
|
|||
Loading…
Reference in New Issue