Skip to content

Test module ? #129

@glelouet

Description

@glelouet

The test in JCM mostly use code matching.

This is weird because this should instead be checked using compiler.

I propose the following changes :

  1. a /jcodemodeltests module, with whatever groupId:artifactid ; depends on main JCodemodel module.
  2. a @JCMTested annotation to place on the test classes that generate JCodemodel instances
  3. an annotation processor that generates the corresponding classes in src/test/generated

This way I could have a test class in src/main/java with

public JCodemodel createSimpleIntRecord(){
// do the creation and return the CM
}

and the corresponding test in src/test/java with

  @Test public void testSimpleIntRecord(){
  SimpleIntrecord sr = new SimpleIntRecord(24);
}

That's the basic idea, if yo have better one I'm all hear.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions