diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-26 21:06:24 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-26 21:06:24 +0100 |
commit | 0ae7ecd47fd76921e8e1137739497578fe703354 (patch) | |
tree | e06a9b45b5e1e7a8922cdba11b1a39188ddeeee2 /module/ri-engine/src/test/java/io | |
parent | 71010ae3fefbe897227343e44573385df9cd60cc (diff) | |
download | rules-sandbox-0ae7ecd47fd76921e8e1137739497578fe703354.tar.gz rules-sandbox-0ae7ecd47fd76921e8e1137739497578fe703354.tar.bz2 rules-sandbox-0ae7ecd47fd76921e8e1137739497578fe703354.tar.xz rules-sandbox-0ae7ecd47fd76921e8e1137739497578fe703354.zip |
Better main().
* Moving templates into their respective modules.
* Supporting export type-based filtering. Probably not perfect.
Diffstat (limited to 'module/ri-engine/src/test/java/io')
-rw-r--r-- | module/ri-engine/src/test/java/io/trygvis/rules/engine/AcmeAppsTestMain.java (renamed from module/ri-engine/src/test/java/io/trygvis/rules/engine/WireguardTestMain.java) | 8 | ||||
-rw-r--r-- | module/ri-engine/src/test/java/io/trygvis/rules/engine/AcmeWireguardTestMain.java | 27 |
2 files changed, 31 insertions, 4 deletions
diff --git a/module/ri-engine/src/test/java/io/trygvis/rules/engine/WireguardTestMain.java b/module/ri-engine/src/test/java/io/trygvis/rules/engine/AcmeAppsTestMain.java index 20aeffa..17b7950 100644 --- a/module/ri-engine/src/test/java/io/trygvis/rules/engine/WireguardTestMain.java +++ b/module/ri-engine/src/test/java/io/trygvis/rules/engine/AcmeAppsTestMain.java @@ -6,14 +6,14 @@ import java.io.File; import static org.junit.jupiter.api.Assertions.assertEquals; -class WireguardTestMain { +class AcmeAppsTestMain { public static void main(String[] args) throws Exception { var c = new RunCommand(); - c.name = "acme"; + c.name = "acme-apps"; c.input = new File("acme.yaml"); - c.outputState = new File("out/acme/wireguard.yaml"); + c.outputState = new File("out/acme/apps.yaml"); c.agendaGroups = new String[]{"init", "generate"}; - c.generatedOutput = new File("acme-wireguard"); + c.generatedOutput = new File("acme-apps"); assertEquals(0, c.call()); } } diff --git a/module/ri-engine/src/test/java/io/trygvis/rules/engine/AcmeWireguardTestMain.java b/module/ri-engine/src/test/java/io/trygvis/rules/engine/AcmeWireguardTestMain.java new file mode 100644 index 0000000..2bb5513 --- /dev/null +++ b/module/ri-engine/src/test/java/io/trygvis/rules/engine/AcmeWireguardTestMain.java @@ -0,0 +1,27 @@ +package io.trygvis.rules.engine; + +import io.trygvis.rules.engine.cli.RunCommand; + +import java.io.File; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class AcmeWireguardTestMain { + public static void main(String[] args) throws Exception { + var c = new RunCommand(); + c.name = "acme-wireguard"; + c.input = new File("acme.yaml"); + c.outputState = new File("out/acme/wireguard.yaml"); + c.agendaGroups = new String[]{"init", "generate"}; + c.generatedOutput = new File("acme-wireguard"); + c.includes = new String[]{ + "Wg*", + "Machine", + "DnsEntry", + "Ipv4Cidr", + "Ipv4Address", + }; + + assertEquals(0, c.call()); + } +} |