Search in sources :

Example 1 with Task

use of net.geoprism.registry.task.Task in project geoprism-registry by terraframe.

the class TransitionEventTest method testUpdateTransition.

@Test
@Request
public void testUpdateTransition() {
    TransitionEvent event = new TransitionEvent();
    try {
        LocalizedValueConverter.populate(event, TransitionEvent.DESCRIPTION, new LocalizedValue("Test"));
        event.setEventDate(FastTestDataset.DEFAULT_OVER_TIME_DATE);
        event.setBeforeTypeCode(FastTestDataset.COUNTRY.getCode());
        event.setBeforeTypeOrgCode(FastTestDataset.COUNTRY.getOrganization().getCode());
        event.setAfterTypeCode(FastTestDataset.PROVINCE.getCode());
        event.setAfterTypeOrgCode(FastTestDataset.PROVINCE.getOrganization().getCode());
        event.apply();
        Transition transition = event.addTransition(FastTestDataset.CAMBODIA.getServerObject(), FastTestDataset.PROV_CENTRAL.getServerObject(), TransitionType.REASSIGN, TransitionImpact.FULL);
        transition.apply(event, transition.getOrder(), (VertexServerGeoObject) FastTestDataset.CAMBODIA.getServerObject(), (VertexServerGeoObject) FastTestDataset.PROV_WESTERN.getServerObject());
        List<Task> tasks = Task.getTasks(transition.getOid());
        Assert.assertEquals(6, tasks.size());
    } finally {
        event.delete();
    }
}
Also used : Task(net.geoprism.registry.task.Task) LocalizedValue(org.commongeoregistry.adapter.dataaccess.LocalizedValue) TransitionEvent(net.geoprism.registry.graph.transition.TransitionEvent) Transition(net.geoprism.registry.graph.transition.Transition) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Aggregations

Request (com.runwaysdk.session.Request)1 Transition (net.geoprism.registry.graph.transition.Transition)1 TransitionEvent (net.geoprism.registry.graph.transition.TransitionEvent)1 Task (net.geoprism.registry.task.Task)1 LocalizedValue (org.commongeoregistry.adapter.dataaccess.LocalizedValue)1 Test (org.junit.Test)1