Ignore:
Timestamp:
08/23/13 15:20:13 (11 years ago)
Author:
olhsha
Message:

making URI's in JAXB-generated classes fro resources <serviceURI>_<external_id>. Earlier it was just external Id.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcSourceDaoTest.java

    r3455 r3463  
    7373        System.out.println("getSource");
    7474        Number internalID = 1;
     75        jdbcSourceDao.setServiceURI(TestBackendConstants._TEST_SERVLET_URI);
    7576        Source result = jdbcSourceDao.getSource(internalID);
    76         assertEquals(TestBackendConstants._TEST_SOURCE_1_EXT_ID, result.getURI());
     77        assertEquals(TestBackendConstants._TEST_SERVLET_URI+TestBackendConstants._TEST_SOURCE_1_EXT_ID, result.getURI());
    7778        assertEquals(TestBackendConstants._TEST_SOURCE_1_LINK, result.getLink());
    7879        assertEquals(TestBackendConstants._TEST_VERSION_1_EXT_ID, result.getVersion());
    79         //TODO: time stamp is not checked: do not know with what to compare
     80        // TODO :add time stamp test
     81       
    8082    }
    8183
     
    128130        freshSource.setLink(link);
    129131        freshSource.setVersion(TestBackendConstants._TEST_VERSION_1_EXT_ID);
    130         freshSource.setURI((UUID.randomUUID()).toString());
    131132        freshSource.setTimeSatmp(null);
    132133       
     
    137138        assertEquals(link, addedSource.getLink());
    138139        assertEquals(TestBackendConstants._TEST_VERSION_1_EXT_ID, addedSource.getVersion());
    139         assertEquals(freshSource.getURI(), addedSource.getURI());
     140        assertTrue(addedSource.getURI().startsWith(TestBackendConstants._TEST_SERVLET_URI));
    140141    }
    141142
     
    145146    @Test
    146147    public void testGetSourceInfos() {
    147         System.out.println("getSourceInfos");
     148        System.out.println("getSourceInfos");       
     149        jdbcSourceDao.setServiceURI(TestBackendConstants._TEST_SERVLET_URI);
    148150        List<Number> test = new ArrayList<Number>();
    149151        test.add(1);
     
    151153        List<SourceInfo> result = jdbcSourceDao.getSourceInfos(test);
    152154        assertEquals(2, result.size());
    153         assertEquals(TestBackendConstants._TEST_SOURCE_1_EXT_ID, result.get(0).getRef());
    154         assertEquals(TestBackendConstants._TEST_SOURCE_2_EXT_ID, result.get(1).getRef());
     155        assertEquals(TestBackendConstants._TEST_SERVLET_URI+TestBackendConstants._TEST_SOURCE_1_EXT_ID, result.get(0).getRef());
     156        assertEquals(TestBackendConstants._TEST_SERVLET_URI+TestBackendConstants._TEST_SOURCE_2_EXT_ID, result.get(1).getRef());
    155157        assertEquals(TestBackendConstants._TEST_VERSION_1_EXT_ID, result.get(0).getVersion());
    156158        assertEquals(TestBackendConstants._TEST_VERSION_3_EXT_ID, result.get(1).getVersion());
Note: See TracChangeset for help on using the changeset viewer.