Skip to content

Commit ddd21c6

Browse files
committed
Add WebTestSupport utility class and diagram resource for React tests
- Introduced WebTestSupport.java to provide helper methods for TypeScript model creation, static site generation, and HTTP server interactions in tests. - Added a new diagram.drawio file to visualize the structure and relationships of various components in the React model.
1 parent 17a66eb commit ddd21c6

13 files changed

Lines changed: 3854 additions & 21 deletions

‎model/.classpath‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<attribute name="maven.pomderived" value="true"/>
1313
</attributes>
1414
</classpathentry>
15-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
15+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25">
1616
<attributes>
1717
<attribute name="maven.pomderived" value="true"/>
1818
</attributes>
@@ -42,22 +42,5 @@
4242
<attribute name="optional" value="true"/>
4343
</attributes>
4444
</classpathentry>
45-
<classpathentry kind="src" path="target/generated-sources/annotations">
46-
<attributes>
47-
<attribute name="optional" value="true"/>
48-
<attribute name="maven.pomderived" value="true"/>
49-
<attribute name="ignore_optional_problems" value="true"/>
50-
<attribute name="m2e-apt" value="true"/>
51-
</attributes>
52-
</classpathentry>
53-
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
54-
<attributes>
55-
<attribute name="optional" value="true"/>
56-
<attribute name="maven.pomderived" value="true"/>
57-
<attribute name="ignore_optional_problems" value="true"/>
58-
<attribute name="m2e-apt" value="true"/>
59-
<attribute name="test" value="true"/>
60-
</attributes>
61-
</classpathentry>
6245
<classpathentry kind="output" path="target/classes"/>
6346
</classpath>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
eclipse.preferences.version=1
2-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
3-
org.eclipse.jdt.core.compiler.compliance=21
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=25
3+
org.eclipse.jdt.core.compiler.compliance=25
44
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
55
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
66
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
77
org.eclipse.jdt.core.compiler.processAnnotations=disabled
88
org.eclipse.jdt.core.compiler.release=enabled
9-
org.eclipse.jdt.core.compiler.source=21
9+
org.eclipse.jdt.core.compiler.source=25

‎model/pom.xml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,37 @@
2222
<groupId>org.codehaus.mojo</groupId>
2323
<artifactId>build-helper-maven-plugin</artifactId>
2424
</plugin>
25+
<!--
26+
Tests are patched into org.nasdanika.models.react on the module path.
27+
The web tests serve pages with the JDK HTTP server and fetch them with the
28+
JDK HTTP client, and DrawioEmbedTests parses draw.io XML with the JDK DOM, so
29+
the test module has to read jdk.httpserver, java.net.http and java.xml. Test
30+
scope only: the model itself needs none of them.
31+
-->
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-compiler-plugin</artifactId>
35+
<executions>
36+
<execution>
37+
<id>default-testCompile</id>
38+
<configuration>
39+
<compilerArgs>
40+
<arg>--add-modules</arg>
41+
<arg>jdk.httpserver,java.net.http,java.xml</arg>
42+
<arg>--add-reads</arg>
43+
<arg>org.nasdanika.models.react=jdk.httpserver,java.net.http,java.xml</arg>
44+
</compilerArgs>
45+
</configuration>
46+
</execution>
47+
</executions>
48+
</plugin>
49+
<plugin>
50+
<groupId>org.apache.maven.plugins</groupId>
51+
<artifactId>maven-surefire-plugin</artifactId>
52+
<configuration>
53+
<argLine>--add-modules jdk.httpserver,java.net.http,java.xml --add-reads org.nasdanika.models.react=jdk.httpserver,java.net.http,java.xml</argLine>
54+
</configuration>
55+
</plugin>
2556
<!--
2657
BankTests generates a demo npm package into target/bank, and verifying
2758
it means running npm install there. node_modules defeats the clean

‎model/src/main/java/module-info.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
requires transitive org.eclipse.emf.ecore;
1111
requires transitive org.eclipse.emf.common;
1212
requires transitive org.nasdanika.models.typescript;
13+
requires java.net.http;
14+
requires jdk.httpserver;
1315

1416
provides CapabilityFactory with
1517
ReactEPackageResourceSetCapabilityFactory;

0 commit comments

Comments
 (0)