Search in sources :

Example 11 with ObservableArrayList

use of com.canoo.dp.impl.remoting.collections.ObservableArrayList in project dolphin-platform by canoo.

the class FXBinderTest method testConvertedListBinding.

@Test
public void testConvertedListBinding() {
    ObservableList<Boolean> dolphinList = new ObservableArrayList<>();
    javafx.collections.ObservableList<String> javaFXList = FXCollections.observableArrayList();
    Binding binding = FXBinder.bind(javaFXList).to(dolphinList, value -> value.toString());
    dolphinList.add(true);
    assertEquals(dolphinList.size(), 1);
    assertEquals(javaFXList.size(), 1);
    assertEquals(javaFXList.get(0), "true");
}
Also used : Binding(com.canoo.platform.core.functional.Binding) ObservableArrayList(com.canoo.dp.impl.remoting.collections.ObservableArrayList) Test(org.testng.annotations.Test)

Aggregations

ObservableArrayList (com.canoo.dp.impl.remoting.collections.ObservableArrayList)11 Test (org.testng.annotations.Test)11 Binding (com.canoo.platform.core.functional.Binding)6 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 Subscription (com.canoo.platform.core.functional.Subscription)2