Search in sources :

Example 1 with Service

use of jcog.Service in project narchy by automenta.

the class NARServiceTest method testRemoveDurServiceWhenOff.

@Test
public void testRemoveDurServiceWhenOff() {
    NAR n = NARS.shell();
    Set<Service<NAR>> before = n.services.stream().collect(toSet());
    DurService d = DurService.on(n, () -> {
    // nothing
    });
    n.synch();
    Set<Service<NAR>> during = n.services.stream().collect(toSet());
    d.off();
    n.synch();
    Set<Service<NAR>> after = n.services.stream().collect(toSet());
    assertEquals(before, after);
    assertEquals(before.size() + 1, during.size());
}
Also used : Service(jcog.Service) NAR(nars.NAR) Test(org.junit.jupiter.api.Test)

Aggregations

Service (jcog.Service)1 NAR (nars.NAR)1 Test (org.junit.jupiter.api.Test)1