Package org.modeshape.common.util.Reflection

Examples of org.modeshape.common.util.Reflection.Property


        assertThat(props.size(), is(8));
        assertThat(propsByName.size(), is(8));
        assertThat(props.containsAll(propsByName.values()), is(true));

        Property property = propsByName.remove("status");
        assertThat(property.getName(), is("status"));
        assertThat(property.getLabel(), is("Status"));
        assertThat(property.getType().equals(Status.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertThat(property, is(findProperty(property.getName(), props)));
        assertValue(reflection, problem, property, status);

        property = propsByName.remove("code");
        assertThat(property.getName(), is("code"));
        assertThat(property.getLabel(), is("Code"));
        assertThat(property.getType().equals(Integer.TYPE), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, code);

        property = propsByName.remove("message");
        assertThat(property.getName(), is("message"));
        assertThat(property.getLabel(), is("Message"));
        assertThat(property.getType().equals(I18n.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, msg);

        property = propsByName.remove("messageString");
        assertThat(property.getName(), is("messageString"));
        assertThat(property.getLabel(), is("Message String"));
        assertThat(property.getType().equals(String.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, msg.text(params));

        property = propsByName.remove("parameters");
        assertThat(property.getName(), is("parameters"));
        assertThat(property.getLabel(), is("Parameters"));
        assertThat(property.getType().equals(Object[].class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, params);

        property = propsByName.remove("resource");
        assertThat(property.getName(), is("resource"));
        assertThat(property.getLabel(), is("Resource"));
        assertThat(property.getType().equals(String.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, resource);

        property = propsByName.remove("location");
        assertThat(property.getName(), is("location"));
        assertThat(property.getLabel(), is("Location"));
        assertThat(property.getType().equals(String.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, location);

        property = propsByName.remove("throwable");
        assertThat(property.getName(), is("throwable"));
        assertThat(property.getLabel(), is("Throwable"));
        assertThat(property.getType().equals(Throwable.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, throwable);

        assertThat(propsByName.isEmpty(), is(true));
    }
View Full Code Here


        Map<String, Property> propsByName = reflection.getAllPropertiesByNameOn(structure);

        assertThat(props.size(), is(3));
        assertThat(propsByName.size(), is(3));

        Property property = propsByName.remove("identifier");
        assertThat(property.getName(), is("identifier"));
        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, is(findProperty(property.getName(), props)));
        assertValue(reflection, structure, property, structure.getIdentifier());

        property = propsByName.remove("count");
        assertThat(property.getName(), is("count"));
        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));
        assertValue(reflection, structure, property, structure.getCount());

        property = propsByName.remove("onFire");
        assertThat(property.getName(), is("onFire"));
        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));
        assertValue(reflection, structure, property, structure.isOnFire());
    }
View Full Code Here

TOP

Related Classes of org.modeshape.common.util.Reflection.Property

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.