package com.canoo.dolphin.server;

/**
 * Created by hendrikebbers on 30.03.15.
 */
public class TestPropertyChange {
}

@@ -32,89 +32,2236 @@
 r;%0A%0A
-/**%0A * Created by hendrikebbers on 30.03.15.%0A */%0Apublic class TestPropertyChange %7B
+import com.canoo.dolphin.mapping.ValueChangeEvent;%0Aimport com.canoo.dolphin.mapping.ValueChangeListener;%0Aimport com.canoo.dolphin.server.util.AbstractDolphinBasedTest;%0Aimport com.canoo.dolphin.server.util.SimpleTestModel;%0Aimport org.junit.Test;%0Aimport org.opendolphin.core.Attribute;%0Aimport org.opendolphin.core.server.ServerDolphin;%0Aimport org.opendolphin.core.server.ServerPresentationModel;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A/**%0A * Created by hendrikebbers on 30.03.15.%0A */%0Apublic class TestPropertyChange extends AbstractDolphinBasedTest %7B%0A%0A    private String newValue;%0A%0A    private String oldValue;%0A%0A    private boolean listenerCalled;%0A%0A    @Test%0A    public void testWithAnnotatedSimpleModel() %7B%0A        ServerDolphin dolphin = createServerDolphin();%0A        BeanManager manager = new BeanManager(dolphin);%0A%0A        final SimpleTestModel model = manager.create(SimpleTestModel.class);%0A%0A        ValueChangeListener%3CString%3E myListener = new ValueChangeListener%3CString%3E() %7B%0A            @Override%0A            public void valueChanged(ValueChangeEvent%3C? extends String%3E evt) %7B%0A                assertEquals(model.getTextProperty(), evt.getSource());%0A                newValue = evt.getNewValue();%0A                oldValue = evt.getOldValue();%0A                listenerCalled = true;%0A            %7D%0A        %7D;%0A%0A        model.getTextProperty().addValueListener(myListener);%0A        assertEquals(null, newValue);%0A        assertEquals(null, oldValue);%0A        assertEquals(false, listenerCalled);%0A%0A        model.getTextProperty().set(%22Hallo Property%22);%0A        assertEquals(%22Hallo Property%22, newValue);%0A        assertEquals(null, oldValue);%0A        assertEquals(true, listenerCalled);%0A%0A        listenerCalled = false;%0A        model.getTextProperty().set(%22Hallo Property2%22);%0A        assertEquals(%22Hallo Property2%22, newValue);%0A        assertEquals(%22Hallo Property%22, oldValue);%0A        assertEquals(true, listenerCalled);%0A%0A        listenerCalled = false;%0A        model.getTextProperty().removeValueListener(myListener);%0A        model.getTextProperty().set(%22Hallo Property3%22);%0A        assertEquals(%22Hallo Property2%22, newValue);%0A        assertEquals(%22Hallo Property%22, oldValue);%0A        assertEquals(false, listenerCalled);%0A    %7D
 %0A%7D%0A

Test für PropertyChanged