Search in sources :

Example 1 with Referential

use of org.asqatasun.webapp.entity.referential.Referential in project Asqatasun by Asqatasun.

the class CreateContractCommandFactory method addNewReferentialToCommand.

/**
     * 
     * @param ccc 
     */
private void addNewReferentialToCommand(CreateContractCommand ccc) {
    Map<String, Boolean> refMap = new LinkedHashMap<String, Boolean>();
    for (Referential ref : referentialList) {
        refMap.put(ref.getCode(), Boolean.FALSE);
    }
    ccc.setReferentialMap(refMap);
}
Also used : Referential(org.asqatasun.webapp.entity.referential.Referential)

Example 2 with Referential

use of org.asqatasun.webapp.entity.referential.Referential in project Asqatasun by Asqatasun.

the class CreateContractCommandFactory method addReferentialToCommand.

/**
     * 
     * @param ccc
     * @param contract 
     */
private void addReferentialToCommand(CreateContractCommand ccc, Contract contract) {
    Map<String, Boolean> refMap = new LinkedHashMap<String, Boolean>();
    for (Referential ref : referentialList) {
        if (contract.getReferentialSet().contains(ref)) {
            refMap.put(ref.getCode(), Boolean.TRUE);
        } else {
            refMap.put(ref.getCode(), Boolean.FALSE);
        }
    }
    ccc.setReferentialMap(refMap);
}
Also used : Referential(org.asqatasun.webapp.entity.referential.Referential)

Example 3 with Referential

use of org.asqatasun.webapp.entity.referential.Referential in project Asqatasun by Asqatasun.

the class ContractDAOImplTest method testSaveOrUpdate.

/**
     * Test of saveOrUpdate method, of class ContractDAOImpl.
     */
public void testSaveOrUpdate() {
    System.out.println("saveOrUpdate");
    Date beginDate = new Date();
    Date endDate = new Date();
    Date renewalDate = new Date();
    int nbOfContract = contractDAO.findAll().size();
    Set<Functionality> functionalitySet = new HashSet<Functionality>();
    Set<OptionElement> optionElementSet = new HashSet<OptionElement>();
    Set<Referential> referenceSet = new HashSet<Referential>();
    Set<Scenario> scenarioSet = new HashSet<Scenario>();
    Contract contract = contractFactory.createContract("Contract-test", beginDate, endDate, renewalDate, Float.valueOf(200), functionalitySet, optionElementSet, referenceSet, scenarioSet, null);
    contractDAO.saveOrUpdate(contract);
    assertEquals(nbOfContract + 1, contractDAO.findAll().size());
}
Also used : Referential(org.asqatasun.webapp.entity.referential.Referential) Functionality(org.asqatasun.webapp.entity.functionality.Functionality) OptionElement(org.asqatasun.webapp.entity.option.OptionElement) Contract(org.asqatasun.webapp.entity.contract.Contract) Date(java.util.Date) HashSet(java.util.HashSet) Scenario(org.asqatasun.webapp.entity.scenario.Scenario)

Aggregations

Referential (org.asqatasun.webapp.entity.referential.Referential)3 Date (java.util.Date)1 HashSet (java.util.HashSet)1 Contract (org.asqatasun.webapp.entity.contract.Contract)1 Functionality (org.asqatasun.webapp.entity.functionality.Functionality)1 OptionElement (org.asqatasun.webapp.entity.option.OptionElement)1 Scenario (org.asqatasun.webapp.entity.scenario.Scenario)1