Search in sources :

Example 61 with Event

use of org.eclipse.bpmn2.Event in project requery by requery.

the class UpsertTest method testUpsertUpdate.

@Test
public void testUpsertUpdate() {
    Event event = new Event();
    UUID id = UUID.randomUUID();
    event.setId(id);
    event.setName("event1");
    data.insert(event);
    Event event2 = new Event();
    event2.setId(id);
    event2.setName("event2");
    data.upsert(event2);
    List<Event> events = data.select(Event.class).get().toList();
    assertTrue(events.size() == 1);
    assertEquals("event2", events.iterator().next().getName());
}
Also used : Event(io.requery.test.model3.Event) UUID(java.util.UUID) Test(org.junit.Test)

Example 62 with Event

use of org.eclipse.bpmn2.Event in project requery by requery.

the class UpsertTest method testUpsertOneToMany.

@Test
public void testUpsertOneToMany() {
    Event event = new Event();
    event.setId(UUID.randomUUID());
    Place place = new Place();
    place.setId(UUID.randomUUID().toString());
    place.setName("place");
    place.getEvents().add(event);
    data.upsert(place);
}
Also used : Event(io.requery.test.model3.Event) Place(io.requery.test.model3.Place) Test(org.junit.Test)

Example 63 with Event

use of org.eclipse.bpmn2.Event in project requery by requery.

the class UpsertTest method testUpsertInsertOneToMany.

@Test
public void testUpsertInsertOneToMany() {
    Event event = new Event();
    UUID id = UUID.randomUUID();
    event.setId(id);
    data.upsert(event);
    assertNotNull(event);
    Event event1 = new Event();
    event1.setId(id);
    Place place = new Place();
    place.setId(UUID.randomUUID().toString());
    place.setName("place");
    place.getEvents().add(event1);
    data.insert(place);
}
Also used : Event(io.requery.test.model3.Event) UUID(java.util.UUID) Place(io.requery.test.model3.Place) Test(org.junit.Test)

Example 64 with Event

use of org.eclipse.bpmn2.Event in project requery by requery.

the class UpsertTest method testUpsertOneToManyEmptyCollection.

@Test
public void testUpsertOneToManyEmptyCollection() {
    Event event1 = new Event();
    event1.setId(UUID.randomUUID());
    Place place = new Place();
    place.setId(UUID.randomUUID().toString());
    place.setName("place");
    place.getEvents().add(event1);
    place.getEvents().clear();
    data.upsert(place);
}
Also used : Event(io.requery.test.model3.Event) Place(io.requery.test.model3.Place) Test(org.junit.Test)

Aggregations

BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)28 Test (org.junit.Test)18 EventDefinition (org.eclipse.bpmn2.EventDefinition)15 CompensateEventDefinition (org.eclipse.bpmn2.CompensateEventDefinition)14 SignalEventDefinition (org.eclipse.bpmn2.SignalEventDefinition)14 ArrayList (java.util.ArrayList)13 List (java.util.List)13 ConditionalEventDefinition (org.eclipse.bpmn2.ConditionalEventDefinition)13 ErrorEventDefinition (org.eclipse.bpmn2.ErrorEventDefinition)13 EscalationEventDefinition (org.eclipse.bpmn2.EscalationEventDefinition)13 MessageEventDefinition (org.eclipse.bpmn2.MessageEventDefinition)13 ThrowEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)13 TimerEventDefinition (org.eclipse.bpmn2.TimerEventDefinition)12 Event (io.requery.test.model3.Event)9 UUID (java.util.UUID)9 EndEvent (org.eclipse.bpmn2.EndEvent)9 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)9 CatchEvent (org.eclipse.bpmn2.CatchEvent)8 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)8 MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)8