Skip to content

Recommended Kotlin directory structure is unsupported #352

Open
@micheljung

Description

@micheljung

From the Kotlin coding conventions:

Source code organization

Directory Structure

In pure Kotlin projects, the recommended directory structure follows the package structure with the common root package omitted. For example, if all the code in the project is in the org.example.kotlin package and its subpackages, files with the org.example.kotlin package should be placed directly under the source root, and files in org.example.kotlin.network.socket should be in the network/socket subdirectory of the source root.

However, if you do this, you get:

Didn't find org.example.kotlin.network.socket.ExampleTest under C:\work\example
com.spun.util.FormattedException: org.example.kotlin.network.socket.ExampleTest under C:\work\example
	at app//com.spun.util.ClassUtils.getSourceDirectory(ClassUtils.java:103)
	at app//com.spun.util.ClassUtils.getSourceDirectory(ClassUtils.java:108)
	at app//com.spun.util.tests.TestUtils.getInfo(TestUtils.java:214)
	at app//com.spun.util.tests.TestUtils.getCurrentFileForMethod(TestUtils.java:201)
	at app//com.spun.util.tests.TestUtils.getCurrentFileForMethod(TestUtils.java:193)
	at app//org.approvaltests.namer.StackTraceNamer.<init>(StackTraceNamer.java:17)
	at app//org.approvaltests.Approvals$1.load(Approvals.java:41)
	at app//org.approvaltests.Approvals$1.load(Approvals.java:38)
	at app//org.approvaltests.Approvals.createApprovalNamer(Approvals.java:257)
	at app//com.spun.util.ArrayUtils.getOrElse(ArrayUtils.java:302)
	at app//org.approvaltests.core.Options$FileOptions.getNamer(Options.java:104)
	at app//org.approvaltests.Approvals.verify(Approvals.java:183)
	at app//org.approvaltests.Approvals.verify(Approvals.java:50)
	at app//org.approvaltests.Approvals.verify(Approvals.java:59)
	at app//org.approvaltests.combinations.CombinationsHelper.verifyAllCombinations(CombinationsHelper.java:27)
	at app//org.approvaltests.combinations.CombinationApprovals.verifyAllCombinations(CombinationApprovals.java:205)
	at app//org.approvaltests.combinations.CombinationApprovals.verifyAllCombinations(CombinationApprovals.java:194)
	at app//org.approvaltests.combinations.CombinationApprovals.verifyAllCombinations(CombinationApprovals.java:50)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions