Guest User

Untitled

a guest
Oct 18th, 2017
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. package fi.almamedia.dtf.core.dao.canonical;
  2.  
  3. import fi.almamedia.dtf.core.BaseDtfCoreDbUnitTest;
  4. import fi.almamedia.dtf.core.dao.integratedsource.IntegratedSourceDAO;
  5. import fi.almamedia.dtf.core.integration.IntegratedSource;
  6. import fi.almamedia.dtf.core.model.entities.CanonicalModelRule;
  7. import org.junit.Test;
  8. import org.junit.runner.RunWith;
  9. import org.springframework.test.annotation.DirtiesContext;
  10. import org.springframework.test.context.ContextConfiguration;
  11. import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
  12. import org.springframework.transaction.annotation.Transactional;
  13.  
  14. import javax.annotation.Resource;
  15. import java.util.List;
  16.  
  17. /**
  18. * -
  19. *
  20. * @author sandort@artsoft-consult.ro
  21. */
  22. @RunWith(SpringJUnit4ClassRunner.class)
  23. @ContextConfiguration
  24. @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
  25. // This is massively important! It causes the appCtx to be reloaded for each test class
  26. @Transactional
  27. public class CanonicalModelDAOTest extends BaseDtfCoreDbUnitTest {
  28.  
  29. @Resource
  30. protected CanonicalModelDAO canonicalModelDAO;
  31.  
  32. @Resource
  33. protected IntegratedSourceDAO integratedSourceDAO;
  34.  
  35.  
  36. public CanonicalModelDAOTest() {
  37. this.dbContentFile = "fi/almamedia/dtf/core/dao/job/JobDAOTestResources/dbunit/canonical_model_data.xml";
  38. }
  39.  
  40. @Test
  41. public void testFindByIntegratedSource() {
  42. /*
  43. IntegratedSource integratedSource = integratedSourceDAO.findById(2L);
  44. assertEquals("ISI2",integratedSource.getName());
  45. List<CanonicalModelRule> canonicalModelRulesList = canonicalModelDAO.findByIntegratedSource(integratedSource.getId());
  46. assertNotNull(canonicalModelRulesList);
  47. for (CanonicalModelRule canonicalModelRule : canonicalModelRulesList) {
  48. assertNotNull(canonicalModelRule.getId());
  49. }
  50. */
  51. }
  52. }
Add Comment
Please, Sign In to add comment