Search in sources :

Example 1 with SchedulerImpl

use of com.google.gwt.core.client.impl.SchedulerImpl in project opennms by OpenNMS.

the class SearchStateTest method setUpClass.

@BeforeClass
public static void setUpClass() throws Exception {
    GWTMockUtilities.disarm();
    final SchedulerImpl scheduler = new TestSchedulerImpl();
    Whitebox.setInternalState(SchedulerImpl.class, "INSTANCE", scheduler);
}
Also used : SchedulerImpl(com.google.gwt.core.client.impl.SchedulerImpl) BeforeClass(org.junit.BeforeClass)

Example 2 with SchedulerImpl

use of com.google.gwt.core.client.impl.SchedulerImpl in project flow by vaadin.

the class GwtPolymerModelTest method testInitialUpdateModelProperty_propertyIsUpdatableAndSchedulerIsNotExecuted_propertyIsNotSync.

public void testInitialUpdateModelProperty_propertyIsUpdatableAndSchedulerIsNotExecuted_propertyIsNotSync() {
    addMockMethods(element);
    String propertyName = "black";
    String propertyValue = "coffee";
    setModelProperty(node, propertyName, propertyValue);
    initScheduler(new SchedulerImpl() {

        @Override
        public void scheduleDeferred(ScheduledCommand cmd) {
        }
    });
    node.setNodeData(new UpdatableModelProperties(JsCollections.array("black")));
    Binder.bind(node, element);
    Reactive.flush();
    assertEquals("Expected to have property with name " + propertyName + " defined after initial binding", propertyValue, WidgetUtil.getJsProperty(element, propertyName));
    String newPropertyValue = "bubblegum";
    emulatePolymerPropertyChange(element, propertyName, newPropertyValue);
    Reactive.flush();
    assertEquals("Expected to have property with name " + propertyName + " updated from client side", propertyValue, WidgetUtil.getJsProperty(element, propertyName));
    MapProperty property = node.getMap(NodeFeatures.ELEMENT_PROPERTIES).getProperty(propertyName);
    assertEquals(propertyValue, property.getValue());
    assertFalse(tree.synchronizedProperties.has(node));
}
Also used : SchedulerImpl(com.google.gwt.core.client.impl.SchedulerImpl) UpdatableModelProperties(com.vaadin.client.flow.model.UpdatableModelProperties) MapProperty(com.vaadin.client.flow.nodefeature.MapProperty)

Example 3 with SchedulerImpl

use of com.google.gwt.core.client.impl.SchedulerImpl in project flow by vaadin.

the class GwtDomApiTest method initTest.

private void initTest() {
    DomApi.polymerMicroLoaded = false;
    DomApi.impl = node -> (DomElement) node;
    initScheduler(new SchedulerImpl() {

        @Override
        public void scheduleDeferred(ScheduledCommand cmd) {
        }
    });
    GwtPolymerApiImplTest.clearPolymer();
    verifyPolymerDomApiUsed(false);
    verifyPolymerMicroLoaded(false);
}
Also used : SchedulerImpl(com.google.gwt.core.client.impl.SchedulerImpl)

Aggregations

SchedulerImpl (com.google.gwt.core.client.impl.SchedulerImpl)3 UpdatableModelProperties (com.vaadin.client.flow.model.UpdatableModelProperties)1 MapProperty (com.vaadin.client.flow.nodefeature.MapProperty)1 BeforeClass (org.junit.BeforeClass)1