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

renaming DaoDispatcher?

File:
1 moved

Legend:

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

    r3455 r3477  
    6161    "/spring-test-config/mockUserDao.xml", "/spring-test-config/mockNotebookDao.xml",
    6262    "/spring-test-config/mockSourceDao.xml", "/spring-test-config/mockVersionDao.xml", "/spring-test-config/mockCachedRepresentationDao.xml",
    63     "/spring-config/daoDispatcher.xml"})
    64 public class DaoDispatcherTest {
    65 
    66     @Autowired
    67     private DaoDispatcherImpl daoDispatcher;
     63    "/spring-config/dbIntegrityService.xml"})
     64public class DBIntegrityServiceTest {
     65
     66    @Autowired
     67    private DBIntegrityServiceImlp dbIntegrityService;
    6868    @Autowired
    6969    private Mockery mockery;
     
    8282    TestInstances testInstances = new TestInstances();
    8383
    84     public DaoDispatcherTest() {
     84    public DBIntegrityServiceTest() {
    8585    }
    8686
    8787    ///////// GETTERS /////////////
    8888    /**
    89      * Test of getAnnotationInternalIdentifier method, of class DaoDispatcherImpl.
     89     * Test of getAnnotationInternalIdentifier method, of class DBIntegrityServiceImlp.
    9090     */
    9191    @Test
     
    100100            }
    101101        });
    102         assertEquals(2, daoDispatcher.getAnnotationInternalIdentifier(externalID));
    103     }
    104 
    105     /**
    106      * Test of getAnnotationExternalIdentifier method, of class DaoDispatcherImpl.
     102        assertEquals(2, dbIntegrityService.getAnnotationInternalIdentifier(externalID));
     103    }
     104
     105    /**
     106     * Test of getAnnotationExternalIdentifier method, of class DBIntegrityServiceImlp.
    107107     */
    108108    @Test
     
    117117            }
    118118        });
    119         assertEquals(TestBackendConstants._TEST_ANNOT_2_EXT, daoDispatcher.getAnnotationExternalIdentifier(2).toString());
    120     }
    121 
    122     /**
    123      * Test of getUserInternalIdentifier method, of class DaoDispatcherImpl.
     119        assertEquals(TestBackendConstants._TEST_ANNOT_2_EXT, dbIntegrityService.getAnnotationExternalIdentifier(2).toString());
     120    }
     121
     122    /**
     123     * Test of getUserInternalIdentifier method, of class DBIntegrityServiceImlp.
    124124     */
    125125    @Test
     
    135135            }
    136136        });
    137         assertEquals(5, daoDispatcher.getUserInternalIdentifier(externalID));
    138     }
    139 
    140     /**
    141      * Test of getUserExternalIdentifier method, of class DaoDispatcherImpl.
     137        assertEquals(5, dbIntegrityService.getUserInternalIdentifier(externalID));
     138    }
     139
     140    /**
     141     * Test of getUserExternalIdentifier method, of class DBIntegrityServiceImlp.
    142142     */
    143143    @Test
     
    152152            }
    153153        });
    154         assertEquals(TestBackendConstants._TEST_USER_5_EXT_ID, daoDispatcher.getUserExternalIdentifier(5).toString());
    155     }
    156 
    157     /**
    158      * Test of getAnnotation method, of class DaoDispatcherImpl.
     154        assertEquals(TestBackendConstants._TEST_USER_5_EXT_ID, dbIntegrityService.getUserExternalIdentifier(5).toString());
     155    }
     156
     157    /**
     158     * Test of getAnnotation method, of class DBIntegrityServiceImlp.
    159159     */
    160160    @Test
     
    210210        });
    211211
    212         Annotation result = daoDispatcher.getAnnotation(1);
     212        Annotation result = dbIntegrityService.getAnnotation(1);
    213213        assertEquals(TestBackendConstants._TEST_ANNOT_2_EXT, result.getURI());
    214214        assertEquals(TestBackendConstants._TEST_ANNOT_2_BODY, result.getBody().getAny().get(0));
     
    225225
    226226    /**
    227      * Test of getFilteredAnnotationIDs method, of class DaoDispatcherImpl.
     227     * Test of getFilteredAnnotationIDs method, of class DBIntegrityServiceImlp.
    228228     */
    229229    @Test
     
    269269
    270270
    271         List result = daoDispatcher.getFilteredAnnotationIDs(link, text, access, namespace, owner, after, before);
     271        List result = dbIntegrityService.getFilteredAnnotationIDs(link, text, access, namespace, owner, after, before);
    272272        assertEquals(1, result.size());
    273273        assertEquals(2, result.get(0));
     
    276276    ////////////// ADDERS /////////////////////////
    277277    /**
    278      * Test of addCachedForVersion method, of class DaoDispatcherImpl.
     278     * Test of addCachedForVersion method, of class DBIntegrityServiceImlp.
    279279     */
    280280    @Test
     
    305305
    306306
    307         Number[] result = daoDispatcher.addCachedForVersion(versionID, newCached);
     307        Number[] result = dbIntegrityService.addCachedForVersion(versionID, newCached);
    308308        assertEquals(2, result.length);
    309309        assertEquals(1, result[0]);
     
    312312
    313313    /**
    314      * Test of addSiblingVersionForSource method, of class DaoDispatcherImpl.
     314     * Test of addSiblingVersionForSource method, of class DBIntegrityServiceImlp.
    315315     */
    316316    @Test
     
    337337        });
    338338
    339         Number[] result = daoDispatcher.addSiblingVersionForSource(1, mockVersion);
     339        Number[] result = dbIntegrityService.addSiblingVersionForSource(1, mockVersion);
    340340        assertEquals(2, result.length);
    341341        assertEquals(1, result[0]);
     
    358358            }
    359359        });
    360         Number[] resultTwo = daoDispatcher.addSiblingVersionForSource(1, mockVersionTwo);
     360        Number[] resultTwo = dbIntegrityService.addSiblingVersionForSource(1, mockVersionTwo);
    361361        assertEquals(2, resultTwo.length);
    362362        assertEquals(1, resultTwo[0]);
     
    365365
    366366    /**
    367      * Test of addSourcesForAnnotation method, of class DaoDispatcherImpl.
     367     * Test of addSourcesForAnnotation method, of class DBIntegrityServiceImlp.
    368368     */
    369369    @Test
     
    392392        });
    393393
    394         Map<String, String> result = daoDispatcher.addSourcesForAnnotation(1, mockSourceSOne);
     394        Map<String, String> result = dbIntegrityService.addSourcesForAnnotation(1, mockSourceSOne);
    395395        assertEquals(0, result.size());
    396396
     
    405405        mockSourceSTwo.add(testSourceTwo);
    406406
    407 //        final Source mockNewSource = daoDispatcher.createSource(testNewSource);
    408 //        final Version mockNewVersion = daoDispatcher.createVersion(testNewSource);
     407//        final Source mockNewSource = dbIntegrityService.createSource(testNewSource);
     408//        final Version mockNewVersion = dbIntegrityService.createVersion(testNewSource);
    409409
    410410        mockery.checking(new Expectations() {
     
    432432        });
    433433
    434         Map<String, String> resultTwo = daoDispatcher.addSourcesForAnnotation(1, mockSourceSTwo);
     434        Map<String, String> resultTwo = dbIntegrityService.addSourcesForAnnotation(1, mockSourceSTwo);
    435435        assertEquals(1, resultTwo.size());
    436436        assertFalse(null == resultTwo.get(testNewSource.getId()));
     
    439439
    440440    /**
    441      * Test of addUsersAnnotation method, of class DaoDispatcherImpl.
     441     * Test of addUsersAnnotation method, of class DBIntegrityServiceImlp.
    442442     */
    443443    @Test
     
    470470        });
    471471
    472         Number result = daoDispatcher.addUsersAnnotation(testAnnotation, 5);
     472        Number result = dbIntegrityService.addUsersAnnotation(testAnnotation, 5);
    473473        assertEquals(6, result);
    474474    }
     
    476476    //////////////////// DELETERS ////////////////
    477477    /**
    478      * Test of deleteCachedForVersion method, of class DaoDispatcherImpl.
     478     * Test of deleteCachedForVersion method, of class DBIntegrityServiceImlp.
    479479     */
    480480    @Test
     
    492492        });
    493493
    494         int[] result = daoDispatcher.deleteCachedOfVersion(6, 5);
     494        int[] result = dbIntegrityService.deleteCachedOfVersion(6, 5);
    495495        assertEquals(2, result.length);
    496496        assertEquals(1, result[0]);
     
    524524        });
    525525
    526         int[] result = daoDispatcher.deleteAllCachedOfVersion(6);
     526        int[] result = dbIntegrityService.deleteAllCachedOfVersion(6);
    527527        assertEquals(1, result[0]); //version
    528528        assertEquals(1, result[1]); // versions-cached
     
    540540
    541541
    542         int[] resultTwo = daoDispatcher.deleteAllCachedOfVersion(5); // version is in use by the source 4
     542        int[] resultTwo = dbIntegrityService.deleteAllCachedOfVersion(5); // version is in use by the source 4
    543543        assertEquals(0, resultTwo[0]);
    544544        assertEquals(0, resultTwo[1]);
     
    557557        });
    558558
    559         int[] result = daoDispatcher.deleteAllVersionsOfSource(1); //the source is in use, should not be deleted
     559        int[] result = dbIntegrityService.deleteAllVersionsOfSource(1); //the source is in use, should not be deleted
    560560        assertEquals(0, result[0]); //
    561561        assertEquals(0, result[1]);
     
    592592
    593593
    594         int[] resultTwo = daoDispatcher.deleteAllVersionsOfSource(5);// the source will be deleted because it is not referred by any annotation
     594        int[] resultTwo = dbIntegrityService.deleteAllVersionsOfSource(5);// the source will be deleted because it is not referred by any annotation
    595595        assertEquals(3, resultTwo.length);
    596596        assertEquals(1, resultTwo[0]); // source 7 is deleted
     
    600600
    601601    /**
    602      * Test of deleteAnnotationWithSources method, of class DaoDispatcherImpl.
     602     * Test of deleteAnnotationWithSources method, of class DBIntegrityServiceImlp.
    603603     */
    604604    @Test
     
    628628            }
    629629        });
    630         int[] result = daoDispatcher.deleteAnnotation(3);// the source will be deleted because it is not referred by any annotation
     630        int[] result = dbIntegrityService.deleteAnnotation(3);// the source will be deleted because it is not referred by any annotation
    631631        assertEquals(4, result.length);
    632632        assertEquals(1, result[0]); // annotation 3 is deleted
     
    643643//        newSourceInfo.setVersion(null);
    644644//       
    645 //        Source result = daoDispatcher.createSource(newSourceInfo);
     645//        Source result = dbIntegrityService.createSource(newSourceInfo);
    646646//        assertEquals(TestBackendConstants._TEST_NEW_SOURCE_LINK, result.getLink());
    647647//        assertFalse(null == result.getURI());
     
    655655//        newSourceInfo.setVersion(null);
    656656//       
    657 //        Version result = daoDispatcher.createVersion(newSourceInfo);
     657//        Version result = dbIntegrityService.createVersion(newSourceInfo);
    658658//        assertFalse(null == result.getVersion()); // will be chnaged once the schema for version is fixed: ID is added
    659659//       
Note: See TracChangeset for help on using the changeset viewer.