diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-25 21:29:12 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-25 21:29:12 +0100 |
commit | 912bc8b903dfa6d438c2469ecdad35c181c71830 (patch) | |
tree | 1e6ee9fdcb2b9d488914b80623d68189867533bb /module/ri-engine/src/test/java | |
parent | 92b957036218c03a20ba35c19a70bdf5e2333fd3 (diff) | |
download | rules-sandbox-912bc8b903dfa6d438c2469ecdad35c181c71830.tar.gz rules-sandbox-912bc8b903dfa6d438c2469ecdad35c181c71830.tar.bz2 rules-sandbox-912bc8b903dfa6d438c2469ecdad35c181c71830.tar.xz rules-sandbox-912bc8b903dfa6d438c2469ecdad35c181c71830.zip |
Improving usability, massive refactoring.
* Moving all Drools code into their own modules. This fixes ri-engine
to acme dependency.
* Now they all inherit from their own parent, should be used by
third party code too.
* Separating acme planning code into its own module.
* Splitting rules code from ri-engine into ri-base. ri-engine is now
a pure launcher for modules.
* Dumping kogito for the most part, but it seems like the planner still
requires that.
Diffstat (limited to 'module/ri-engine/src/test/java')
-rw-r--r-- | module/ri-engine/src/test/java/io/trygvis/rules/network/Ipv4CidrTest.java | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/module/ri-engine/src/test/java/io/trygvis/rules/network/Ipv4CidrTest.java b/module/ri-engine/src/test/java/io/trygvis/rules/network/Ipv4CidrTest.java deleted file mode 100644 index 0d9f33e..0000000 --- a/module/ri-engine/src/test/java/io/trygvis/rules/network/Ipv4CidrTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.trygvis.rules.network; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; - -import static io.trygvis.rules.network.Ipv4Cidr.parseCidr; -import static org.junit.jupiter.api.Assertions.*; - -class Ipv4CidrTest { - - @Test - public void basic() { - assertThrows(IllegalArgumentException.class, () -> parseCidr("192.168.1.1/24").addresses()); - assertEquals(256, parseCidr("192.168.1.0/24").addresses().size()); - assertEquals(128, parseCidr("192.168.1.128/25").addresses().size()); - } - - @ParameterizedTest - @ValueSource(strings = { - "192.168.1.0/24", - "192.168.1.128/25", - }) - public void testParsing(String s) { - assertEquals(s, parseCidr(s).toString()); - } - - @Test - public void partition() { - var children = parseCidr("192.168.1.0/24").partition(26); - assertEquals(1 << 2, children.size()); - for (var cidr : children) { - assertEquals(26, cidr.bits); - } - } -} |