summaryrefslogtreecommitdiff
path: root/examples/09-list/output/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-08-10 10:19:49 +0100
committerMichael Williamson <mike@zwobble.org>2026-08-10 10:19:49 +0100
commit5113f2157c5aa257ad7ebf555cb6a551701d169a (patch)
tree8ddaee09f6c43b0529b2203f9e662a028fb5fcc0 /examples/09-list/output/java
parent5d41166750e0f05da436bf30c7a642749f7a71c5 (diff)
Add generic struct example without any outputs
Diffstat (limited to 'examples/09-list/output/java')
-rw-r--r--examples/09-list/output/java/.gitignore2
l---------examples/09-list/output/java/pom.xml1
-rw-r--r--examples/09-list/output/java/src/test/java/org/zwobble/example/PointTests.java32
3 files changed, 35 insertions, 0 deletions
diff --git a/examples/09-list/output/java/.gitignore b/examples/09-list/output/java/.gitignore
new file mode 100644
index 0000000..ff511d4
--- /dev/null
+++ b/examples/09-list/output/java/.gitignore
@@ -0,0 +1,2 @@
+/src/gen/
+/target/
diff --git a/examples/09-list/output/java/pom.xml b/examples/09-list/output/java/pom.xml
new file mode 120000
index 0000000..445fa65
--- /dev/null
+++ b/examples/09-list/output/java/pom.xml
@@ -0,0 +1 @@
+../../../templates/java-junit/pom.xml \ No newline at end of file
diff --git a/examples/09-list/output/java/src/test/java/org/zwobble/example/PointTests.java b/examples/09-list/output/java/src/test/java/org/zwobble/example/PointTests.java
new file mode 100644
index 0000000..e1528b5
--- /dev/null
+++ b/examples/09-list/output/java/src/test/java/org/zwobble/example/PointTests.java
@@ -0,0 +1,32 @@
+package org.zwobble.example;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Test;
+import java.util.List;
+import org.zwobble.example.types.point.Path;
+import org.zwobble.example.types.point.Point;
+
+public class PointTests {
+ @Test
+ public void canCreatePathWithConstructor() {
+ Path path = new Path(List.of(
+ new Point(10, 25),
+ new Point(25, 10)
+ ));
+
+ assertEquals(path.points().size(), 2);
+ }
+
+ @Test
+ public void canCreatePathWithBuilder() {
+ Path path = Path.arbitrary()
+ .addPoint(new Point(10, 25))
+ .addPoint(new Point(25, 10))
+ .build();
+
+ assertEquals(path, new Path(List.of(
+ new Point(10, 25),
+ new Point(25, 10)
+ )));
+ }
+}