Skip to content

Assert the actually used backend and context implementations in tests modules #57

Open
@yevhenii-nadtochii

Description

@yevhenii-nadtochii

These modules test LogLevelMap in different combinations of backend and context.

A particular pair of backend and context implementations is a test subject here. But we can't specify them with code. They are part of Gradle module configuration. We add the corresponding implementations to runtimClasspath and make the assumption that the logging Platform would load exactly them. And I believe it is so in most cases.

Though, recently in #50 it was found that if two following conditions are met:

  1. Backend implementation fails to expose its BackendFactory as a Java service. It may be due to incorrect service declaration in META-INF file. Or maybe the annotation preprocessor didn't start (if @AutoValue annotation was used).
  2. Some transitive dependency puts another BackendFactory on the classpath.

Then our test may accidentally pass where it should have failed.

I've added such assertions in the following tests:

  • jvm-our-backend-our-context.
  • jvm-log4j-backend-our-context.

Please take a look and propagate such assertions to other modules in tests directory. It is sort of double check, but it may be useful due to complexity of Gradle configurations and runtime.

Maybe some abstract base can be created for such assertions.

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