@Test public void shouldHaveProperties() throws Exception { Reflection reflection = new Reflection(source.getClass()); Property property = reflection.getProperty(source, "updatesAllowed"); assertThat(property.getDescription(), is(GraphI18n.updatesAllowedPropertyDescription.text())); assertThat(property.getLabel(), is(GraphI18n.updatesAllowedPropertyLabel.text())); assertThat(property.getCategory(), is(GraphI18n.updatesAllowedPropertyCategory.text())); assertThat(property.getCategory(), is("Advanced")); assertThat(property.isInferred(), is(false)); assertThat(property.isReadOnly(), is(true)); assertThat(property.isBooleanType(), is(true)); property = reflection.getProperty(source, "defaultCachePolicy"); assertThat(property.getDescription(), is("")); assertThat(property.getLabel(), is("Default Cache Policy")); assertThat(property.getCategory(), is("")); assertThat(property.isInferred(), is(true)); assertThat(property.isReadOnly(), is(false)); assertThat(property.isBooleanType(), is(false)); Map<String, Property> properties = reflection.getAllPropertiesByNameOn(source); assertThat(properties.containsKey("name"), is(true)); assertThat(properties.containsKey("jndiName"), is(true)); assertThat(properties.containsKey("defaultWorkspaceName"), is(true)); assertThat(properties.containsKey("predefinedWorkspaceNames"), is(true)); assertThat(properties.containsKey("updatesAllowed"), is(true)); assertThat(properties.containsKey("defaultCachePolicy"), is(true)); }
assertThat(property.getLabel(), is(CommonI18n.noMoreContent.text())); assertThat(property.getDescription(), is(CommonI18n.nullActivityMonitorTaskName.text())); assertThat(property.getCategory(), is(CommonI18n.noMoreContent.text())); assertThat(property.getType().equals(String.class), is(true)); assertThat(property.isReadOnly(), is(false)); assertThat(property.getLabel(), is("Count")); assertThat(property.getDescription(), is("This is the count")); assertThat(property.getCategory(), is("")); assertThat(property.getType().equals(Integer.TYPE), is(true)); assertThat(property.isReadOnly(), is(false)); assertThat(property.getLabel(), is("On Fire")); assertThat(property.getDescription(), is("")); assertThat(property.getCategory(), is("")); assertThat(property.getType().equals(Boolean.TYPE), is(true)); assertThat(property.isReadOnly(), is(true));