Changeset 3300


Ignore:
Timestamp:
08/08/13 08:08:26 (11 years ago)
Author:
olhsha
Message:

the leftovers of yesterday's testing work is done: contructNewOrExistingSourceInfos, getSourceInfos(annotation) Dao's are tested

Location:
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/SourceDao.java

    r3299 r3300  
    8383    * @return the list of NewOrExistingSourceo objects in such a way  that an element of the sourceInfoList is injected into an element of the return list
    8484    */
    85    
     85   //TODO: add non-existing sources!! now is implemented only for existing sources
    8686    public NewOrExistingSourceInfos contructNewOrExistingSourceInfo(List<SourceInfo> sourceInfoList);
    8787   
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/TestBackendConstants.java

    r3299 r3300  
    9191    public static final String _TEST_VERSION_2_EXT_ID = "00000000-0000-0000-0000-000000000042";
    9292    public static final String _TEST_VERSION_3_EXT_ID = "00000000-0000-0000-0000-000000000043";
     93   
     94   
    9395}
    9496
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcSourceDaoTest.java

    r3299 r3300  
    200200        assertEquals(TestBackendConstants._TEST_SOURCE_1_EXT_ID, result.get(0).getRef());
    201201        assertEquals(TestBackendConstants._TEST_SOURCE_2_EXT_ID, result.get(1).getRef());
     202        assertEquals(TestBackendConstants._TEST_VERSION_1_EXT_ID, result.get(0).getVersion());
     203        assertEquals(TestBackendConstants._TEST_VERSION_3_EXT_ID, result.get(1).getVersion());
     204        assertEquals(TestBackendConstants._TEST_SOURCE_1_LINK, result.get(0).getLink());
     205        assertEquals(TestBackendConstants._TEST_SOURCE_2_LINK, result.get(1).getLink());
    202206       
    203207    }
     
    207211     */
    208212    @Test
    209     @Ignore
    210213    public void testContructNewOrExistingSourceInfo() {
    211214        System.out.println("contructNewOrExistingSourceInfo");
    212         List<SourceInfo> sourceInfoList = null;
    213         JdbcSourceDao instance = null;
    214         NewOrExistingSourceInfos expResult = null;
    215         NewOrExistingSourceInfos result = instance.contructNewOrExistingSourceInfo(sourceInfoList);
    216         assertEquals(expResult, result);
    217         // TODO review the generated test code and remove the default call to fail.
    218         fail("The test case is a prototype.");
     215       
     216        List<SourceInfo> sourceInfoList = new ArrayList<SourceInfo>();
     217       
     218        SourceInfo sourceInfoOne = new SourceInfo();
     219        sourceInfoOne.setLink(TestBackendConstants._TEST_SOURCE_1_LINK);
     220        sourceInfoOne.setRef(TestBackendConstants._TEST_SOURCE_1_EXT_ID);
     221        sourceInfoOne.setRef(TestBackendConstants._TEST_VERSION_1_EXT_ID);
     222       
     223        SourceInfo sourceInfoTwo = new SourceInfo();
     224        sourceInfoTwo.setLink(TestBackendConstants._TEST_SOURCE_2_LINK);
     225        sourceInfoTwo.setRef(TestBackendConstants._TEST_SOURCE_2_EXT_ID);
     226        sourceInfoTwo.setRef(TestBackendConstants._TEST_VERSION_3_EXT_ID);
     227       
     228        sourceInfoList.add(sourceInfoOne);
     229        sourceInfoList.add(sourceInfoTwo);
     230       
     231        NewOrExistingSourceInfos result = jdbcSourceDao.contructNewOrExistingSourceInfo(sourceInfoList);
     232        assertEquals(2, result.getTarget().size());
     233        assertEquals(sourceInfoOne, result.getTarget().get(0).getSource());
     234        assertEquals(sourceInfoTwo, result.getTarget().get(1).getSource());
     235       
    219236    }
    220237}
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/resources/test-data/InsertTestData.sql

    r3299 r3300  
    145145INSERT INTO versions_cached_representations (version_id, cached_representation_id) VALUES (4, 4);
    146146INSERT INTO versions_cached_representations (version_id, cached_representation_id) VALUES (1, 5);
     147INSERT INTO versions_cached_representations (version_id, cached_representation_id) VALUES (5, 5);
    147148INSERT INTO versions_cached_representations (version_id, cached_representation_id) VALUES (6, 5);
    148149
Note: See TracChangeset for help on using the changeset viewer.