Skip to content

Specify Output Files Source Location #553

Open
@fabunde

Description

@fabunde

I have added the following configuration to specify my source directory to use the source of the pre-compiled class but the approve.txt and receive.txt files are saved in the compile location (something like user/.cache/...). Is there a separate configuration to specify the output source?

I have tried the Package settings method but this doesn't change the source, only the path:
public class PackageSettings { public static String ApprovalBaseDirectory = "../resources"; }

My configuration to specify path (with test):
` @test
public void testPresentAvailabilityItems() {
List items =
presenter.presentAvailabilityItems(
PriceAvailabilityDataPresenter.CONTENT_ITEM_TYPES_IN_ORDER, false, false, true);

// begin-snippet: define_alternative_source_directory_finder
Function2<Class, String, File> myFinder = new Function2<Class, String, File>()
{
  @Override
  public File call(Class clazz, String fileName)
  {
    System.out.println("source: "+ clazz.getPackage().getName().replaceAll("\\.", "/"));
    return new File("src/test/java/" + clazz.getPackage().getName().replaceAll("\\.", "/"));
  }
};
// end-snippet
// begin-snippet: configure_alternative_source_directory
try (SourceDirectoryRestorer sdr = registerSourceDirectoryFinder(myFinder))
{
  Approvals.verify("Ragunath");
}`

If there's a configuration to specify the location of the test result files, please point me in the right direction. I'm using version 24.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions