SqlDbFeatureExecutor extends AbstractDbFeatureExecutor<IDataSet, IDatabaseConnection> { @Override protected List<IDataSet> loadDataSets(final List<String> paths) { final List<IDataSet> dataSets = new ArrayList<>(); try { for (final String path : paths) { final File file = new File(toUri(path)); final DataSetLoader<IDataSet> loader = DataSetFormat.inferFromFile(file).select(new DataSetLoaderProvider()); dataSets.add(loader.load(file)); } } catch (final IOException e) { throw new JpaUnitException("Could not load initial data sets", e); } return dataSets; } SqlDbFeatureExecutor(final FeatureResolver featureResolver);   }
@Test public void testLoadDataSetsUsingAvailableFilePaths() throws DataSetException { final List<IDataSet> dataSetList = featureExecutor.loadDataSets(Arrays.asList("test-data.json", "test-data.json")); assertNotNull(dataSetList); assertThat(dataSetList.size(), equalTo(2)); final IDataSet ds1 = dataSetList.get(0); assertNotNull(ds1); assertThat(ds1.getTableNames().length, equalTo(2)); final IDataSet ds2 = dataSetList.get(0); assertNotNull(ds2); assertThat(ds2.getTableNames().length, equalTo(2)); assertThat(ds1, equalTo(ds2)); }
@Test(expected = JpaUnitException.class) public void testLoadDataSetsUsingNotAvailableFilePaths() { featureExecutor.loadDataSets(Arrays.asList("test-data1.json")); }