Add test for getter names starting with "is"

This commit is contained in:
Derek J. Lambert 2018-01-30 09:21:37 -06:00
parent 62486974f5
commit 3a6e6a3471
2 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,8 @@ public class BasicsTest {
throw new IllegalArgumentException("helloworld2", e);
}
}
public boolean getDisabled() { return true; };
public boolean isEnabled() { return !this.getDisabled(); };
static public boolean fieldStaticZ = true;
static public byte fieldStaticB = 127;

View File

@ -71,6 +71,11 @@ class BasicsTest(unittest.TestCase):
self.assertEquals(test.fieldB, 127)
self.assertEquals(test2.fieldB, 10)
def test_instance_getter_naming(self):
test = autoclass('org.jnius.BasicsTest')()
self.assertEquals(test.disabled, True)
self.assertEquals(test.enabled, False)
def test_instance_set_fields(self):
test = autoclass('org.jnius.BasicsTest')()
test.fieldSetZ = True