ConfigurationMetadata { public static <T> ConfigurationMetadata<T> getValidConfigurationMetadata(Class<T> configClass) throws ConfigurationException { return getValidConfigurationMetadata(configClass, Problems.NULL_MONITOR); } private  ConfigurationMetadata(Class<T> configClass, Monitor monitor); static ConfigurationMetadata<T> getValidConfigurationMetadata(Class<T> configClass); static ConfigurationMetadata<T> getConfigurationMetadata(Class<T> configClass); static boolean isConfigClass(Class<?> classz); Class<T> getConfigClass(); Constructor<T> getConstructor(); Map<String, AttributeMetadata> getAttributes(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static Method findAnnotatedMethod(Class<?> configClass, Class<? extends java.lang.annotation.Annotation> annotation, String methodName, Class<?>... paramTypes);  }
@Test public void testSetterNoGetterConfigClassThrows() { TestMonitor monitor = new TestMonitor(); try { ConfigurationMetadata<?> metadata = ConfigurationMetadata.getValidConfigurationMetadata(SetterNoGetterConfigClass.class, monitor); fail("Expected ConfigurationException"); } catch (ConfigurationException e) { monitor.assertNumberOfErrors(1); monitor.assertNumberOfWarnings(0); monitor.assertMatchingErrorRecorded("No getter"); } }
@Test public void testGetValidAbstractClass() { TestMonitor monitor = new TestMonitor(); try { ConfigurationMetadata.getValidConfigurationMetadata(AbstractClass.class, monitor); fail("Expected ConfigurationException"); } catch (ConfigurationException e) { monitor.assertNumberOfErrors(1); monitor.assertNumberOfWarnings(0); monitor.assertMatchingErrorRecorded("abstract", AbstractClass.class.getName()); } }