use of org.apache.cayenne.map.event.MapEvent in project cayenne by apache.
the class DataNodeEventTest method testNoNameChange.
@Test
public void testNoNameChange() throws Exception {
MapEvent event = new DataNodeEvent(new Object(), new DataNodeDescriptor("someName"));
assertFalse(event.isNameChange());
event.setOldName("someOldName");
assertTrue(event.isNameChange());
}
use of org.apache.cayenne.map.event.MapEvent in project cayenne by apache.
the class DataNodeEventTest method testNewName.
@Test
public void testNewName() throws Exception {
MapEvent event = new DataNodeEvent(new Object(), new DataNodeDescriptor("someName"));
assertEquals("someName", event.getNewName());
}
use of org.apache.cayenne.map.event.MapEvent in project cayenne by apache.
the class DataNodeEventTest method testNameChange.
@Test
public void testNameChange() throws Exception {
MapEvent event = new DataNodeEvent(new Object(), new DataNodeDescriptor("someName"), "someOldName");
assertEquals("someName", event.getNewName());
assertTrue(event.isNameChange());
}
use of org.apache.cayenne.map.event.MapEvent in project cayenne by apache.
the class ModelerEventTest method testConstructor1.
@Test
public void testConstructor1() throws Exception {
Object src = new Object();
MapEvent e = new TestMapEvent(src);
assertSame(src, e.getSource());
}
use of org.apache.cayenne.map.event.MapEvent in project cayenne by apache.
the class ModelerEventTest method testId.
@Test
public void testId() throws Exception {
MapEvent e = new TestMapEvent(new Object());
assertEquals(MapEvent.CHANGE, e.getId());
e.setId(MapEvent.ADD);
assertEquals(MapEvent.ADD, e.getId());
}
Aggregations