Search in sources :

Example 1 with ObserverObjectTest

use of com.twosigma.beakerx.jvm.ObserverObjectTest in project beakerx by twosigma.

the class SimpleEvaluationObjectTest method setUp.

@Before
public void setUp() throws Exception {
    seo = new SimpleEvaluationObject("code");
    observer = new ObserverObjectTest();
    seo.addObserver(observer);
    kernel = new KernelTest();
    KernelManager.register(kernel);
}
Also used : ObserverObjectTest(com.twosigma.beakerx.jvm.ObserverObjectTest) KernelTest(com.twosigma.beakerx.KernelTest) Before(org.junit.Before)

Example 2 with ObserverObjectTest

use of com.twosigma.beakerx.jvm.ObserverObjectTest in project beakerx by twosigma.

the class BeakerDashboardTest method redraw_shouldUpdateObservers.

@Test
public void redraw_shouldUpdateObservers() throws Exception {
    // given
    ObserverObjectTest observer = new ObserverObjectTest();
    dashboard.addObserver(observer);
    // when
    dashboard.redraw();
    // then
    Assertions.assertThat(observer.getObjectList()).isNotEmpty();
    Assertions.assertThat(observer.getObjectList().get(0)).isEqualTo(dashboard);
}
Also used : ObserverObjectTest(com.twosigma.beakerx.jvm.ObserverObjectTest) ObserverObjectTest(com.twosigma.beakerx.jvm.ObserverObjectTest) Test(org.junit.Test)

Example 3 with ObserverObjectTest

use of com.twosigma.beakerx.jvm.ObserverObjectTest in project beakerx by twosigma.

the class UpdatableEvaluationResultTest method setValue_shouldNotifyObserver.

@Test
public void setValue_shouldNotifyObserver() throws Exception {
    // given
    UpdatableEvaluationResult result = new UpdatableEvaluationResult("test");
    ObserverObjectTest observer = new ObserverObjectTest();
    result.addObserver(observer);
    // when
    result.setValue("test");
    // then
    Assertions.assertThat(observer.getObjectList().get(0)).isEqualTo(result);
}
Also used : ObserverObjectTest(com.twosigma.beakerx.jvm.ObserverObjectTest) ObserverObjectTest(com.twosigma.beakerx.jvm.ObserverObjectTest) Test(org.junit.Test)

Aggregations

ObserverObjectTest (com.twosigma.beakerx.jvm.ObserverObjectTest)3 Test (org.junit.Test)2 KernelTest (com.twosigma.beakerx.KernelTest)1 Before (org.junit.Before)1