Example #1
0
 @Override
 public void tearDown() throws Exception {
   try {
     tearDownLegacyContext();
   } finally {
     super
         .tearDown(); // To change body of overridden methods use File | Settings | File Templates.
   }
 }
Example #2
0
  @Override
  protected void setUpInternal() throws Exception {
    super.setUpInternal();

    List<Class> classes =
        TestUtilities.getHierarchyClassesToHandle(
            getClass(), new Class[] {TestDictionaryConfig.class}, new HashSet<String>());

    // if annotation is present then initialize test data dictionary (setup once per suite)
    if (!classes.isEmpty()) {
      ConfigurableApplicationContext context =
          new ClassPathXmlApplicationContext("TestDataDictionary.xml");
      dd = (DataDictionary) context.getBean("testDataDictionary");

      // add any additional dictionary files required by the test
      for (Class c : classes) {
        if (c.isAnnotationPresent(TestDictionaryConfig.class)) {
          TestDictionaryConfig testDictionaryConfig =
              (TestDictionaryConfig) c.getAnnotation(TestDictionaryConfig.class);

          String namespaceCode = testDictionaryConfig.namespaceCode();
          String dictionaryFileString = testDictionaryConfig.dataDictionaryFiles();

          String[] dictionaryFiles = StringUtils.split(dictionaryFileString, ",");
          for (String dictionaryFile : dictionaryFiles) {
            LOG.info("Adding test data dictionary file: " + dictionaryFile);

            dd.addConfigFileLocation(namespaceCode, dictionaryFile);
          }
        }
      }

      dd.parseDataDictionaryConfigurationFiles(false);
      dd.validateDD(
          false); // Validation performs some necessary post-processing of the beans - we need to
                  // run this each time we add new files
      dd.performBeanOverrides();
    }
  }
Example #3
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   setUpLegacyContext();
 }
Example #4
0
 @Override
 protected void loadSuiteTestData() throws Exception {
   super.loadSuiteTestData();
   new SQLDataLoader(SQL_FILE, ";").runSql();
 }