Package org.dbunit.dataset

Examples of org.dbunit.dataset.ITable


        release.getStories().add(story2);
       
        releaseMapper.addOrUpdate(release);
       
    // check the stories
    ITable databaseData = getConnection().createQueryTable("ExpectedData", SELECT_STORY1);
    assertEquals("id", new Integer(1), (Integer) databaseData.getValue(0, "id"));
    assertEquals("description", "faire un report d'avancement des tâches à modifier", (String) databaseData.getValue(0, "description"));
   
    databaseData = getConnection().createQueryTable("ExpectedData", SELECT_STORY2);
    assertEquals("id", new Integer(2), (Integer) databaseData.getValue(0, "id"));
    assertEquals("description", "faire une revue de code de l'iteration courant", (String) databaseData.getValue(0, "description"));
       
    }
View Full Code Here


        release.getProject().setName("super B");
       
        releaseMapper.addOrUpdate(release);
       
        // check
    ITable databaseData = getConnection().createQueryTable("ExpectedData", SELECT_BASICPROJECT);       
    assertEquals("number of row", 1, databaseData.getRowCount());
    assertEquals("name", "Super A", databaseData.getValue(0, "name"));
       
    }
View Full Code Here

     * Test findAll BusinessValue
     * @throws Exception
     */
    public final void testFindAll() throws Exception {

        ITable databaseData = getConnection().createQueryTable("ExpectedData", "SELECT * FROM BUSINESSVALUE");
       
        assertEquals("BusinessValueMapper", databaseData.getRowCount(), businessValueMapper.findAll().size());

    }
View Full Code Here

     * Test findAll RiskLevel
     * @throws Exception
     */
    public final void testFindAll() throws Exception {

        ITable databaseData = getConnection().createQueryTable("ExpectedData", "SELECT * FROM RISKLEVEL");
       
        assertEquals("RiskLevel", databaseData.getRowCount(), riskLevelMapper.findAll().size());

    }
View Full Code Here

       
        // update
        storyMapper.addOrUpdate(storyToUpdate);
       
        // check story
    ITable databaseData = getConnection().createQueryTable("ExpectedData", SELECT_STORY_TO_UPDATE);
       
    assertEquals("number of row", 1, databaseData.getRowCount());
   
    assertEquals("id", new Integer(storyToUpdate.getPersistanceId()), (Integer) databaseData.getValue(0, "id"));
    assertEquals("pro_id", new Integer(storyToUpdate.getProject().getPersistanceId()), (Integer) databaseData.getValue(0, "pro_id"));
    assertEquals("description", storyToUpdate.getDescription(), (String) databaseData.getValue(0, "description"));
    assertEquals("daysestimated", new Double(storyToUpdate.getDaysEstimated()), new Double(databaseData.getValue(0, "daysestimated").toString()));
        assertEquals("bus_id", new Integer(storyToUpdate.getBusinessValue().getId())(Integer) databaseData.getValue(0, "bus_id"));
        assertEquals("ris_id", new Integer(storyToUpdate.getRiskLevel().getId())(Integer) databaseData.getValue(0, "ris_id"));
    assertEquals("shortdescription", storyToUpdate.getShortDescription(), (String) databaseData.getValue(0, "shortdescription"));
      assertEquals("version", new Long(storyPersistanceVersion), (Long) databaseData.getValue(0, "version"));
     
      // chek tasks

      // task1
    databaseData = getConnection().createQueryTable("ExpectedData", SELECT_TASK1_TO_UPDATE);
       
    assertEquals("number of row", 1, databaseData.getRowCount());
   
    assertEquals("id", new Integer(task1ToUpdate.getPersistanceId()), (Integer) databaseData.getValue(0, "id"));
    assertEquals("pmu_id", task1ToUpdate.getOwner(), databaseData.getValue(0, "pmu_id"));
    assertEquals("daysestimated", new Double(task1ToUpdate.getDaysEstimated()), new Double( databaseData.getValue(0, "daysestimated").toString()));
    assertEquals("shortdescription", task1ToUpdate.getShortDescription(), (String) databaseData.getValue(0, "shortdescription"));
    assertEquals("version", new Long(task1PersistanceVersion), (Long) databaseData.getValue(0, "version"));
   
      // task2
    databaseData = getConnection().createQueryTable("ExpectedData", SELECT_TASK2_TO_UPDATE);
       
    assertEquals("number of row", 1, databaseData.getRowCount());
   
    assertEquals("id", new Integer(task2ToUpdate.getPersistanceId()), (Integer) databaseData.getValue(0, "id"));
    assertEquals("pmu_id", task2ToUpdate.getOwner(), databaseData.getValue(0, "pmu_id"));
    assertEquals("daysestimated", new Double(task2ToUpdate.getDaysEstimated()), new Double (databaseData.getValue(0, "daysestimated").toString()));
    assertEquals("shortdescription", task2ToUpdate.getShortDescription(), (String) databaseData.getValue(0, "shortdescription"));
    assertEquals("version", new Long(task2PersistanceVersion), (Long) databaseData.getValue(0, "version"));
   
   
    // charge 1
    databaseData = getConnection().createQueryTable("ExpectedData", SELECT_CHARGE1_TO_UPDATE);
   
    assertEquals("number of row", 1, databaseData.getRowCount());
   
    assertEquals("id", new Integer(charge1ToUpdate.getPersistanceId()), (Integer) databaseData.getValue(0, "id"));
    assertEquals("tas_id", new Integer(task1ToUpdate.getPersistanceId()), (Integer) databaseData.getValue(0, "tas_id"));
    assertEquals("pmu_id", new Integer(charge1ToUpdate.getUser().getPersistanceId()), (Integer) databaseData.getValue(0, "pmu_id"));
    assertEquals("day", charge1ToUpdate.getDay(), (Date) databaseData.getValue(0, "day"));
    assertEquals("timeused", new Double(charge1ToUpdate.getTimeUsedToday()), new Double (databaseData.getValue(0, "timeused").toString()));
    assertEquals("daysneededtofinish", new Double(charge1ToUpdate.getDaysNeededToFinish()), new Double (databaseData.getValue(0, "daysneededtofinish").toString()));
    assertEquals("version", new Long(charge1PersistanceVersion), (Long) databaseData.getValue(0, "version"));

    // charge 2
    databaseData = getConnection().createQueryTable("ExpectedData", SELECT_CHARGE2_TO_UPDATE);
   
    assertEquals("number of row", 1, databaseData.getRowCount());
   
    assertEquals("id", new Integer(charge2ToUpdate.getPersistanceId()), (Integer) databaseData.getValue(0, "id"));
    assertEquals("tas_id", new Integer(task1ToUpdate.getPersistanceId()), (Integer) databaseData.getValue(0, "tas_id"));
    assertEquals("pmu_id", new Integer(charge2ToUpdate.getUser().getPersistanceId()), (Integer) databaseData.getValue(0, "pmu_id"));
    assertEquals("day", charge2ToUpdate.getDay(), (Date) databaseData.getValue(0, "day"));
    assertEquals("timeused", new Double(charge2ToUpdate.getTimeUsedToday()), new Double (databaseData.getValue(0, "timeused").toString()));
    assertEquals("daysneededtofinish", new Double(charge2ToUpdate.getDaysNeededToFinish()), new Double (databaseData.getValue(0, "daysneededtofinish").toString()));
    assertEquals("version", new Long(charge2PersistanceVersion), (Long) databaseData.getValue(0, "version"));

       
    }
View Full Code Here

       
        // add
        releaseMapper.addOrUpdate(release);
       
        // check
    ITable databaseData = getConnection().createQueryTable("ExpectedData", SELECT_FOR_ADD);
       
    assertEquals("number of row", 1, databaseData.getRowCount());
   
    assertEquals("pro_id", new Integer(2), (Integer) databaseData.getValue(0, "pro_id"));
    assertEquals("number", "2B", databaseData.getValue(0, "number"));
    // TODO Comment tester les dates ???
    //assertEquals("date", date, (Date)databaseData.getValue(0, "date") );
    assertEquals("version", new Long(0), (Long) databaseData.getValue(0, "version"));
   
    // récupération des id pour tester que les stories ont bien cette nouvelle release
    Integer releasePersistanceId = (Integer) databaseData.getValue(0, "id");
   
    // check the stories
    databaseData = getConnection().createQueryTable("ExpectedData", SELECT_STORY1);
    assertEquals("id", new Integer(1), (Integer) databaseData.getValue(0, "id"));
    assertEquals("rel_id", releasePersistanceId, (Integer) databaseData.getValue(0, "rel_id"));
   
    databaseData = getConnection().createQueryTable("ExpectedData", SELECT_STORY2);
    assertEquals("id", new Integer(2), (Integer) databaseData.getValue(0, "id"));
    assertEquals("rel_id", releasePersistanceId, (Integer) databaseData.getValue(0, "rel_id"));
       
    }   
View Full Code Here

        release.getProject().setName("super B");
       
        releaseMapper.addOrUpdate(release);
       
        // check
    ITable databaseData = getConnection().createQueryTable("ExpectedData", SELECT_BASICPROJECT);       
    assertEquals("number of row", 1, databaseData.getRowCount());
    assertEquals("name", "Super A", databaseData.getValue(0, "name"));
       
       
    }
View Full Code Here

        release.getStories().add(story2);
       
        releaseMapper.addOrUpdate(release);
       
    // check the stories
    ITable databaseData = getConnection().createQueryTable("ExpectedData", SELECT_STORY1);
    assertEquals("id", new Integer(1), (Integer) databaseData.getValue(0, "id"));
    assertEquals("description", "faire un report d'avancement des tâches à modifier", (String) databaseData.getValue(0, "description"));
   
    databaseData = getConnection().createQueryTable("ExpectedData", SELECT_STORY2);
    assertEquals("id", new Integer(2), (Integer) databaseData.getValue(0, "id"));
    assertEquals("description", "faire une revue de code de l'iteration courant", (String) databaseData.getValue(0, "description"));
       
    }
View Full Code Here

    public void testDeleteWhenReleaseExists() throws Exception {
       
        releaseMapper.delete(releaseToDelete);
       
        // check
    ITable databaseData = getConnection().createQueryTable("ExpectedData", SELECT_FOR_DELETE);       
    assertEquals("number of row", 0, databaseData.getRowCount());
       
    }
View Full Code Here

    public void testDeleteDoesNotDeleteProjet() throws Exception {
       
        releaseMapper.delete(releaseToDelete);
       
        // check
    ITable databaseData = getConnection().createQueryTable("ExpectedData", SELECT_BASICPROJECT);       
    assertEquals("number of row", 1, databaseData.getRowCount());
       
    }
View Full Code Here

TOP

Related Classes of org.dbunit.dataset.ITable

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.