Generate versioned Model metadata and consume it in shared binding discovery
This commit is contained in:
@@ -20,4 +20,11 @@
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build><plugins><plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<annotationProcessorPaths><path><groupId>de.neitzel.fxdesigner</groupId><artifactId>designer-model-processor</artifactId><version>0.1.0-SNAPSHOT</version></path></annotationProcessorPaths>
|
||||
<compilerArgs><arg>-Adesigner.models=fixture.model.Person,fixture.model.Address</arg></compilerArgs>
|
||||
</configuration>
|
||||
</plugin></plugins></build>
|
||||
</project>
|
||||
|
||||
+9
@@ -70,6 +70,15 @@ public final class PreviewChecks {
|
||||
xml = new String(in.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8);
|
||||
}
|
||||
var metadata = BindingDiscovery.inspect(xml, "home", "both", loader);
|
||||
check(
|
||||
metadata.diagnostics().contains("Generated Model metadata 1.0: fixture.model.Person"),
|
||||
"Generated Person metadata not used: " + metadata.diagnostics());
|
||||
check(
|
||||
metadata.diagnostics().contains("Generated Model metadata 1.0: fixture.model.Address"),
|
||||
"Generated nested metadata not used");
|
||||
check(
|
||||
metadata.problems().stream().noneMatch(p -> p.message().contains("metadata rejected")),
|
||||
"Generated metadata rejected");
|
||||
check(
|
||||
metadata.attributes().stream().anyMatch(a -> a.path().equals("home.street")),
|
||||
"Nested metadata");
|
||||
|
||||
Reference in New Issue
Block a user