From 2936a789347afe47dbad368ef60849c23390c588 Mon Sep 17 00:00:00 2001 From: Wandemberg Gibaut Date: Mon, 13 Dec 2021 14:23:52 -0300 Subject: [PATCH] corrections on tests --- .../util/bindings/soar/SOARInspectorTest.java | 45 ++++++++++--------- .../soar/WorkingMemoryViewerTest.java | 42 ++++++++--------- 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/src/test/java/br/unicamp/cst/util/bindings/soar/SOARInspectorTest.java b/src/test/java/br/unicamp/cst/util/bindings/soar/SOARInspectorTest.java index 7544bca..adf9620 100644 --- a/src/test/java/br/unicamp/cst/util/bindings/soar/SOARInspectorTest.java +++ b/src/test/java/br/unicamp/cst/util/bindings/soar/SOARInspectorTest.java @@ -9,12 +9,31 @@ import org.junit.BeforeClass; import org.junit.Test; +import java.io.File; + /** * @author gudwin * */ public class SOARInspectorTest { - + + JSoarCodelet jSoarCodelet = new JSoarCodelet() { + @Override + public void accessMemoryObjects() { + + } + + @Override + public void calculateActivation() { + + } + + @Override + public void proc() { + getJsoar().step(); + } + }; + @BeforeClass public static void beforeAllTestMethods() { } @@ -28,8 +47,9 @@ public void testSOARInspector() throws InterruptedException { //String soarRulesPath="src/test/java/br/unicamp/cst/bindings/soar/smartCar.soar"; String soarRulesPath="src/test/resources/mac.soar"; - JSoarCodelet soarCodelet = new TestJSoarCodelet(soarRulesPath); - SOARInspector si = new SOARInspector(soarCodelet); + jSoarCodelet.initSoarPlugin("testAgent", new File(soarRulesPath), false); + //JSoarCodelet soarCodelet = new TestJSoarCodelet(soarRulesPath); + SOARInspector si = new SOARInspector(jSoarCodelet); si.setVisible(true); Thread.sleep(60000); @@ -37,23 +57,6 @@ public void testSOARInspector() throws InterruptedException { si.setVisible(false); } - private class TestJSoarCodelet extends JSoarCodelet { - public TestJSoarCodelet(String soarRulesPath) { - } - - @Override - public void accessMemoryObjects() { - - } - - @Override - public void calculateActivation() { - - } +} - @Override - public void proc() { - } - } -} diff --git a/src/test/java/br/unicamp/cst/util/bindings/soar/WorkingMemoryViewerTest.java b/src/test/java/br/unicamp/cst/util/bindings/soar/WorkingMemoryViewerTest.java index 1eb494d..9bbf1fc 100644 --- a/src/test/java/br/unicamp/cst/util/bindings/soar/WorkingMemoryViewerTest.java +++ b/src/test/java/br/unicamp/cst/util/bindings/soar/WorkingMemoryViewerTest.java @@ -7,29 +7,14 @@ import br.unicamp.cst.util.viewer.bindings.soar.WorkingMemoryViewer; import org.junit.Test; +import java.io.File; + /** * @author rgudwin * */ public class WorkingMemoryViewerTest { - - @Test - public void testWorkingMemoryViewer() throws InterruptedException { - String soarRulesPath = "src/test/java/br/unicamp/cst/bindings/soar/smartCar.soar"; - JSoarCodelet soarCodelet = new TestJSoarCodelet(soarRulesPath); - WorkingMemoryViewer ov = new WorkingMemoryViewer("Teste",soarCodelet); - ov.setVisible(true); - ov.updateTree(soarCodelet.getJsoar().getStates()); - - Thread.sleep(1000); - - ov.setVisible(false); - } - - private class TestJSoarCodelet extends JSoarCodelet { - public TestJSoarCodelet(String soarRulesPath) { - } - + JSoarCodelet jSoarCodelet = new JSoarCodelet() { @Override public void accessMemoryObjects() { @@ -42,7 +27,24 @@ public void calculateActivation() { @Override public void proc() { - + getJsoar().step(); } - } + }; + + + @Test + public void testWorkingMemoryViewer() throws InterruptedException { + String soarRulesPath = "src/test/java/br/unicamp/cst/bindings/soar/smartCar.soar"; + //JSoarCodelet soarCodelet = new TestJSoarCodelet(soarRulesPath); + jSoarCodelet.initSoarPlugin("testAgent", new File(soarRulesPath), false); + WorkingMemoryViewer ov = new WorkingMemoryViewer("Teste",jSoarCodelet); + ov.setVisible(true); + ov.updateTree(jSoarCodelet.getJsoar().getStates()); + + Thread.sleep(1000); + + ov.setVisible(false); + } + + }