use of org.testng.annotations.BeforeMethod in project head by mifos.
the class SearchGroupTest method setUp.
@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// one of the dependent methods throws Exception
@BeforeMethod
public void setUp() throws Exception {
super.setUp();
appLauncher = new AppLauncher(selenium);
}
use of org.testng.annotations.BeforeMethod in project pinot by linkedin.
the class TarGzCompressionUtilsTest method setUpTest.
@BeforeMethod
public void setUpTest() throws IOException {
TEST_DIR = Files.createTempDirectory(TarGzCompressionUtils.class.getName()).toFile();
TEST_DIR.deleteOnExit();
dataDir = new File(TEST_DIR, "dataDir");
tarDir = new File(TEST_DIR, "tarDir");
untarDir = new File(TEST_DIR, "untarDir");
segmentDir = new File(dataDir, SEGMENT_NAME);
FileUtils.forceMkdir(dataDir);
FileUtils.forceMkdir(tarDir);
FileUtils.forceMkdir(untarDir);
FileUtils.forceMkdir(segmentDir);
}
use of org.testng.annotations.BeforeMethod in project pinot by linkedin.
the class FilePerIndexDirectoryTest method setUpTest.
@BeforeMethod
public void setUpTest() throws IOException, ConfigurationException {
segmentDir = new File(TEST_DIRECTORY, "segmentDirectory");
if (segmentDir.exists()) {
FileUtils.deleteQuietly(segmentDir);
}
if (segmentDir.exists()) {
throw new RuntimeException("directory exists");
}
segmentDir.mkdirs();
segmentMetadata = ColumnIndexDirectoryTestHelper.writeMetadata(SegmentVersion.v1);
}
use of org.testng.annotations.BeforeMethod in project pinot by linkedin.
the class SegmentV1V2ToV3FormatConverterTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
INDEX_DIR = Files.createTempDirectory(SegmentV1V2ToV3FormatConverter.class.getName() + "_segmentDir").toFile();
final String filePath = TestUtils.getFileFromResourceUrl(SegmentV1V2ToV3FormatConverter.class.getClassLoader().getResource(AVRO_DATA));
// intentionally changed this to TimeUnit.Hours to make it non-default for testing
final SegmentGeneratorConfig config = SegmentTestUtils.getSegmentGenSpecWithSchemAndProjectedColumns(new File(filePath), INDEX_DIR, "daysSinceEpoch", TimeUnit.HOURS, "testTable");
config.setSegmentNamePostfix("1");
config.setTimeColumnName("daysSinceEpoch");
final SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
driver.init(config);
driver.build();
segmentDirectory = new File(INDEX_DIR, driver.getSegmentName());
File starTreeFile = new File(segmentDirectory, V1Constants.STAR_TREE_INDEX_FILE);
FileUtils.touch(starTreeFile);
FileUtils.writeStringToFile(starTreeFile, "This is a star tree index");
Configuration tableConfig = new PropertiesConfiguration();
tableConfig.addProperty(IndexLoadingConfigMetadata.KEY_OF_SEGMENT_FORMAT_VERSION, "v1");
v1LoadingConfig = new IndexLoadingConfigMetadata(tableConfig);
tableConfig.clear();
tableConfig.addProperty(IndexLoadingConfigMetadata.KEY_OF_SEGMENT_FORMAT_VERSION, "v3");
v3LoadingConfig = new IndexLoadingConfigMetadata(tableConfig);
}
use of org.testng.annotations.BeforeMethod in project pinot by linkedin.
the class LoadersTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
INDEX_DIR = Files.createTempDirectory(LoadersTest.class.getName() + "_segmentDir").toFile();
final String filePath = TestUtils.getFileFromResourceUrl(Loaders.class.getClassLoader().getResource(AVRO_DATA));
final SegmentGeneratorConfig config = SegmentTestUtils.getSegmentGenSpecWithSchemAndProjectedColumns(new File(filePath), INDEX_DIR, "daysSinceEpoch", TimeUnit.HOURS, "testTable");
config.setSegmentNamePostfix("1");
config.setTimeColumnName("daysSinceEpoch");
final SegmentIndexCreationDriver driver = SegmentCreationDriverFactory.get(null);
driver.init(config);
driver.build();
segmentDirectory = new File(INDEX_DIR, driver.getSegmentName());
Configuration tableConfig = new PropertiesConfiguration();
tableConfig.addProperty(IndexLoadingConfigMetadata.KEY_OF_SEGMENT_FORMAT_VERSION, "v1");
v1LoadingConfig = new IndexLoadingConfigMetadata(tableConfig);
tableConfig.clear();
tableConfig.addProperty(IndexLoadingConfigMetadata.KEY_OF_SEGMENT_FORMAT_VERSION, "v3");
v3LoadingConfig = new IndexLoadingConfigMetadata(tableConfig);
}
Aggregations