junit.extensions.TestSetup Java Examples

The following examples show how to use junit.extensions.TestSetup. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SURTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * The suite contains all testcases in this class running on different 
 * data models
 */
private static Test baseSuite(String name) { 
    
    TestSuite mainSuite = new TestSuite(name);
    
    // Iterate over all data models and decorate the tests:
    for (Iterator i = SURDataModelSetup.SURDataModel.values().iterator();
         i.hasNext();) {
        
        SURDataModelSetup.SURDataModel model = 
            (SURDataModelSetup.SURDataModel) i.next();
        
        TestSuite suite = new TestSuite(SURTest.class);
        TestSetup decorator = new SURDataModelSetup
            (suite, model);
        
        mainSuite.addTest(decorator);    
    }
    
    return mainSuite;
}
 
Example #2
Source File: KeycloakConfigureAdminGroupAndUsePathAsId.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminGroupAndUsePathAsId.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminGroupAndUsePathAsId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #3
Source File: KeycloakConfigureAdminGroupAsPathAndUsePathAsId.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminGroupAsPathAndUsePathAsId.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminGroupAsPathAndUsePathAsId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #4
Source File: KeycloakConfigureAdminUserIdAsUsernameTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminUserIdAsUsernameTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminUserIdAsUsername.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #5
Source File: KeycloakConfigureAdminUserIdAsUsernameSimilarToClientName.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminUserIdAsUsernameSimilarToClientName.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminUserIdAsUsernameSimilarToClientName.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #6
Source File: KeycloakUseKeycloakIdAsUserIdQueryTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakUseKeycloakIdAsUserIdQueryTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.useKeycloakIdAsCamundaUserId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #7
Source File: KeycloakConfigureAdminUserIdAsMailTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminUserIdAsMailTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminUserIdAsMail.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #8
Source File: KeycloakConfigureAdminUserIdAsUsernameAndUseUsernameAsIdTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminUserIdAsUsernameAndUseUsernameAsIdTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminUserIdAsUsernameAndUseUsernameAsId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #9
Source File: KeycloakUseUsernameAsUserIdQueryTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakUseUsernameAsUserIdQueryTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.useUsernameAsCamundaUserId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #10
Source File: KeycloakConfigureAdminUserIdAndUseUsernameAsIdTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminUserIdAndUseUsernameAsIdTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminUserIdAndUseUsernameAsId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config).setAdministratorUserId(USER_ID_CAMUNDA_ADMIN);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #11
Source File: TestMiniMRDFSSort.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
  TestSetup setup = new TestSetup(new TestSuite(TestMiniMRDFSSort.class)) {
    protected void setUp() throws Exception {
      Configuration conf = new Configuration();
      dfsCluster = new MiniDFSCluster(conf, NUM_HADOOP_SLAVES, true, null);
      dfs = dfsCluster.getFileSystem();
      mrCluster = new MiniMRCluster(NUM_HADOOP_SLAVES, 
                                    dfs.getUri().toString(), 1);
    }
    protected void tearDown() throws Exception {
      if (dfsCluster != null) { dfsCluster.shutdown(); }
      if (mrCluster != null) { mrCluster.shutdown(); }
    }
  };
  return setup;
}
 
Example #12
Source File: KeycloakConfigureAdminUserIdAndUseMailAsIdTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminUserIdAndUseMailAsIdTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminUserIdAndUseMailAsId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config).setAdministratorUserId(USER_ID_CAMUNDA_ADMIN);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example #13
Source File: SURQueryMixTest.java    From spliceengine with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * The suite contains all testcases in this class running on different data models
 */
private static Test baseSuite(String name) {
    TestSuite mainSuite = new TestSuite(name);
  
    // Iterate over all data models and decorate the tests:
    for (Iterator i = SURDataModelSetup.SURDataModel.values().iterator();
         i.hasNext();) {
        
        SURDataModelSetup.SURDataModel model =
            (SURDataModelSetup.SURDataModel) i.next();
        
        TestSuite suite = createTestCases(model.toString());
        TestSetup decorator = new SURDataModelSetup(suite, model);
        mainSuite.addTest(decorator);
    }
    return mainSuite;
}
 
Example #14
Source File: SURTest.java    From spliceengine with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * The suite contains all testcases in this class running on different 
 * data models
 */
private static Test baseSuite(String name) { 
    
    TestSuite mainSuite = new TestSuite(name);
    
    // Iterate over all data models and decorate the tests:
    for (Iterator i = SURDataModelSetup.SURDataModel.values().iterator();
         i.hasNext();) {
        
        SURDataModelSetup.SURDataModel model = 
            (SURDataModelSetup.SURDataModel) i.next();
        
        TestSuite suite = new TestSuite(SURTest.class);
        TestSetup decorator = new SURDataModelSetup
            (suite, model);
        
        mainSuite.addTest(decorator);    
    }
    
    return mainSuite;
}
 
Example #15
Source File: TestFileAppend3.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
  return new TestSetup(new TestSuite(TestFileAppend3.class)) {
    protected void setUp() throws java.lang.Exception {
      AppendTestUtil.LOG.info("setUp()");
      conf = new Configuration();
      conf.setInt("io.bytes.per.checksum", 512);
      conf.setBoolean("dfs.support.append", true);
      buffersize = conf.getInt("io.file.buffer.size", 4096);
      cluster = new MiniDFSCluster(conf, DATANODE_NUM, true, null);
      fs = (DistributedFileSystem)cluster.getFileSystem();
    }
  
    protected void tearDown() throws Exception {
      AppendTestUtil.LOG.info("tearDown()");
      if(fs != null) fs.close();
      if(cluster != null) cluster.shutdown();
    }
  };  
}
 
Example #16
Source File: TestConfiguration.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * Similar to additionalDatabaseDecorator except the database will
 * not be shutdown, only deleted. It is the responsibility of the
 * test to shut it down.
 *
 * @param test Test to be decorated
 * @param logicalDbName The logical database name. This name is
 *                      used to identify the database in
 *                      openConnection(String logicalDatabaseName)
 *                      method calls.
 * @return decorated test.
 */
public static TestSetup additionalDatabaseDecoratorNoShutdown(
    Test test,
    String logicalDbName)
{
    return new DatabaseChangeSetup(
        new DropDatabaseSetup(test, logicalDbName)
        {
            protected void tearDown() throws Exception {
                // the test is responsible for shutdown
                removeDatabase();
            }
        },
        logicalDbName,
        generateUniqueDatabaseName(),
        false);
}
 
Example #17
Source File: SURQueryMixTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * The suite contains all testcases in this class running on different data models
 */
private static Test baseSuite(String name) {
    TestSuite mainSuite = new TestSuite(name);
  
    // Iterate over all data models and decorate the tests:
    for (Iterator i = SURDataModelSetup.SURDataModel.values().iterator();
         i.hasNext();) {
        
        SURDataModelSetup.SURDataModel model =
            (SURDataModelSetup.SURDataModel) i.next();
        
        TestSuite suite = createTestCases(model.toString());
        TestSetup decorator = new SURDataModelSetup(suite, model);
        mainSuite.addTest(decorator);
    }
    return mainSuite;
}
 
Example #18
Source File: TestAvailableForUnderConstruction.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
  return new TestSetup(new TestSuite(TestAvailableForUnderConstruction.class)) {
    protected void setUp() throws java.lang.Exception {
      AppendTestUtil.LOG.info("setUp()");
      conf = new Configuration();
      conf.setInt("io.bytes.per.checksum", 512);
      conf.setBoolean("dfs.support.append", true);
      buffersize = conf.getInt("io.file.buffer.size", 4096);
      cluster = new MiniDFSCluster(conf, DATANODE_NUM, true, null);
      fs = (DistributedFileSystem) cluster.getFileSystem();
    }

    protected void tearDown() throws Exception {
      AppendTestUtil.LOG.info("tearDown()");
      if (fs != null)
        fs.close();
      if (cluster != null)
        cluster.shutdown();
    }
  };
}
 
Example #19
Source File: TestClusterStatus.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
  TestSetup setup = new TestSetup(new TestSuite(TestClusterStatus.class)) {
    protected void setUp() throws Exception {
      JobConf conf = new JobConf();
      conf.setClass("mapred.jobtracker.taskScheduler", 
          TestClusterStatus.FakeTaskScheduler.class,
                TaskScheduler.class);
      mr = new MiniMRCluster(0, 0, 0, "file:///", 1, null, null, null, conf);
      jobTracker = mr.getJobTrackerRunner().getJobTracker();
      for (String tracker : trackers) {
        establishFirstContact(jobTracker, tracker);
      }
      client = new JobClient(mr.createJobConf());
    }

    protected void tearDown() throws Exception {
      client.close();
      mr.shutdown();
    }
  };
  return setup;
}
 
Example #20
Source File: TestJoinProperties.java    From big-c with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
  TestSetup setup = new TestSetup(new TestSuite(TestJoinProperties.class)) {
    protected void setUp() throws Exception {
      Configuration conf = new Configuration();
      cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build();
      base = cluster.getFileSystem().makeQualified(new Path("/nested"));
      src = generateSources(conf);
    }
    protected void tearDown() throws Exception {
      if (cluster != null) {
        cluster.shutdown();
      }
    }
  };
  return setup;
}
 
Example #21
Source File: TestSpeculativeExecution.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
  TestSetup setup =
    new TestSetup(new TestSuite(TestSpeculativeExecution.class)) {
    @Override
    protected void setUp() throws Exception {
      JobConf conf = new JobConf();
      conf.set(JT_IPC_ADDRESS, "localhost:0");
      conf.set(JT_HTTP_ADDRESS, "0.0.0.0:0");
      jobTracker = new FakeJobTracker
        (conf, (clock = new SpecFakeClock(conf.getMapSpeculativeLag())),
         trackers);
      for (String tracker : trackers) {
        FakeObjectUtilities.establishFirstContact(jobTracker, tracker);
      }
    }
    @Override
    protected void tearDown() throws Exception {
      //delete the build/test/logs/ dir
    }
  };
  return setup;
}
 
Example #22
Source File: ExtensionTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public void testRunningErrorsInTestSetup() {
	TestCase failure= new TestCase("failure") {
		public void runTest() {
			fail();
		}
	};

	TestCase error= new TestCase("error") {
		public void runTest() {
			throw new Error();
		}
	};

	TestSuite suite= new TestSuite();
	suite.addTest(failure);
	suite.addTest(error);
	
	TestSetup wrapper= new TestSetup(suite);

	TestResult result= new TestResult();
	wrapper.run(result);

	assertEquals(1, result.failureCount());
	assertEquals(1, result.errorCount());
}
 
Example #23
Source File: TestMiniMRDFSSort.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
  TestSetup setup = new TestSetup(new TestSuite(TestMiniMRDFSSort.class)) {
    protected void setUp() throws Exception {
      Configuration conf = new Configuration();
      dfsCluster = new MiniDFSCluster(conf, NUM_HADOOP_SLAVES, true, null);
      dfs = dfsCluster.getFileSystem();
      mrCluster = new MiniMRCluster(NUM_HADOOP_SLAVES, 
                                    dfs.getUri().toString(), 1);
    }
    protected void tearDown() throws Exception {
      if (dfsCluster != null) { dfsCluster.shutdown(); }
      if (mrCluster != null) { mrCluster.shutdown(); }
    }
  };
  return setup;
}
 
Example #24
Source File: PrivacyTest.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
public static Test suite() 
{
	TestSetup setup = new TestSetup(new TestSuite(PrivacyTest.class)) 
	{
		protected void setUp() throws Exception 
		{
			log.info("starting setup -- PrivacyTest");
			oneTimeSetup();
			log.info("finished setup -- PrivacyTest");
		}
		protected void tearDown() throws Exception 
		{
			oneTimeTearDown();
		}
	};
	return setup;
}
 
Example #25
Source File: TestConfiguration.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * Similar to additionalDatabaseDecorator except the database will
 * not be shutdown, only deleted. It is the responsibility of the
 * test to shut it down.
 *
 * @param test Test to be decorated
 * @param logicalDbName The logical database name. This name is
 *                      used to identify the database in
 *                      openConnection(String logicalDatabaseName)
 *                      method calls.
 * @return decorated test.
 */
public static TestSetup additionalDatabaseDecoratorNoShutdown(
    Test test,
    String logicalDbName)
{
    return new DatabaseChangeSetup(
        new DropDatabaseSetup(test, logicalDbName)
        {
            protected void tearDown() throws Exception {
                // the test is responsible for shutdown
                removeDatabase();
            }
        },
        logicalDbName,
        generateUniqueDatabaseName(),
        false);
}
 
Example #26
Source File: TestResourceEventVoter.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
public static Test suite()
{
	TestSetup setup = new TestSetup(new TestSuite(TestResourceEventVoter.class))
	{
		protected void setUp() throws Exception
		{
			oneTimeSetup();
		}

		protected void tearDown() throws Exception
		{
			oneTimeTearDown();
		}
	};
	return setup;
}
 
Example #27
Source File: PrivacyTest.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
public static Test suite() 
{
	TestSetup setup = new TestSetup(new TestSuite(PrivacyTest.class)) 
	{
		protected void setUp() throws Exception 
		{
			log.info("starting setup -- PrivacyTest");
			oneTimeSetup();
			log.info("finished setup -- PrivacyTest");
		}
		protected void tearDown() throws Exception 
		{
			oneTimeTearDown();
		}
	};
	return setup;
}
 
Example #28
Source File: TestResourceEventVoter.java    From sakai with Educational Community License v2.0 6 votes vote down vote up
public static Test suite()
{
	TestSetup setup = new TestSetup(new TestSuite(TestResourceEventVoter.class))
	{
		protected void setUp() throws Exception
		{
			oneTimeSetup();
		}

		protected void tearDown() throws Exception
		{
			oneTimeTearDown();
		}
	};
	return setup;
}
 
Example #29
Source File: SURTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * The suite contains all testcases in this class running on different 
 * data models
 */
private static Test baseSuite(String name) { 
    
    TestSuite mainSuite = new TestSuite(name);
    
    // Iterate over all data models and decorate the tests:
    for (Iterator i = SURDataModelSetup.SURDataModel.values().iterator();
         i.hasNext();) {
        
        SURDataModelSetup.SURDataModel model = 
            (SURDataModelSetup.SURDataModel) i.next();
        
        TestSuite suite = new TestSuite(SURTest.class);
        TestSetup decorator = new SURDataModelSetup
            (suite, model);
        
        mainSuite.addTest(decorator);    
    }
    
    return mainSuite;
}
 
Example #30
Source File: SURQueryMixTest.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
/**
 * The suite contains all testcases in this class running on different data models
 */
private static Test baseSuite(String name) {
    TestSuite mainSuite = new TestSuite(name);
  
    // Iterate over all data models and decorate the tests:
    for (Iterator i = SURDataModelSetup.SURDataModel.values().iterator();
         i.hasNext();) {
        
        SURDataModelSetup.SURDataModel model =
            (SURDataModelSetup.SURDataModel) i.next();
        
        TestSuite suite = createTestCases(model.toString());
        TestSetup decorator = new SURDataModelSetup(suite, model);
        mainSuite.addTest(decorator);
    }
    return mainSuite;
}