Ignore:
Timestamp:
08/18/13 16:21:58 (11 years ago)
Author:
olhsha
Message:

refactored DAO-s tests are added, but not all working yet. Also: add 8 more tests to dispatcher class

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/JdbcCachedRepresentationDaoTest.java

    r3407 r3408  
    8080    public void testGetCachedRepresentationInfo() {
    8181        System.out.println("getCachedRepresentationInfo");
    82         Number internalID = 1;
    8382       
    84         CachedRepresentationInfo expResult = new CachedRepresentationInfo();
    85         expResult.setMimeType(TestBackendConstants._TEST_CACHED_REPRESENTATION_1_MIME_TYPE_);
    86         expResult.setRef(TestBackendConstants._TEST_CACHED_REPRESENTATION_1_EXT_ID_);
    87         expResult.setTool(TestBackendConstants._TEST_CACHED_REPRESENTATION_1_TOOL_);
    88         expResult.setType(TestBackendConstants._TEST_CACHED_REPRESENTATION_1_TYPE_);
    89        
    90         CachedRepresentationInfo result = jdbcCachedRepresentationDao.getCachedRepresentationInfo(internalID);
    91         assertEquals(expResult.getMimeType(), result.getMimeType());
    92         assertEquals(expResult.getType(), result.getType());
    93         assertEquals(expResult.getTool(), result.getTool());
    94         assertEquals(expResult.getRef(), result.getRef());
     83        CachedRepresentationInfo result = jdbcCachedRepresentationDao.getCachedRepresentationInfo(1);
     84        assertEquals(TestBackendConstants._TEST_CACHED_REPRESENTATION_1_MIME_TYPE_, result.getMimeType());
     85        assertEquals(TestBackendConstants._TEST_CACHED_REPRESENTATION_1_EXT_ID_, result.getType());
     86        assertEquals(TestBackendConstants._TEST_CACHED_REPRESENTATION_1_TOOL_, result.getTool());
     87        assertEquals(TestBackendConstants._TEST_CACHED_REPRESENTATION_1_TYPE_, result.getRef());
    9588    }
    9689
     
    131124        Number result = jdbcCachedRepresentationDao.addCachedRepresentationInfo(cached);
    132125        CachedRepresentationInfo addedCached = jdbcCachedRepresentationDao.getCachedRepresentationInfo(result);
     126        assertEquals(8, result.intValue());
    133127        assertEquals("text/plain", addedCached.getMimeType());
    134128        assertEquals("vi", addedCached.getTool());
Note: See TracChangeset for help on using the changeset viewer.