Search in sources :

Example 1 with Parent

use of uk.co.jemos.podam.test.dto.pdm6.Parent in project JMRI by JMRI.

the class QualifierAdder method processModifierElements.

public void processModifierElements(Element e, VariableTableModel model) {
    ArrayList<Qualifier> lq = new ArrayList<Qualifier>();
    // we assign to this to allow us to suppress unchecked error
    List<Element> le = e.getChildren("qualifier");
    processList(le, lq, model);
    // search for enclosing element so we can find all relevant qualifiers
    Parent p = e;
    while ((p = p.getParent()) != null && p instanceof Element) {
        Element el = (Element) p;
        if (el.getName().equals("pane")) {
            // stop when we get to an enclosing pane element
            break;
        }
        @SuppressWarnings("unchecked") List<Element> // we assign to this to allow us to suppress unchecked error
        le2 = el.getChildren("qualifier");
        processList(le2, lq, model);
    }
    // Add the AND logic - listen for change and ensure result correct
    if (lq.size() > 1) {
        QualifierCombiner qc = new QualifierCombiner(lq);
        addListener(qc);
    }
}
Also used : Parent(org.jdom2.Parent) Element(org.jdom2.Element) ArrayList(java.util.ArrayList)

Example 2 with Parent

use of uk.co.jemos.podam.test.dto.pdm6.Parent in project podam by devopsfolks.

the class PodamFactoryBasicTypesTest method podamShouldSupportCircularDependencies.

@Test
@Title("Podam should fill in POJOs which have a circular dependency")
public void podamShouldSupportCircularDependencies() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    Parent parent = podamInvocationSteps.whenIInvokeTheFactoryForClass(Parent.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(parent, Parent.class);
    Child child = parent.getChild();
    podamValidationSteps.thePojoMustBeOfTheType(child, Child.class);
}
Also used : Parent(uk.co.jemos.podam.test.dto.pdm6.Parent) PodamFactory(uk.co.jemos.podam.api.PodamFactory) Child(uk.co.jemos.podam.test.dto.pdm6.Child) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Aggregations

ArrayList (java.util.ArrayList)1 Title (net.thucydides.core.annotations.Title)1 Element (org.jdom2.Element)1 Parent (org.jdom2.Parent)1 Test (org.junit.Test)1 PodamFactory (uk.co.jemos.podam.api.PodamFactory)1 Child (uk.co.jemos.podam.test.dto.pdm6.Child)1 Parent (uk.co.jemos.podam.test.dto.pdm6.Parent)1