FileInput implements InclusionDependencyInput { @Override public List<InclusionDependency> execute() { final Configuration configuration = prepareConfiguration(); validate(configuration); try { final List<InclusionDependency> inds = read(configuration); if (configuration.getMaxDepth() > 0) { return filterByLength(inds, configuration.getMaxDepth()); } else { return inds; } } catch (final IOException e) { throw new RuntimeException("Cannot read INDs from " + configuration.getInputPath(), e); } } FileInput(final InclusionDependencyParameters parameters); @Override List<InclusionDependency> execute();  }
@Test void readExampleUnaryInput() { final InclusionDependencyParameters parameters = getParameters("2018-01-18_13-21-37_inds", 1); final FileInput input = new FileInput(parameters); final List<InclusionDependency> result = input.execute(); assertThat(result) .hasSize(10) .contains(sampleInd()); }
@Test void readExampleNaryInput() { final InclusionDependencyParameters parameters = getParameters("2018-01-18_13-21-37_inds", -1); final FileInput input = new FileInput(parameters); final List<InclusionDependency> result = input.execute(); assertThat(result) .hasSize(11) .contains(sampleNary()); }