Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
The number of rules generated is the number that should be generated by
LTLMiner. But it is NOT the same number generated by TLQC as TLQC does
some sort of optimisation and generates a lot less rules.
  • Loading branch information
TKasekamp committed May 25, 2015
1 parent 1234c09 commit 7fb5a7e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/test/java/ee/tkasekamp/ltlminer/rulecreator/EventTypeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.Arrays;

import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -80,6 +81,19 @@ public void testRule2() {
parameters);
assertEquals(12, rules3.size());
}

@Test
public void testRule2RealLog() {
ArrayList<String> parameters = new ArrayList<>();
parameters.add("A");
parameters.add("B");
ArrayList<String> ev = new ArrayList<>(Arrays.asList("Awaiting Assignment","Assigned","Wait - Implementation","In Call","In Progress","Wait - User","Cancelled","Unmatched","Closed","Resolved","Wait","Wait - Customer","Wait - Vendor"));

ArrayList<String> rules = evCombiner.combine(rule2(), ev,
parameters);
assertEquals(156, rules.size());

}

@Test
public void testRule3() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ public void generateRule3() {
assertEquals("Number of combinations", 40, rules.size());
}

@Test
public void generateRule3RealLog() {
ArrayList<String> ac = new ArrayList<>(Arrays.asList("Unmatched",
"Completed", "Queued", "Accepted"));
ArrayList<String> ev = new ArrayList<>(Arrays.asList(
"Awaiting Assignment", "Assigned", "Wait - Implementation",
"In Call", "In Progress", "Wait - User", "Cancelled",
"Unmatched", "Closed", "Resolved", "Wait", "Wait - Customer",
"Wait - Vendor"));
ArrayList<String> rules = ruleCreator.generateRules(rule3(), ac, ev);
assertEquals("Number of combinations", 1872, rules.size());
}

@Test
public void generateWithReplacementRule1() {
HashMap<String, String[]> replacements = new HashMap<>();
Expand All @@ -119,7 +132,7 @@ public void generateWithReplacementRule1() {
@Test
public void generateWithBadReplacementRule1() {
HashMap<String, String[]> replacements = new HashMap<>();
replacements.put("A", new String[] { "C", "D", "A" , "stupidThing"});
replacements.put("A", new String[] { "C", "D", "A", "stupidThing" });
replacements.put("B", new String[] { "B" });

ArrayList<String> rules = ruleCreator.generateRules(rule1(),
Expand Down

0 comments on commit 7fb5a7e

Please sign in to comment.