use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class DependencyTest method testId.
public void testId() {
Dependency dep = new Dependency().setField("field").setId("foo");
Element elem = dep.getElement();
assertEquals(null, elem.getAttribute("constructor-parameter"));
assertEquals("field", elem.getAttribute("field"));
assertEquals("foo", elem.getAttribute("id"));
}
use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class DependencyTest method testOptional.
public void testOptional() {
Dependency dep = new Dependency().setField("field").setOptional(true);
Element elem = dep.getElement();
assertEquals(null, elem.getAttribute("constructor-parameter"));
assertEquals("field", elem.getAttribute("field"));
assertEquals("true", elem.getAttribute("optional"));
}
use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class DependencyTest method testAggregate.
public void testAggregate() {
Dependency dep = new Dependency().setField("field").setAggregate(true);
Element elem = dep.getElement();
assertEquals(null, elem.getAttribute("constructor-parameter"));
assertEquals("field", elem.getAttribute("field"));
assertEquals("true", elem.getAttribute("aggregate"));
}
use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class PropertyTest method testMandatoryPropertyWithValue.
public void testMandatoryPropertyWithValue() {
Property prop = new Property().setField("field").setMandatory(true).setName("prop").setValue("foo").setImmutable(true);
Element elem = prop.getElement();
assertEquals(null, elem.getAttribute("constructor-parameter"));
assertEquals("field", elem.getAttribute("field"));
assertEquals("prop", elem.getAttribute("name"));
assertEquals("foo", elem.getAttribute("value"));
assertEquals("true", elem.getAttribute("mandatory"));
assertEquals("true", elem.getAttribute("immutable"));
}
use of org.apache.felix.ipojo.metadata.Element in project felix by apache.
the class PropertyTest method testField.
public void testField() {
Property prop = new Property().setField("field");
Element elem = prop.getElement();
assertEquals(null, elem.getAttribute("constructor-parameter"));
assertEquals("field", elem.getAttribute("field"));
}
Aggregations