/** * Decorate a set of tests to use a single use database with logDevice pointing a log directory to * non-default location */ public static Test logDeviceAttributeDatabase(Test test, final String logDevice) { Properties attributes = new Properties(); if (logDevice != null) { attributes.setProperty("logDevice", logDevice); } test = TestConfiguration.singleUseDatabaseDecorator(test); return attributesDatabase(attributes, test); }
/** * Decorate a test (or suite of tests) to use a single use database as the default database with a * specified set connection attributes. * * @param attributes properties to set in the connection URL or in the connectionAttributes of a * data source when connecting to the database * @param test Test to decorate * @return Decorated test */ public static Test attributesDatabase(final Properties attributes, Test test) { test = new ChangeConfigurationSetup(test) { TestConfiguration getNewConfiguration(TestConfiguration old) { return old.addConnectionAttributes(attributes); } }; return TestConfiguration.singleUseDatabaseDecorator(test); }