Skip to content

Commit

Permalink
corrections on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wandemberg-eldorado committed Dec 13, 2021
1 parent f0c7c31 commit 2936a78
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}
Expand All @@ -28,32 +47,16 @@ 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);

si.setVisible(false);
}

private class TestJSoarCodelet extends JSoarCodelet {
public TestJSoarCodelet(String soarRulesPath) {
}

@Override
public void accessMemoryObjects() {

}

@Override
public void calculateActivation() {

}
}

@Override
public void proc() {

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand All @@ -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);
}


}

0 comments on commit 2936a78

Please sign in to comment.