/** * Starts the transform. Here the transform is instantiated through reflection. If the config file * is specified, a constructor with a single parameter accepting a {@link File} is used, otherwise * an empty constructor. * * @throws Exception for any exception happened during the transform process. */ void runTransform() throws Exception { Transform transform = configFile != null ? transformClass.getConstructor(File.class).newInstance(configFile) : transformClass.newInstance(); TransformOutputProvider transformOutputProvider = new JarsTransformOutputProvider(outputJarsDir, inputJarsDir); runTransform(transform, transformOutputProvider); }
@Test public void getContentLocation() throws Exception { File output = provider.getContentLocation(inputJarFile.getAbsolutePath(), null, null, Format.JAR); assertThat(output.getAbsolutePath()).isEqualTo(outputJarFile.getAbsolutePath()); } }
@Before public void setUp() throws Exception { File baseFolder = Files.newTemporaryFolder(); this.inputJarFile = new File(baseFolder, NAME); this.outputJarFile = new File(baseFolder, EXPECTED_OUTPUT_JAR); this.inputFolder = new File(baseFolder, INPUT); this.outputFolder = new File(baseFolder, OUTPUT); this.provider = new JarsTransformOutputProvider(outputFolder, inputFolder); }