target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testGetMethod_InterfaceMethodIsFound() { Optional<Method> method = BeanUtils.getMethod(Foo.class, (m) -> m.getName().equals("iFoo")); assertThat(method, is(present())); } | public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... |
@Test public void testReadValue() { TestObject testObject = new TestObject(); PropertyAccessDescriptor<TestObject, Long> descriptor = new PropertyAccessDescriptor<>(TestObject.class, TestObject.READ_ONLY_LONG_PROPERTY); ReadMethod<TestObject, Long> readMethod = descriptor.createReadMethod(); assertEquals(42, readMethod... | public V readValue(T boundObject) { if (canRead()) { return readValueWithExceptionHandling(boundObject); } else { throw new IllegalStateException( "Cannot find getter method for " + boundObject.getClass().getName() + "#" + getPropertyName()); } } | ReadMethod extends AbstractMethod<T> { public V readValue(T boundObject) { if (canRead()) { return readValueWithExceptionHandling(boundObject); } else { throw new IllegalStateException( "Cannot find getter method for " + boundObject.getClass().getName() + "#" + getPropertyName()); } } } | ReadMethod extends AbstractMethod<T> { public V readValue(T boundObject) { if (canRead()) { return readValueWithExceptionHandling(boundObject); } else { throw new IllegalStateException( "Cannot find getter method for " + boundObject.getClass().getName() + "#" + getPropertyName()); } } ReadMethod(PropertyAccessDescripto... | ReadMethod extends AbstractMethod<T> { public V readValue(T boundObject) { if (canRead()) { return readValueWithExceptionHandling(boundObject); } else { throw new IllegalStateException( "Cannot find getter method for " + boundObject.getClass().getName() + "#" + getPropertyName()); } } ReadMethod(PropertyAccessDescripto... | ReadMethod extends AbstractMethod<T> { public V readValue(T boundObject) { if (canRead()) { return readValueWithExceptionHandling(boundObject); } else { throw new IllegalStateException( "Cannot find getter method for " + boundObject.getClass().getName() + "#" + getPropertyName()); } } ReadMethod(PropertyAccessDescripto... |
@Test public void testReadValue_NoGetterMethod() { PropertyAccessDescriptor<?, ?> descriptor = new PropertyAccessDescriptor<>(TestObject.class, TestObject.DO_SOMETHING_METHOD); ReadMethod<?, ?> readMethod = descriptor.createReadMethod(); assertFalse(readMethod.canRead()); } | public boolean canRead() { return hasMethod(); } | ReadMethod extends AbstractMethod<T> { public boolean canRead() { return hasMethod(); } } | ReadMethod extends AbstractMethod<T> { public boolean canRead() { return hasMethod(); } ReadMethod(PropertyAccessDescriptor<T, V> descriptor); } | ReadMethod extends AbstractMethod<T> { public boolean canRead() { return hasMethod(); } ReadMethod(PropertyAccessDescriptor<T, V> descriptor); boolean canRead(); V readValue(T boundObject); @SuppressWarnings("unchecked") Class<V> getReturnType(); } | ReadMethod extends AbstractMethod<T> { public boolean canRead() { return hasMethod(); } ReadMethod(PropertyAccessDescriptor<T, V> descriptor); boolean canRead(); V readValue(T boundObject); @SuppressWarnings("unchecked") Class<V> getReturnType(); } |
@Test public void testReadValue_VoidGetterMethod() { PropertyAccessDescriptor<?, ?> descriptor = new PropertyAccessDescriptor<>(TestObject.class, "void"); ReadMethod<?, ?> readMethod = descriptor.createReadMethod(); assertFalse(readMethod.canRead()); } | public boolean canRead() { return hasMethod(); } | ReadMethod extends AbstractMethod<T> { public boolean canRead() { return hasMethod(); } } | ReadMethod extends AbstractMethod<T> { public boolean canRead() { return hasMethod(); } ReadMethod(PropertyAccessDescriptor<T, V> descriptor); } | ReadMethod extends AbstractMethod<T> { public boolean canRead() { return hasMethod(); } ReadMethod(PropertyAccessDescriptor<T, V> descriptor); boolean canRead(); V readValue(T boundObject); @SuppressWarnings("unchecked") Class<V> getReturnType(); } | ReadMethod extends AbstractMethod<T> { public boolean canRead() { return hasMethod(); } ReadMethod(PropertyAccessDescriptor<T, V> descriptor); boolean canRead(); V readValue(T boundObject); @SuppressWarnings("unchecked") Class<V> getReturnType(); } |
@Test public void testWriteValue() { TestObject testObject = new TestObject(); descriptor = new PropertyAccessDescriptor<>(TestObject.class, TestObject.BOOLEAN_PROPERTY); WriteMethod<TestObject, Boolean> writeMethod = descriptor.createWriteMethod(); writeMethod.writeValue(testObject, true); } | public void writeValue(T target, @CheckForNull V value) { try { setter().accept(target, value); } catch (IllegalArgumentException | IllegalStateException e) { throw new LinkkiBindingException( "Cannot write value: " + value + " in " + getBoundClass() + "#" + getPropertyName(), e); } } | WriteMethod extends AbstractMethod<T> { public void writeValue(T target, @CheckForNull V value) { try { setter().accept(target, value); } catch (IllegalArgumentException | IllegalStateException e) { throw new LinkkiBindingException( "Cannot write value: " + value + " in " + getBoundClass() + "#" + getPropertyName(), e)... | WriteMethod extends AbstractMethod<T> { public void writeValue(T target, @CheckForNull V value) { try { setter().accept(target, value); } catch (IllegalArgumentException | IllegalStateException e) { throw new LinkkiBindingException( "Cannot write value: " + value + " in " + getBoundClass() + "#" + getPropertyName(), e)... | WriteMethod extends AbstractMethod<T> { public void writeValue(T target, @CheckForNull V value) { try { setter().accept(target, value); } catch (IllegalArgumentException | IllegalStateException e) { throw new LinkkiBindingException( "Cannot write value: " + value + " in " + getBoundClass() + "#" + getPropertyName(), e)... | WriteMethod extends AbstractMethod<T> { public void writeValue(T target, @CheckForNull V value) { try { setter().accept(target, value); } catch (IllegalArgumentException | IllegalStateException e) { throw new LinkkiBindingException( "Cannot write value: " + value + " in " + getBoundClass() + "#" + getPropertyName(), e)... |
@Test public void testRead() { String propertyValue = stringAccessor.getPropertyValue(testObject); assertEquals(STRING_PROPERTY_INITIAL_VALUE, propertyValue); } | public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... |
@Test public void testWrite() { assertEquals(STRING_PROPERTY_INITIAL_VALUE, testObject.getStringProperty()); stringAccessor.setPropertyValue(testObject, "anotherValue"); assertEquals("anotherValue", testObject.getStringProperty()); } | public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } } | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V va... | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V va... |
@SuppressWarnings({ "rawtypes", "unchecked" }) @Test public void testWriteWrongType() { Assertions.assertThrows(RuntimeException.class, () -> { ((PropertyAccessor)stringAccessor).setPropertyValue(testObject, 5); }); } | public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } } | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V va... | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V va... |
@Test public void testConstructor() { String boundProperty = stringAccessor.getPropertyName(); assertNotNull(boundProperty); } | public String getPropertyName() { return propertyName; } | PropertyAccessor { public String getPropertyName() { return propertyName; } } | PropertyAccessor { public String getPropertyName() { return propertyName; } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public String getPropertyName() { return propertyName; } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean canWrite(); bool... | PropertyAccessor { public String getPropertyName() { return propertyName; } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean canWrite(); bool... |
@Test public void testCanRead() { TestObject testObject2 = new TestObject(); PropertyAccessor<TestObject, Long> propertyAccessor = new PropertyAccessor<>(TestObject.class, TestObject.READ_ONLY_LONG_PROPERTY); assertThat((propertyAccessor.canWrite()), is(false)); assertThat(propertyAccessor.canRead()); Long propertyValu... | public boolean canRead() { return readMethod.canRead(); } | PropertyAccessor { public boolean canRead() { return readMethod.canRead(); } } | PropertyAccessor { public boolean canRead() { return readMethod.canRead(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public boolean canRead() { return readMethod.canRead(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean canWrite(); boo... | PropertyAccessor { public boolean canRead() { return readMethod.canRead(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean canWrite(); boo... |
@Test public void testSetPropertyValue_readOnlyProperty() { TestObject testObject2 = new TestObject(); PropertyAccessor<TestObject, Long> accessor = new PropertyAccessor<>(TestObject.class, TestObject.READ_ONLY_LONG_PROPERTY); Assertions.assertThrows(LinkkiBindingException.class, () -> { accessor.setPropertyValue(testO... | public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } } | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V va... | PropertyAccessor { public void setPropertyValue(T boundObject, @CheckForNull V value) { writeMethod.writeValue(boundObject, value); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V va... |
@Test public void testGetMethod_SuperTypeMethodIsFound() { Optional<Method> method = BeanUtils.getMethod(Foo.class, (m) -> m.getName().equals("superFoo")); assertThat(method, is(present())); } | public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... |
@Test public void testGetValueClass() { PropertyAccessor<TestObject, Long> accessor = new PropertyAccessor<>(TestObject.class, TestObject.READ_ONLY_LONG_PROPERTY); assertEquals(long.class, accessor.getValueClass()); } | public Class<?> getValueClass() { return readMethod.getReturnType(); } | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } } | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean ca... | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean ca... |
@Test public void testGetValueClass2() { PropertyAccessor<TestObject, Boolean> accessor = new PropertyAccessor<>(TestObject.class, TestObject.BOOLEAN_PROPERTY); assertEquals(boolean.class, accessor.getValueClass()); } | public Class<?> getValueClass() { return readMethod.getReturnType(); } | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } } | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean ca... | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean ca... |
@Test public void testGetValueClassIllegalProperty() { PropertyAccessor<TestObject, ?> accessor = new PropertyAccessor<>(TestObject.class, "illegalProperty"); Assertions.assertThrows(IllegalArgumentException.class, () -> { accessor.getValueClass(); }); } | public Class<?> getValueClass() { return readMethod.getReturnType(); } | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } } | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean ca... | PropertyAccessor { public Class<?> getValueClass() { return readMethod.getReturnType(); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObject); boolean ca... |
@Test public void testLongProperty() { PropertyAccessor<TestObject, Long> propertyAccessor = new PropertyAccessor<>(TestObject.class, TestObject.READ_ONLY_LONG_PROPERTY); Long propertyValue = propertyAccessor.getPropertyValue(testObject); assertEquals(42, propertyValue.longValue()); } | public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... |
@Test public void testDefaultMethod() { PropertyAccessor<TestInterface, String> propertyAccessor = new PropertyAccessor<>(TestInterfaceImpl.class, TestInterface.RO_DEFAULT_METHOD); TestInterface testInterfaceImpl = new TestInterfaceImpl(); String propertyValue = propertyAccessor.getPropertyValue(testInterfaceImpl); ass... | public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... |
@Test public void testDefaultMethod_InSubclass() { PropertyAccessor<TestInterface, String> propertyAccessor = new PropertyAccessor<>( TestInterfaceImplSub.class, TestInterface.RO_DEFAULT_METHOD); TestInterface testInterfaceImpl = new TestInterfaceImplSub(); String propertyValue = propertyAccessor.getPropertyValue(testI... | public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... |
@Test public void testDefaultMethod_OverwrittenInSubclass() { PropertyAccessor<TestInterface, String> propertyAccessor = new PropertyAccessor<>( TestInterfaceOverwriting.class, TestInterface.RO_DEFAULT_METHOD); TestInterface testInterfaceImpl = new TestInterfaceOverwriting(); String propertyValue = propertyAccessor.get... | public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... |
@Test public void testDefaultMethod_OtherPackage() { PropertyAccessor<TestInterface, String> propertyAccessor = new PropertyAccessor<>( OtherPackageTestObject.class, TestInterface.RO_DEFAULT_METHOD); TestInterface testInterfaceImpl = new OtherPackageTestObject(); String propertyValue = propertyAccessor.getPropertyValue... | public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... |
@Test public void testDefaultMethod_OtherPackagePrivate() { TestInterface testInterfaceImpl = OtherPackageTestObject.getPackagePrivateInstance(); PropertyAccessor<TestInterface, String> propertyAccessor = new PropertyAccessor<>( testInterfaceImpl.getClass(), TestInterface.RO_DEFAULT_METHOD); String propertyValue = prop... | public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... |
@Test public void testDefaultMethod_OtherPackageProtected() { PropertyAccessor<TestPublicSubclass, Integer> propertyAccessor = new PropertyAccessor<>( TestPublicSubclass.class, TestPublicSubclass.PROPERTY_ANSWER); int propertyValue = propertyAccessor.getPropertyValue(new TestPublicSubclass()); assertEquals(42, property... | public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); } | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... | PropertyAccessor { public V getPropertyValue(T boundObject) { return readMethod.readValue(boundObject); } PropertyAccessor(Class<? extends T> boundClass, String propertyName); String getPropertyName(); V getPropertyValue(T boundObject); void setPropertyValue(T boundObject, @CheckForNull V value); void invoke(T boundObj... |
@Test public void testGetMethod_PrivateMethodIsFound() { Optional<Method> method = BeanUtils.getMethod(Foo.class, (m) -> m.getName().equals("bar")); assertThat(method, is(present())); } | public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... |
@Test public void testHasNoMethod() { when(descriptor.getReflectionWriteMethod()).thenReturn(lazyCaching(Optional::empty)); AbstractMethod<?> writeMethod = new WriteMethod<>(descriptor); assertFalse(writeMethod.hasMethod()); } | protected boolean hasMethod() { return getReflectionMethod().isPresent(); } | AbstractMethod { protected boolean hasMethod() { return getReflectionMethod().isPresent(); } } | AbstractMethod { protected boolean hasMethod() { return getReflectionMethod().isPresent(); } AbstractMethod(PropertyAccessDescriptor<T, ?> descriptor, Supplier<Optional<Method>> methodSupplier); } | AbstractMethod { protected boolean hasMethod() { return getReflectionMethod().isPresent(); } AbstractMethod(PropertyAccessDescriptor<T, ?> descriptor, Supplier<Optional<Method>> methodSupplier); } | AbstractMethod { protected boolean hasMethod() { return getReflectionMethod().isPresent(); } AbstractMethod(PropertyAccessDescriptor<T, ?> descriptor, Supplier<Optional<Method>> methodSupplier); } |
@Test public void testGetValueProperty() { assertEquals("test", namingConvention.getValueProperty("test")); } | public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } | PropertyNamingConvention { public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } } | PropertyNamingConvention { public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } } | PropertyNamingConvention { public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String property); Str... | PropertyNamingConvention { public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String property); Str... |
@Test public void testGetValueProperty_null() { Assertions.assertThrows(NullPointerException.class, () -> { namingConvention.getValueProperty(null); }); } | public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } | PropertyNamingConvention { public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } } | PropertyNamingConvention { public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } } | PropertyNamingConvention { public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String property); Str... | PropertyNamingConvention { public String getValueProperty(String property) { return requireNonNull(property, "property must not be null"); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String property); Str... |
@Test public void testGetEnabledProperty() { assertEquals("testEnabled", namingConvention.getEnabledProperty("test")); } | public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... |
@Test public void testGetEnabledProperty_empty() { assertEquals("enabled", namingConvention.getEnabledProperty(StringUtils.EMPTY)); } | public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... |
@Test public void testGetEnabledProperty_null() { Assertions.assertThrows(NullPointerException.class, () -> { namingConvention.getEnabledProperty(null); }); } | public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... | PropertyNamingConvention { public String getEnabledProperty(String property) { return getCombinedPropertyName(property, ENABLED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... |
@Test public void testGetVisibleProperty() { assertEquals("testVisible", namingConvention.getVisibleProperty("test")); } | public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... |
@Test public void testGetVisibleProperty_empty() { assertEquals("visible", namingConvention.getVisibleProperty(StringUtils.EMPTY)); } | public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... |
@Test public void testGetVisibleProperty_null() { Assertions.assertThrows(NullPointerException.class, () -> { namingConvention.getVisibleProperty(null); }); } | public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... | PropertyNamingConvention { public String getVisibleProperty(String property) { return getCombinedPropertyName(property, VISIBLE_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String propert... |
@Test public void testGetMessagesProperty() { assertEquals("testMessages", namingConvention.getMessagesProperty("test")); } | public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String prope... | PropertyNamingConvention { public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String prope... |
@Test public void testGetMethod_OneMatchingMethodIsFound() { Assertions.assertThrows(IllegalStateException.class, () -> { BeanUtils.getMethod(Foo.class, (m) -> m.getName().equals("baz")); }); } | public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... |
@Test public void testGetMessagesProperty_null() { Assertions.assertThrows(NullPointerException.class, () -> { namingConvention.getMessagesProperty(null); }); } | public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String prope... | PropertyNamingConvention { public String getMessagesProperty(String property) { return getCombinedPropertyName(property, MESSAGES_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String prope... |
@Test public void testGetRequiredProperty() { assertEquals("testRequired", namingConvention.getRequiredProperty("test")); } | public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String prope... | PropertyNamingConvention { public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String prope... |
@Test public void testGetRequiredProperty_null() { Assertions.assertThrows(NullPointerException.class, () -> { namingConvention.getRequiredProperty(null); }); } | public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String prope... | PropertyNamingConvention { public String getRequiredProperty(String property) { return getCombinedPropertyName(property, REQUIRED_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProperty(String prope... |
@Test public void testGetAvailableValuesProperty() { assertEquals("testAvailableValues", namingConvention.getAvailableValuesProperty("test")); } | public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProper... | PropertyNamingConvention { public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProper... |
@Test public void testGetAvailableValuesProperty_null() { Assertions.assertThrows(NullPointerException.class, () -> { namingConvention.getAvailableValuesProperty(null); }); } | public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } | PropertyNamingConvention { public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } } | PropertyNamingConvention { public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProper... | PropertyNamingConvention { public String getAvailableValuesProperty(String property) { return getCombinedPropertyName(property, AVAILABLE_VALUES_PROPERTY_SUFFIX); } String getValueProperty(String property); String getEnabledProperty(String property); String getVisibleProperty(String property); String getMessagesProper... |
@Test public void testGetValueClass() { assertEquals(String.class, setupPmoDispatcher(ABC).getValueClass()); assertEquals(String.class, setupPmoDispatcher(XYZ).getValueClass()); assertEquals(Boolean.class, setupPmoDispatcher(OBJECT_BOOLEAN).getValueClass()); assertEquals(Boolean.TYPE, setupPmoDispatcher(PRIMITIVE_BOOLE... | @Override public Class<?> getValueClass() { Object boundObject = getBoundObject(); if (boundObject != null && hasReadMethod(getProperty())) { Class<?> valueClass = getAccessor(getProperty()).getValueClass(); return valueClass; } else { return fallbackDispatcher.getValueClass(); } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public Class<?> getValueClass() { Object boundObject = getBoundObject(); if (boundObject != null && hasReadMethod(getProperty())) { Class<?> valueClass = getAccessor(getProperty()).getValueClass(); return valueClass; } else { return fallbackDispatch... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public Class<?> getValueClass() { Object boundObject = getBoundObject(); if (boundObject != null && hasReadMethod(getProperty())) { Class<?> valueClass = getAccessor(getProperty()).getValueClass(); return valueClass; } else { return fallbackDispatch... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public Class<?> getValueClass() { Object boundObject = getBoundObject(); if (boundObject != null && hasReadMethod(getProperty())) { Class<?> valueClass = getAccessor(getProperty()).getValueClass(); return valueClass; } else { return fallbackDispatch... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public Class<?> getValueClass() { Object boundObject = getBoundObject(); if (boundObject != null && hasReadMethod(getProperty())) { Class<?> valueClass = getAccessor(getProperty()).getValueClass(); return valueClass; } else { return fallbackDispatch... |
@Test public void testGetValue_FromPmo() { assertEquals("890", setupPmoDispatcher(XYZ).pull(Aspect.of(""))); testPmo.setPmoProp("abc123"); assertEquals("abc123", setupPmoDispatcher(TestPMO.PROPERTY_PMO_PROP).pull(Aspect.of(""))); } | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testGetValue_FromModelObject() { assertEquals("567", setupPmoDispatcher(ABC).pull(Aspect.of(""))); testModelObject.setAbc("anotherValue"); assertEquals("anotherValue", setupPmoDispatcher(ABC).pull(Aspect.of(""))); } | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testGetValue_ChangedModelObject() { TestModelObject newTestModelObject = new TestModelObject(); testPmo.setModelObject(newTestModelObject); newTestModelObject.setAbc("newAbcValue"); assertEquals("newAbcValue", setupPmoDispatcher(ABC).pull(Aspect.of(""))); } | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testGetValue_ChangedPmo() { TestModelObject newTestModelObject = new TestModelObject(); testPmo = new TestPMO(newTestModelObject); testPmo.setPmoProp("newValue"); assertEquals("newValue", setupPmoDispatcher(TestPMO.PROPERTY_PMO_PROP).pull(Aspect.of(""))); } | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testGetMethods_AllMatchingMethodsAreFound() { Stream<Method> declaredMethods = BeanUtils.getMethods(Foo.class, (m) -> m.getName().equals("baz")); assertThat(declaredMethods.count(), is(2L)); } | public static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate) { return Arrays.stream(clazz.getMethods()) .filter(m -> !m.isSynthetic()) .filter(predicate); } | BeanUtils { public static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate) { return Arrays.stream(clazz.getMethods()) .filter(m -> !m.isSynthetic()) .filter(predicate); } } | BeanUtils { public static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate) { return Arrays.stream(clazz.getMethods()) .filter(m -> !m.isSynthetic()) .filter(predicate); } private BeanUtils(); } | BeanUtils { public static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate) { return Arrays.stream(clazz.getMethods()) .filter(m -> !m.isSynthetic()) .filter(predicate); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?... | BeanUtils { public static Stream<Method> getMethods(Class<?> clazz, Predicate<Method> predicate) { return Arrays.stream(clazz.getMethods()) .filter(m -> !m.isSynthetic()) .filter(predicate); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?... |
@Test public void testGetValue_ChangedPmoAndModelObject() { TestModelObject newTestModelObject = new TestModelObject(); testPmo = new TestPMO(newTestModelObject); testPmo.setPmoProp("newValue"); newTestModelObject.setAbc("newAbcValue"); assertEquals("newValue", setupPmoDispatcher(TestPMO.PROPERTY_PMO_PROP).pull(Aspect.... | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testGetValue_IllegalProperty() { ExceptionPropertyDispatcher exceptionDispatcher = new ExceptionPropertyDispatcher("doesNotExist", testModelObject, testPmo); ReflectionPropertyDispatcher modelObjectDispatcher = new ReflectionPropertyDispatcher(this::getTestModelObject, "doesNotExist", exceptionDispatc... | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testGetValue_NullProperty() { Assertions.assertThrows(NullPointerException.class, () -> { setupPmoDispatcher(null).pull(Aspect.of("")); }); } | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testSetValue_DispatchToModelObject() { assertEquals("567", setupPmoDispatcher(ABC).pull(Aspect.of(""))); } | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testGetMessages_Empty() { MessageList messageList = new MessageList(); assertThat(setupPmoDispatcher(XYZ).getMessages(messageList), emptyMessageList()); assertThat(setupPmoDispatcher("invalidProperty").getMessages(messageList), emptyMessageList()); } | @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty()); msgListForBoundObject.add(fallbackDispatcher.getMessages(me... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... |
@Test public void testGetMessages_ShouldReturnMessagesFromModelObject() { MessageList messageList = new MessageList(); Message msg1 = Message.builder(ABC, Severity.ERROR).invalidObjectWithProperties(testModelObject, XYZ) .create(); Message msg2 = Message.builder(ABC, Severity.ERROR).invalidObjectWithProperties(testMode... | @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty()); msgListForBoundObject.add(fallbackDispatcher.getMessages(me... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... |
@Test public void testGetMessages_ShouldReturnMessagesFromPmo() { MessageList messageList = new MessageList(); Message msg1 = Message.builder(ABC, Severity.ERROR).invalidObjectWithProperties(testPmo, XYZ).create(); Message msg2 = Message.builder(ABC, Severity.ERROR).invalidObjectWithProperties(testPmo, ABC).create(); M... | @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty()); msgListForBoundObject.add(fallbackDispatcher.getMessages(me... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... |
@Test public void testGetMessages_IgnoreIrrelevantMessages() { MessageList messageList = new MessageList(); Message msg1 = Message.builder(ABC, Severity.ERROR).invalidObjectWithProperties(new Object(), XYZ).create(); Message msg2 = Message.builder(ABC, Severity.ERROR).invalidObjectWithProperties(new Object(), ABC).crea... | @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty()); msgListForBoundObject.add(fallbackDispatcher.getMessages(me... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { Object boundObject = getBoundObject(); if (boundObject == null) { return new MessageList(); } else { MessageList msgListForBoundObject = messageList.getMessagesFor(boundObject, getProperty())... |
@Test public void testModelObjectNullReturn() { testModelObject = null; testPmo = new TestPMO(null); assertEquals("890", setupModelObjectDispatcher("xyz").pull(Aspect.of(""))); } | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testPull_Static() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> testPmo, TestModelObject.PROPERTY_ABC, new ExceptionPropertyDispatcher(TestModelObject.PROPERTY_ABC)); Assertions.assertThrows(IllegalStateException.class, () -> { dispatcher.pull(Aspect.of(VisibleAspe... | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testGetMethod_NoMethodIsFound() { Optional<Method> method = BeanUtils.getMethod(Foo.class, (m) -> m.getName().equals("hammaned")); assertThat(method, is(not(present()))); } | public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } } | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... | BeanUtils { public static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes) { try { return clazz.getMethod(name, parameterTypes); } catch (NoSuchMethodException e) { throw new IllegalArgumentException(e); } catch (SecurityException e) { throw new IllegalStateException(e); } } private BeanUtils(... |
@Test public void testPull_Dynamic() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> testPmo, TestPMO.PROPERTY_XYZ, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_XYZ)); testModelObject.setAbc("nicht bla"); assertThat(dispatcher.pull(Aspect.of(VisibleAspectDefinition.NAME)), is(fals... | @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check your %s", aspect, getClass().getSimpleName(), BindingContext.cla... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override @SuppressWarnings("unchecked") public <V> V pull(Aspect<V> aspect) { if (aspect.isValuePresent()) { throw new IllegalStateException(String .format("Static aspect %s should not be handled by %s. It seems like the dispatcher chain is broken, check you... |
@Test public void testPush_Static() { TestModelObject spyObject = spy(new TestModelObject()); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> spyObject, TestModelObject.PROPERTY_ABC, new ExceptionPropertyDispatcher(TestModelObject.PROPERTY_ABC)); dispatcher.push(Aspect.of("", "something... | @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... |
@Test public void testPush_Static_PmoWithoutReadMethod() { PropertyDispatcher mockedDispatcher = noActionInPushMockedDispatcher(); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(this::getTestPmo, TestPMO.INVALID_PROPERTY_MISSING_GETTER_PMO, mockedDispatcher); dispatcher.push(Aspect.of("", "s... | @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... |
@Test public void testPush_Static_PmoWithoutWriteMethod() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(this::getTestPmo, TestPMO.PROPERTY_PMO_GETTER_ONLY, noActionInPushMockedDispatcher()); Assertions.assertThrows(IllegalArgumentException.class, () -> { dispatcher.push(Aspect.of("", "som... | @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... |
@Test public void testPush_Dynamic() { TestPMO spyPmo = spy(testPmo); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> spyPmo, TestPMO.PROPERTY_BUTTON_CLICK, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_BUTTON_CLICK)); dispatcher.push(Aspect.of("")); verify(spyPmo).buttonClick(); } | @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... |
@Test public void testPush_Dynamic_NoBoundObject() { TestPMO spyPmo = spy(testPmo); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> null, TestPMO.PROPERTY_BUTTON_CLICK, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_BUTTON_CLICK)); dispatcher.push(Aspect.of("")); verify(spyPmo, never(... | @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... |
@Test public void testPush_Dynamic_NoMethod() { TestPMO spyPmo = spy(testPmo); ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> spyPmo, TestPMO.PROPERTY_BUTTON_CLICK, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_BUTTON_CLICK)); Assertions.assertThrows(IllegalArgumentException.class, ... | @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } } | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> void push(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject != null) { if (aspect.isValuePresent()) { callSetter(aspect); } else { invoke(aspect); } } } ReflectionPropertyDispatcher(Supplier<?> bound... |
@Test public void testIsPushable_WithReadWithoutWrite() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(this::getTestPmo, TestPMO.PROPERTY_PMO_GETTER_ONLY, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_PMO_GETTER_ONLY)); assertThat(dispatcher.isPushable(Aspect.of("", "something")), is(fa... | @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) ... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... |
@Test public void testIsPushable_WithReadAndWrite() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(this::getTestPmo, TestPMO.PROPERTY_PMO_PROP, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_PMO_PROP)); assertThat(dispatcher.isPushable(Aspect.of("", "something")), is(true)); } | @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) ... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... |
@Test public void testIsPushable_WithReadAndWriteNoBoundObject() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> null, TestPMO.PROPERTY_PMO_PROP, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_PMO_PROP)); assertThat(dispatcher.isPushable(Aspect.of("", "something")), is(false)); } | @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) ... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... |
@Test public void testGetPropertyName_String_Void() { assertThat(BeanUtils.getPropertyName(Void.TYPE, "getFoo"), is("getFoo")); assertThat(BeanUtils.getPropertyName(Void.TYPE, "isFoo"), is("isFoo")); assertThat(BeanUtils.getPropertyName(Void.TYPE, "foo"), is("foo")); } | public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Cla... | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Cla... |
@Test public void testIsPushable_NoInvokeMethod() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(this::getTestPmo, TestPMO.PROPERTY_PMO_GETTER_ONLY, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_PMO_GETTER_ONLY)); assertThat(dispatcher.isPushable(Aspect.of("")), is(false)); } | @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) ... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... |
@Test public void testIsPushable_InvokeMethod() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(this::getTestPmo, TestPMO.PROPERTY_BUTTON_CLICK, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_BUTTON_CLICK)); assertThat(dispatcher.isPushable(Aspect.of("")), is(true)); } | @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) ... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... |
@Test public void testIsPushable_InvokeMethodNoBoundObject() { ReflectionPropertyDispatcher dispatcher = new ReflectionPropertyDispatcher(() -> null, TestPMO.PROPERTY_BUTTON_CLICK, new ExceptionPropertyDispatcher(TestPMO.PROPERTY_BUTTON_CLICK)); assertThat(dispatcher.isPushable(Aspect.of("")), is(false)); } | @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.isValuePresent()) { return (hasReadMethod(propertyAspectName) ... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... | ReflectionPropertyDispatcher implements PropertyDispatcher { @Override public <V> boolean isPushable(Aspect<V> aspect) { @CheckForNull Object boundObject = getBoundObject(); if (boundObject == null) { return fallbackDispatcher.isPushable(aspect); } String propertyAspectName = getPropertyAspectName(aspect); if (aspect.i... |
@Test public void testGetValue() { Aspect<Object> aspect = Aspect.of(""); decorator.pull(aspect); verify(wrappedDispatcher).pull(aspect); } | @Override public <T> T pull(Aspect<T> aspect) { return getWrappedDispatcher().pull(aspect); } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public <T> T pull(Aspect<T> aspect) { return getWrappedDispatcher().pull(aspect); } } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public <T> T pull(Aspect<T> aspect) { return getWrappedDispatcher().pull(aspect); } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public <T> T pull(Aspect<T> aspect) { return getWrappedDispatcher().pull(aspect); } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList m... | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public <T> T pull(Aspect<T> aspect) { return getWrappedDispatcher().pull(aspect); } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList m... |
@Test public void testGetValueClass() { decorator.getValueClass(); verify(wrappedDispatcher).getValueClass(); } | @Override public Class<?> getValueClass() { return wrappedDispatcher.getValueClass(); } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public Class<?> getValueClass() { return wrappedDispatcher.getValueClass(); } } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public Class<?> getValueClass() { return wrappedDispatcher.getValueClass(); } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public Class<?> getValueClass() { return wrappedDispatcher.getValueClass(); } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList message... | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public Class<?> getValueClass() { return wrappedDispatcher.getValueClass(); } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList message... |
@Test public void testMessages() { MessageList messageList = new MessageList(); decorator.getMessages(messageList); verify(wrappedDispatcher).getMessages(messageList); } | @Override public MessageList getMessages(MessageList messageList) { return getWrappedDispatcher().getMessages(messageList); } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { return getWrappedDispatcher().getMessages(messageList); } } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { return getWrappedDispatcher().getMessages(messageList); } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { return getWrappedDispatcher().getMessages(messageList); } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); @Override Class<?> getValueClass(); @Override Messa... | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { return getWrappedDispatcher().getMessages(messageList); } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); @Override Class<?> getValueClass(); @Override Messa... |
@Test public void testGetWrappedDispatcher() { assertEquals(wrappedDispatcher, decorator.getWrappedDispatcher()); } | protected PropertyDispatcher getWrappedDispatcher() { return wrappedDispatcher; } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { protected PropertyDispatcher getWrappedDispatcher() { return wrappedDispatcher; } } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { protected PropertyDispatcher getWrappedDispatcher() { return wrappedDispatcher; } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); } | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { protected PropertyDispatcher getWrappedDispatcher() { return wrappedDispatcher; } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList messageList);... | AbstractPropertyDispatcherDecorator implements PropertyDispatcher { protected PropertyDispatcher getWrappedDispatcher() { return wrappedDispatcher; } AbstractPropertyDispatcherDecorator(PropertyDispatcher wrappedDispatcher); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList messageList);... |
@Test public void testGetBoundObject() { assertThat(dispatcher.getBoundObject(), is(OBJ1)); } | @Override @CheckForNull public Object getBoundObject() { if (objects.size() > 0) { return objects.get(0); } else { throw new IllegalStateException( "ExceptionPropertyDispatcher has no presentation model object. " + "The bound object should be found in a previous dispatcher in the dispatcher chain before reaching Except... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override @CheckForNull public Object getBoundObject() { if (objects.size() > 0) { return objects.get(0); } else { throw new IllegalStateException( "ExceptionPropertyDispatcher has no presentation model object. " + "The bound object should be found in a previo... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override @CheckForNull public Object getBoundObject() { if (objects.size() > 0) { return objects.get(0); } else { throw new IllegalStateException( "ExceptionPropertyDispatcher has no presentation model object. " + "The bound object should be found in a previo... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override @CheckForNull public Object getBoundObject() { if (objects.size() > 0) { return objects.get(0); } else { throw new IllegalStateException( "ExceptionPropertyDispatcher has no presentation model object. " + "The bound object should be found in a previo... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override @CheckForNull public Object getBoundObject() { if (objects.size() > 0) { return objects.get(0); } else { throw new IllegalStateException( "ExceptionPropertyDispatcher has no presentation model object. " + "The bound object should be found in a previo... |
@Test public void testToString_WithoutNull() { assertThat(dispatcher.toString(), is("ExceptionPropertyDispatcher[String,TestUiComponent#" + PROPERTY_NAME + "]")); } | @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } ExceptionPropertyDispatcher(String prop... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } ExceptionPropertyDispatcher(String prop... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } ExceptionPropertyDispatcher(String prop... |
@Test public void testToString_WithNull() { dispatcher = new ExceptionPropertyDispatcher(PROPERTY_NAME, (String)null); assertThat(dispatcher.toString(), is("ExceptionPropertyDispatcher[null" + "#" + PROPERTY_NAME + "]")); } | @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } ExceptionPropertyDispatcher(String prop... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } ExceptionPropertyDispatcher(String prop... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public String toString() { return getClass().getSimpleName() + "[" + objects.stream().map((Object c) -> (c != null) ? c.getClass().getSimpleName() : "null") .collect(joining(",")) + "#" + getProperty() + "]"; } ExceptionPropertyDispatcher(String prop... |
@Test public void testGetPropertyName_String_Get() { assertThat(BeanUtils.getPropertyName(String.class, "getFoo"), is("foo")); assertThat(BeanUtils.getPropertyName(Boolean.TYPE, "getFoo"), is("foo")); } | public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Cla... | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Cla... |
@Test public void testGetMessages() { assertThat(dispatcher.getMessages(new MessageList()).isEmpty(), is(true)); } | @Override public MessageList getMessages(MessageList messageList) { return new MessageList(); } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { return new MessageList(); } } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { return new MessageList(); } ExceptionPropertyDispatcher(String property, Object... objects); } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { return new MessageList(); } ExceptionPropertyDispatcher(String property, Object... objects); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList messageList); @Ov... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public MessageList getMessages(MessageList messageList) { return new MessageList(); } ExceptionPropertyDispatcher(String property, Object... objects); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList messageList); @Ov... |
@Test public void testIsPushable() { assertThat(dispatcher.isPushable(Aspect.of(PROPERTY_NAME)), is(false)); } | @Override public <T> boolean isPushable(Aspect<T> aspect) { return false; } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public <T> boolean isPushable(Aspect<T> aspect) { return false; } } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public <T> boolean isPushable(Aspect<T> aspect) { return false; } ExceptionPropertyDispatcher(String property, Object... objects); } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public <T> boolean isPushable(Aspect<T> aspect) { return false; } ExceptionPropertyDispatcher(String property, Object... objects); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList messageList); @Override String getPro... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public <T> boolean isPushable(Aspect<T> aspect) { return false; } ExceptionPropertyDispatcher(String property, Object... objects); @Override Class<?> getValueClass(); @Override MessageList getMessages(MessageList messageList); @Override String getPro... |
@Test public void testGetValueClass() { IllegalStateException illegalStateException = assertThrows(IllegalStateException.class, dispatcher::getValueClass); assertThat(illegalStateException.getMessage(), containsStringIgnoringCase(PROPERTY_NAME)); assertThat(illegalStateException.getMessage(), not(containsStringIgnoring... | @Override public Class<?> getValueClass() { throw new IllegalStateException( missingMethodMessage("is/get" + StringUtils.capitalize(getProperty()), objects)); } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public Class<?> getValueClass() { throw new IllegalStateException( missingMethodMessage("is/get" + StringUtils.capitalize(getProperty()), objects)); } } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public Class<?> getValueClass() { throw new IllegalStateException( missingMethodMessage("is/get" + StringUtils.capitalize(getProperty()), objects)); } ExceptionPropertyDispatcher(String property, Object... objects); } | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public Class<?> getValueClass() { throw new IllegalStateException( missingMethodMessage("is/get" + StringUtils.capitalize(getProperty()), objects)); } ExceptionPropertyDispatcher(String property, Object... objects); @Override Class<?> getValueClass()... | ExceptionPropertyDispatcher implements PropertyDispatcher { @Override public Class<?> getValueClass() { throw new IllegalStateException( missingMethodMessage("is/get" + StringUtils.capitalize(getProperty()), objects)); } ExceptionPropertyDispatcher(String property, Object... objects); @Override Class<?> getValueClass()... |
@Test public void testGetValue() { Aspect<Object> newDynamic = Aspect.of(""); pull(XYZ, newDynamic); verify(uiAnnotationFallbackDispatcher).pull(newDynamic); } | @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?> pmoClass = getTypeForKey(boundObject); staticValue = (T)PmoNlsServi... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... |
@Test public void testGetDerivedValue() { Aspect<String> derived = Aspect.of("", LinkkiAspectDefinition.DERIVED_BY_LINKKI); when(uiAnnotationFallbackDispatcher.getProperty()).thenReturn("foo"); assertThat(pull("foo", derived), is("Foo")); } | @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?> pmoClass = getTypeForKey(boundObject); staticValue = (T)PmoNlsServi... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... |
@Test public void testPull_static() { Aspect<ArrayList<Object>> staticAspect = Aspect.of(EnabledAspectDefinition.NAME, new ArrayList<>()); pull(STATIC_ENUM_ATTR, staticAspect); verify(uiAnnotationFallbackDispatcher, never()).pull(staticAspect); } | @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?> pmoClass = getTypeForKey(boundObject); staticValue = (T)PmoNlsServi... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... |
@Test public void testPull_dynamic() { Aspect<ArrayList<Object>> dynamicAspect = Aspect.of(EnabledAspectDefinition.NAME); pull(DYNAMIC_ENUM_ATTR, dynamicAspect); verify(uiAnnotationFallbackDispatcher).pull(dynamicAspect); } | @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?> pmoClass = getTypeForKey(boundObject); staticValue = (T)PmoNlsServi... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... | StaticValueDispatcher extends AbstractPropertyDispatcherDecorator { @SuppressWarnings("unchecked") @Override public <T> T pull(Aspect<T> aspect) { if (aspect.isValuePresent()) { T staticValue = aspect.getValue(); Object boundObject = getBoundObject(); if (staticValue instanceof String && boundObject != null) { Class<?>... |
@Test public void testAdd() { BindingContext context = new BindingContext(); ElementBinding binding = createBinding(context); assertEquals(0, context.getBindings().size()); context.add(binding, TestComponentWrapper.with(binding)); assertEquals(1, context.getBindings().size()); } | @Deprecated public BindingContext add(Binding binding) { add(binding, UiFramework.getComponentWrapperFactory().createComponentWrapper(binding.getBoundComponent())); return this; } | BindingContext implements UiUpdateObserver { @Deprecated public BindingContext add(Binding binding) { add(binding, UiFramework.getComponentWrapperFactory().createComponentWrapper(binding.getBoundComponent())); return this; } } | BindingContext implements UiUpdateObserver { @Deprecated public BindingContext add(Binding binding) { add(binding, UiFramework.getComponentWrapperFactory().createComponentWrapper(binding.getBoundComponent())); return this; } BindingContext(); BindingContext(String contextName); BindingContext(String contextName, Prop... | BindingContext implements UiUpdateObserver { @Deprecated public BindingContext add(Binding binding) { add(binding, UiFramework.getComponentWrapperFactory().createComponentWrapper(binding.getBoundComponent())); return this; } BindingContext(); BindingContext(String contextName); BindingContext(String contextName, Prop... | BindingContext implements UiUpdateObserver { @Deprecated public BindingContext add(Binding binding) { add(binding, UiFramework.getComponentWrapperFactory().createComponentWrapper(binding.getBoundComponent())); return this; } BindingContext(); BindingContext(String contextName); BindingContext(String contextName, Prop... |
@Test public void testModelChangedBindingsAndValidate_noBindingInContext() { Handler afterUpdateUi = mock(Handler.class); BindingContext context = new BindingContext("", PropertyBehaviorProvider.NO_BEHAVIOR_PROVIDER, afterUpdateUi); context.modelChanged(); verify(afterUpdateUi).apply(); } | public void modelChanged() { updateUI(); } | BindingContext implements UiUpdateObserver { public void modelChanged() { updateUI(); } } | BindingContext implements UiUpdateObserver { public void modelChanged() { updateUI(); } BindingContext(); BindingContext(String contextName); BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
Handler afterUpdateHandler); BindingContext(String contextName, PropertyBehaviorProvi... | BindingContext implements UiUpdateObserver { public void modelChanged() { updateUI(); } BindingContext(); BindingContext(String contextName); BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
Handler afterUpdateHandler); BindingContext(String contextName, PropertyBehaviorProvi... | BindingContext implements UiUpdateObserver { public void modelChanged() { updateUI(); } BindingContext(); BindingContext(String contextName); BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
Handler afterUpdateHandler); BindingContext(String contextName, PropertyBehaviorProvi... |
@Test public void testRemoveBindingsForComponent() { BindingContext context = new BindingContext(); TestPmo testPmo = new TestPmo(); ElementBinding binding1 = createBinding(context, testPmo, field1); ElementBinding binding2 = createBinding(context, testPmo, field2); context.add(binding1, TestComponentWrapper.with(bindi... | public void removeBindingsForComponent(Object uiComponent) { bindings.remove(uiComponent); UiFramework.getChildComponents(uiComponent) .iterator() .forEachRemaining(this::removeBindingsForComponent); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingContext.class::cast) .forEach(bc -> bc.removeBi... | BindingContext implements UiUpdateObserver { public void removeBindingsForComponent(Object uiComponent) { bindings.remove(uiComponent); UiFramework.getChildComponents(uiComponent) .iterator() .forEachRemaining(this::removeBindingsForComponent); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingCo... | BindingContext implements UiUpdateObserver { public void removeBindingsForComponent(Object uiComponent) { bindings.remove(uiComponent); UiFramework.getChildComponents(uiComponent) .iterator() .forEachRemaining(this::removeBindingsForComponent); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingCo... | BindingContext implements UiUpdateObserver { public void removeBindingsForComponent(Object uiComponent) { bindings.remove(uiComponent); UiFramework.getChildComponents(uiComponent) .iterator() .forEachRemaining(this::removeBindingsForComponent); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingCo... | BindingContext implements UiUpdateObserver { public void removeBindingsForComponent(Object uiComponent) { bindings.remove(uiComponent); UiFramework.getChildComponents(uiComponent) .iterator() .forEachRemaining(this::removeBindingsForComponent); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingCo... |
@Test public void testGetPropertyName_String_Is() { assertThat(BeanUtils.getPropertyName(String.class, "isFoo"), is("foo")); assertThat(BeanUtils.getPropertyName(Boolean.TYPE, "isFoo"), is("foo")); } | public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Cla... | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Cla... |
@Test public void testRemoveBindingsForPmo() { BindingContext context = new BindingContext(); TestPmo pmo = new TestPmo(); ElementBinding binding1 = createBinding(context, pmo, field1); ElementBinding binding2 = createBinding(context, pmo, field2); context.add(binding1, TestComponentWrapper.with(binding1)); context.add... | public void removeBindingsForPmo(Object pmo) { bindings.values().removeIf(ref -> { Binding binding = ref.get(); return binding != null && binding.getPmo() == pmo; }); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingContext.class::cast) .forEach(bc -> bc.removeBindingsForPmo(pmo)); if (pmo insta... | BindingContext implements UiUpdateObserver { public void removeBindingsForPmo(Object pmo) { bindings.values().removeIf(ref -> { Binding binding = ref.get(); return binding != null && binding.getPmo() == pmo; }); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingContext.class::cast) .forEach(bc ->... | BindingContext implements UiUpdateObserver { public void removeBindingsForPmo(Object pmo) { bindings.values().removeIf(ref -> { Binding binding = ref.get(); return binding != null && binding.getPmo() == pmo; }); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingContext.class::cast) .forEach(bc ->... | BindingContext implements UiUpdateObserver { public void removeBindingsForPmo(Object pmo) { bindings.values().removeIf(ref -> { Binding binding = ref.get(); return binding != null && binding.getPmo() == pmo; }); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingContext.class::cast) .forEach(bc ->... | BindingContext implements UiUpdateObserver { public void removeBindingsForPmo(Object pmo) { bindings.values().removeIf(ref -> { Binding binding = ref.get(); return binding != null && binding.getPmo() == pmo; }); getBindingStream() .filter(BindingContext.class::isInstance) .map(BindingContext.class::cast) .forEach(bc ->... |
@Test public void testBind_ButtonPmoBindningToCheckUpdateFromPmo() { BindingContext context = new BindingContext(); TestButtonPmo buttonPmo = new TestButtonPmo(); TestUiComponent button = new TestUiComponent(); buttonPmo.setEnabled(false); ComponentWrapper buttonWrapper = new TestComponentWrapper(button); context.bind(... | public Binding bind(Object pmo, BindingDescriptor bindingDescriptor, ComponentWrapper componentWrapper) { requireNonNull(bindingDescriptor, "bindingDescriptor must not be null"); return bind(pmo, bindingDescriptor.getBoundProperty(), bindingDescriptor.getAspectDefinitions(), componentWrapper); } | BindingContext implements UiUpdateObserver { public Binding bind(Object pmo, BindingDescriptor bindingDescriptor, ComponentWrapper componentWrapper) { requireNonNull(bindingDescriptor, "bindingDescriptor must not be null"); return bind(pmo, bindingDescriptor.getBoundProperty(), bindingDescriptor.getAspectDefinitions(),... | BindingContext implements UiUpdateObserver { public Binding bind(Object pmo, BindingDescriptor bindingDescriptor, ComponentWrapper componentWrapper) { requireNonNull(bindingDescriptor, "bindingDescriptor must not be null"); return bind(pmo, bindingDescriptor.getBoundProperty(), bindingDescriptor.getAspectDefinitions(),... | BindingContext implements UiUpdateObserver { public Binding bind(Object pmo, BindingDescriptor bindingDescriptor, ComponentWrapper componentWrapper) { requireNonNull(bindingDescriptor, "bindingDescriptor must not be null"); return bind(pmo, bindingDescriptor.getBoundProperty(), bindingDescriptor.getAspectDefinitions(),... | BindingContext implements UiUpdateObserver { public Binding bind(Object pmo, BindingDescriptor bindingDescriptor, ComponentWrapper componentWrapper) { requireNonNull(bindingDescriptor, "bindingDescriptor must not be null"); return bind(pmo, bindingDescriptor.getBoundProperty(), bindingDescriptor.getAspectDefinitions(),... |
@Test public void testBind_WeakReferencedBinding() { BindingContext context = new BindingContext(); ReferenceQueue<TestUiComponent> referenceQueue = new ReferenceQueue<>(); Thread refRemoveThread = new Thread(() -> { try { TestUiComponent removed = referenceQueue.remove(10_000).get(); assertThat(weakRefComponent.get(),... | public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); } | BindingContext implements UiUpdateObserver { public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); } } | BindingContext implements UiUpdateObserver { public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); } BindingContext(); BindingContext(String contextName); BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
Ha... | BindingContext implements UiUpdateObserver { public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); } BindingContext(); BindingContext(String contextName); BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
Ha... | BindingContext implements UiUpdateObserver { public Collection<Binding> getBindings() { return Collections.unmodifiableCollection(getBindingStream() .collect(toList())); } BindingContext(); BindingContext(String contextName); BindingContext(String contextName, PropertyBehaviorProvider behaviorProvider,
Ha... |
@Test public void testIsAssignableFrom() { assertTrue(WrapperType.ROOT.isAssignableFrom(WrapperType.ROOT)); assertTrue(WrapperType.ROOT.isAssignableFrom(WrapperType.COMPONENT)); assertTrue(WrapperType.ROOT.isAssignableFrom(WrapperType.FIELD)); assertTrue(WrapperType.ROOT.isAssignableFrom(WrapperType.LAYOUT)); assertTru... | public boolean isAssignableFrom(@CheckForNull WrapperType type) { return this.equals(type) || (type != null && isAssignableFrom(type.getParent())); } | WrapperType { public boolean isAssignableFrom(@CheckForNull WrapperType type) { return this.equals(type) || (type != null && isAssignableFrom(type.getParent())); } } | WrapperType { public boolean isAssignableFrom(@CheckForNull WrapperType type) { return this.equals(type) || (type != null && isAssignableFrom(type.getParent())); } private WrapperType(String name, WrapperType parent); } | WrapperType { public boolean isAssignableFrom(@CheckForNull WrapperType type) { return this.equals(type) || (type != null && isAssignableFrom(type.getParent())); } private WrapperType(String name, WrapperType parent); static WrapperType of(String name); static WrapperType of(String name, WrapperType parent); @CheckFor... | WrapperType { public boolean isAssignableFrom(@CheckForNull WrapperType type) { return this.equals(type) || (type != null && isAssignableFrom(type.getParent())); } private WrapperType(String name, WrapperType parent); static WrapperType of(String name); static WrapperType of(String name, WrapperType parent); @CheckFor... |
@Test public void testIsRoot() { assertTrue(WrapperType.ROOT.isRoot()); assertFalse(WrapperType.COMPONENT.isRoot()); assertFalse(WrapperType.FIELD.isRoot()); assertFalse(WrapperType.of("foo", null).isRoot()); assertFalse(WrapperType.of("", null).isRoot()); } | public boolean isRoot() { return this == ROOT; } | WrapperType { public boolean isRoot() { return this == ROOT; } } | WrapperType { public boolean isRoot() { return this == ROOT; } private WrapperType(String name, WrapperType parent); } | WrapperType { public boolean isRoot() { return this == ROOT; } private WrapperType(String name, WrapperType parent); static WrapperType of(String name); static WrapperType of(String name, WrapperType parent); @CheckForNull WrapperType getParent(); boolean isRoot(); boolean isAssignableFrom(@CheckForNull WrapperType ty... | WrapperType { public boolean isRoot() { return this == ROOT; } private WrapperType(String name, WrapperType parent); static WrapperType of(String name); static WrapperType of(String name, WrapperType parent); @CheckForNull WrapperType getParent(); boolean isRoot(); boolean isAssignableFrom(@CheckForNull WrapperType ty... |
@SuppressWarnings("unlikely-arg-type") @Test public void testEquals() { assertTrue(WrapperType.ROOT.equals(WrapperType.ROOT)); assertTrue(WrapperType.ROOT.equals(WrapperType.of("", null))); assertTrue(WrapperType.of("", null).equals(WrapperType.ROOT)); assertFalse(WrapperType.ROOT.equals(WrapperType.COMPONENT)); assert... | @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WrapperType other = (WrapperType)obj; if (!name.equals(other.name)) { return false; } if (parent == null) { if (other.parent != null) { return false; } }... | WrapperType { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WrapperType other = (WrapperType)obj; if (!name.equals(other.name)) { return false; } if (parent == null) { if (other.parent != null) { ret... | WrapperType { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WrapperType other = (WrapperType)obj; if (!name.equals(other.name)) { return false; } if (parent == null) { if (other.parent != null) { ret... | WrapperType { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WrapperType other = (WrapperType)obj; if (!name.equals(other.name)) { return false; } if (parent == null) { if (other.parent != null) { ret... | WrapperType { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WrapperType other = (WrapperType)obj; if (!name.equals(other.name)) { return false; } if (parent == null) { if (other.parent != null) { ret... |
@Test public void testHashcode() { assertThat(WrapperType.ROOT.hashCode(), is(WrapperType.ROOT.hashCode())); assertThat(WrapperType.ROOT.hashCode(), is(WrapperType.of("", null).hashCode())); assertThat(WrapperType.of("", null).hashCode(), is(WrapperType.ROOT.hashCode())); assertThat(WrapperType.ROOT.hashCode(), is(not(... | @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + name.hashCode(); if (parent != null) { result = parent.hashCode() + result * prime; } return result; } | WrapperType { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + name.hashCode(); if (parent != null) { result = parent.hashCode() + result * prime; } return result; } } | WrapperType { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + name.hashCode(); if (parent != null) { result = parent.hashCode() + result * prime; } return result; } private WrapperType(String name, WrapperType parent); } | WrapperType { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + name.hashCode(); if (parent != null) { result = parent.hashCode() + result * prime; } return result; } private WrapperType(String name, WrapperType parent); static WrapperType of(String name); static Wrapper... | WrapperType { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + name.hashCode(); if (parent != null) { result = parent.hashCode() + result * prime; } return result; } private WrapperType(String name, WrapperType parent); static WrapperType of(String name); static Wrapper... |
@Test public void testUpdateFromPmo_updateAspect() { Handler componentUpdater = mock(Handler.class); LinkkiAspectDefinition aspectDefinition = mock(LinkkiAspectDefinition.class); when(aspectDefinition.supports(any())).thenReturn(true); when(aspectDefinition.createUiUpdater(any(), any())).thenReturn(componentUpdater); E... | @Override public void updateFromPmo() { try { aspectUpdaters.updateUI(); componentWrapper.postUpdate(); } catch (RuntimeException e) { throw new LinkkiBindingException( "Error while updating UI (" + e.getMessage() + ") in " + toString(), e); } } | ElementBinding implements Binding { @Override public void updateFromPmo() { try { aspectUpdaters.updateUI(); componentWrapper.postUpdate(); } catch (RuntimeException e) { throw new LinkkiBindingException( "Error while updating UI (" + e.getMessage() + ") in " + toString(), e); } } } | ElementBinding implements Binding { @Override public void updateFromPmo() { try { aspectUpdaters.updateUI(); componentWrapper.postUpdate(); } catch (RuntimeException e) { throw new LinkkiBindingException( "Error while updating UI (" + e.getMessage() + ") in " + toString(), e); } } ElementBinding(ComponentWrapper compon... | ElementBinding implements Binding { @Override public void updateFromPmo() { try { aspectUpdaters.updateUI(); componentWrapper.postUpdate(); } catch (RuntimeException e) { throw new LinkkiBindingException( "Error while updating UI (" + e.getMessage() + ") in " + toString(), e); } } ElementBinding(ComponentWrapper compon... | ElementBinding implements Binding { @Override public void updateFromPmo() { try { aspectUpdaters.updateUI(); componentWrapper.postUpdate(); } catch (RuntimeException e) { throw new LinkkiBindingException( "Error while updating UI (" + e.getMessage() + ") in " + toString(), e); } } ElementBinding(ComponentWrapper compon... |
@Test public void testDisplayMessages() { messageList.add(Message.newError("code", "text")); selectBinding.displayMessages(messageList); @NonNull MessageList validationMessages = selectField.getValidationMessages(); assertThat(validationMessages, hasErrorMessage("code")); Message firstMessage = validationMessages.getFi... | @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } | ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } } | ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyD... | ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyD... | ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyD... |
@Test public void testDisplayMessages_noMessages() { selectBinding.displayMessages(messageList); assertThat(selectField.getValidationMessages(), is(emptyMessageList())); } | @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } | ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } } | ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyD... | ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyD... | ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyD... |
@Test public void testGetPropertyName_String_FullName() { assertThat(BeanUtils.getPropertyName(String.class, "fooBar"), is("fooBar")); assertThat(BeanUtils.getPropertyName(Boolean.TYPE, "fooBar"), is("fooBar")); } | public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); } | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Cla... | BeanUtils { public static String getPropertyName(Method method) { return getPropertyName(method.getReturnType(), method.getName()); } private BeanUtils(); static BeanInfo getBeanInfo(Class<?> clazz); static Method getMethod(Class<?> clazz, String name, Class<?>... parameterTypes); static Optional<Method> getMethod(Cla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.