dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28536
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14255: minor rename in EventService
------------------------------------------------------------
revno: 14255
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-03-17 14:44:19 +0100
message:
minor rename in EventService
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/EventService.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/ImportEventTask.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/NoRegistrationSingleEventServiceTest.java
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventController.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java 2014-03-17 08:22:01 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java 2014-03-17 13:44:19 +0000
@@ -124,14 +124,14 @@
@Override
@Transactional
- public ImportSummary saveEvent( Event event )
+ public ImportSummary addEvent( Event event )
{
- return saveEvent( event, null );
+ return addEvent( event, null );
}
@Override
@Transactional
- public ImportSummary saveEvent( Event event, ImportOptions importOptions )
+ public ImportSummary addEvent( Event event, ImportOptions importOptions )
{
Program program = programService.getProgram( event.getProgram() );
ProgramInstance programInstance;
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/EventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/EventService.java 2014-03-17 08:22:01 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/EventService.java 2014-03-17 13:44:19 +0000
@@ -84,29 +84,29 @@
// CREATE
// -------------------------------------------------------------------------
- ImportSummary saveEvent( Event event );
-
- ImportSummary saveEvent( Event event, ImportOptions importOptions );
-
- ImportSummary saveEventXml( InputStream inputStream ) throws IOException;
-
- ImportSummary saveEventXml( InputStream inputStream, ImportOptions importOptions ) throws IOException;
-
- ImportSummaries saveEventsXml( InputStream inputStream ) throws IOException;
-
- ImportSummaries saveEventsXml( InputStream inputStream, ImportOptions importOptions ) throws IOException;
-
- ImportSummaries saveEventsXml( InputStream inputStream, TaskId taskId, ImportOptions importOptions ) throws IOException;
-
- ImportSummary saveEventJson( InputStream inputStream ) throws IOException;
-
- ImportSummary saveEventJson( InputStream inputStream, ImportOptions importOptions ) throws IOException;
-
- ImportSummaries saveEventsJson( InputStream inputStream ) throws IOException;
-
- ImportSummaries saveEventsJson( InputStream inputStream, ImportOptions importOptions ) throws IOException;
-
- ImportSummaries saveEventsJson( InputStream inputStream, TaskId taskId, ImportOptions importOptions ) throws IOException;
+ ImportSummary addEvent( Event event );
+
+ ImportSummary addEvent( Event event, ImportOptions importOptions );
+
+ ImportSummary addEventXml( InputStream inputStream ) throws IOException;
+
+ ImportSummary addEventXml( InputStream inputStream, ImportOptions importOptions ) throws IOException;
+
+ ImportSummaries addEventsXml( InputStream inputStream ) throws IOException;
+
+ ImportSummaries addEventsXml( InputStream inputStream, ImportOptions importOptions ) throws IOException;
+
+ ImportSummaries addEventsXml( InputStream inputStream, TaskId taskId, ImportOptions importOptions ) throws IOException;
+
+ ImportSummary addEventJson( InputStream inputStream ) throws IOException;
+
+ ImportSummary addEventJson( InputStream inputStream, ImportOptions importOptions ) throws IOException;
+
+ ImportSummaries addEventsJson( InputStream inputStream ) throws IOException;
+
+ ImportSummaries addEventsJson( InputStream inputStream, ImportOptions importOptions ) throws IOException;
+
+ ImportSummaries addEventsJson( InputStream inputStream, TaskId taskId, ImportOptions importOptions ) throws IOException;
// -------------------------------------------------------------------------
// UPDATE
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/ImportEventTask.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/ImportEventTask.java 2013-09-17 12:15:39 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/ImportEventTask.java 2014-03-17 13:44:19 +0000
@@ -73,7 +73,7 @@
{
try
{
- eventService.saveEventsJson( inputStream, taskId, importOptions );
+ eventService.addEventsJson( inputStream, taskId, importOptions );
}
catch ( IOException ignored )
{
@@ -83,7 +83,7 @@
{
try
{
- eventService.saveEventsXml( inputStream, taskId, importOptions );
+ eventService.addEventsXml( inputStream, taskId, importOptions );
}
catch ( IOException ignored )
{
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java 2013-11-19 10:03:05 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/JacksonEventService.java 2014-03-17 13:44:19 +0000
@@ -99,19 +99,19 @@
}
@Override
- public ImportSummaries saveEventsXml( InputStream inputStream ) throws IOException
- {
- return saveEventsXml( inputStream, null, null );
- }
-
- @Override
- public ImportSummaries saveEventsXml( InputStream inputStream, ImportOptions importOptions ) throws IOException
- {
- return saveEventsXml( inputStream, null, importOptions );
- }
-
- @Override
- public ImportSummaries saveEventsXml( InputStream inputStream, TaskId taskId, ImportOptions importOptions ) throws IOException
+ public ImportSummaries addEventsXml( InputStream inputStream ) throws IOException
+ {
+ return addEventsXml( inputStream, null, null );
+ }
+
+ @Override
+ public ImportSummaries addEventsXml( InputStream inputStream, ImportOptions importOptions ) throws IOException
+ {
+ return addEventsXml( inputStream, null, importOptions );
+ }
+
+ @Override
+ public ImportSummaries addEventsXml( InputStream inputStream, TaskId taskId, ImportOptions importOptions ) throws IOException
{
ImportSummaries importSummaries = new ImportSummaries();
@@ -125,13 +125,13 @@
for ( Event event : events.getEvents() )
{
- importSummaries.addImportSummary( saveEvent( event, importOptions ) );
+ importSummaries.addImportSummary( addEvent( event, importOptions ) );
}
}
catch ( Exception ex )
{
Event event = fromXml( input, Event.class );
- importSummaries.addImportSummary( saveEvent( event, importOptions ) );
+ importSummaries.addImportSummary( addEvent( event, importOptions ) );
}
notifier.notify( taskId, NotificationLevel.INFO, "Import done", true ).
@@ -141,32 +141,32 @@
}
@Override
- public ImportSummary saveEventXml( InputStream inputStream ) throws IOException
+ public ImportSummary addEventXml( InputStream inputStream ) throws IOException
{
- return saveEventXml( inputStream, null );
+ return addEventXml( inputStream, null );
}
@Override
- public ImportSummary saveEventXml( InputStream inputStream, ImportOptions importOptions ) throws IOException
+ public ImportSummary addEventXml( InputStream inputStream, ImportOptions importOptions ) throws IOException
{
Event event = fromXml( inputStream, Event.class );
- return saveEvent( event, importOptions );
- }
-
- @Override
- public ImportSummaries saveEventsJson( InputStream inputStream ) throws IOException
- {
- return saveEventsJson( inputStream, null, null );
- }
-
- @Override
- public ImportSummaries saveEventsJson( InputStream inputStream, ImportOptions importOptions ) throws IOException
- {
- return saveEventsJson( inputStream, null, importOptions );
- }
-
- @Override
- public ImportSummaries saveEventsJson( InputStream inputStream, TaskId taskId, ImportOptions importOptions ) throws IOException
+ return addEvent( event, importOptions );
+ }
+
+ @Override
+ public ImportSummaries addEventsJson( InputStream inputStream ) throws IOException
+ {
+ return addEventsJson( inputStream, null, null );
+ }
+
+ @Override
+ public ImportSummaries addEventsJson( InputStream inputStream, ImportOptions importOptions ) throws IOException
+ {
+ return addEventsJson( inputStream, null, importOptions );
+ }
+
+ @Override
+ public ImportSummaries addEventsJson( InputStream inputStream, TaskId taskId, ImportOptions importOptions ) throws IOException
{
ImportSummaries importSummaries = new ImportSummaries();
@@ -180,13 +180,13 @@
for ( Event event : events.getEvents() )
{
- importSummaries.addImportSummary( saveEvent( event, importOptions ) );
+ importSummaries.addImportSummary( addEvent( event, importOptions ) );
}
}
catch ( Exception ex )
{
Event event = fromJson( input, Event.class );
- importSummaries.addImportSummary( saveEvent( event, importOptions ) );
+ importSummaries.addImportSummary( addEvent( event, importOptions ) );
}
notifier.notify( taskId, NotificationLevel.INFO, "Import done", true ).
@@ -196,15 +196,15 @@
}
@Override
- public ImportSummary saveEventJson( InputStream inputStream ) throws IOException
+ public ImportSummary addEventJson( InputStream inputStream ) throws IOException
{
- return saveEventJson( inputStream, null );
+ return addEventJson( inputStream, null );
}
@Override
- public ImportSummary saveEventJson( InputStream inputStream, ImportOptions importOptions ) throws IOException
+ public ImportSummary addEventJson( InputStream inputStream, ImportOptions importOptions ) throws IOException
{
Event event = fromJson( inputStream, Event.class );
- return saveEvent( event, importOptions );
+ return addEvent( event, importOptions );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/NoRegistrationSingleEventServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/NoRegistrationSingleEventServiceTest.java 2014-02-20 10:21:30 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/NoRegistrationSingleEventServiceTest.java 2014-03-17 13:44:19 +0000
@@ -136,7 +136,7 @@
{
Event event = createEvent( programA.getUid(), organisationUnitA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertNotNull( importSummary.getReference() );
}
@@ -151,7 +151,7 @@
{
Event event = createEvent( programA.getUid(), organisationUnitA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertNotNull( importSummary.getReference() );
}
@@ -166,7 +166,7 @@
{
Event event = createEvent( programA.getUid(), organisationUnitA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertNotNull( importSummary.getReference() );
}
@@ -179,7 +179,7 @@
{
Event event = createEvent( programA.getUid(), organisationUnitA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertNotNull( importSummary.getReference() );
@@ -194,7 +194,7 @@
{
Event event = createEvent( programA.getUid(), organisationUnitA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertNotNull( importSummary.getReference() );
@@ -205,7 +205,7 @@
public void testSaveEvent()
{
Event event = createEvent( programA.getUid(), organisationUnitA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertEquals( 0, importSummary.getConflicts().size() );
assertNotNull( importSummary.getReference() );
@@ -220,7 +220,7 @@
{
Event event = createEvent( programA.getUid(), organisationUnitA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertNotNull( importSummary.getReference() );
@@ -239,7 +239,7 @@
{
Event event = createEvent( programA.getUid(), organisationUnitA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertNotNull( importSummary.getReference() );
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java 2014-03-17 08:22:01 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java 2014-03-17 13:44:19 +0000
@@ -178,7 +178,7 @@
{
Event event = createEvent( programA.getUid(), null, organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance(),
dataElementA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.ERROR, importSummary.getStatus() );
assertThat( importSummary.getDescription(),
CoreMatchers.containsString( "Event.programStage does not point to a valid programStage" ) );
@@ -189,7 +189,7 @@
{
Event event = createEvent( programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(),
trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementA.getUid() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.ERROR, importSummary.getStatus() );
assertThat( importSummary.getDescription(), CoreMatchers.containsString( "is not enrolled in program" ) );
}
@@ -203,17 +203,17 @@
Event event = createEvent( programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(),
trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementA.getUid() );
- importSummary = eventService.saveEvent( event );
- assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
-
- event = createEvent( programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(),
- trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementA.getUid() );
- importSummary = eventService.saveEvent( event );
- assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
-
- event = createEvent( programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(),
- trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementA.getUid() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
+ assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
+
+ event = createEvent( programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(),
+ trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementA.getUid() );
+ importSummary = eventService.addEvent( event );
+ assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
+
+ event = createEvent( programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(),
+ trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementA.getUid() );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertEquals( 1, eventService.getEvents( programA, programStageA, organisationUnitA ).getEvents().size() );
@@ -228,19 +228,19 @@
Event event = createEvent( programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(),
trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementA.getUid() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
event = createEvent( programA.getUid(), programStageB.getUid(), organisationUnitA.getUid(),
trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementB.getUid() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertEquals( 2, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
event = createEvent( programA.getUid(), programStageB.getUid(), organisationUnitA.getUid(),
trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementB.getUid() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertEquals( 3, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
@@ -255,12 +255,12 @@
Event event = createEvent( programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(),
trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementA.getUid() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
event = createEvent( programA.getUid(), programStageB.getUid(), organisationUnitA.getUid(),
trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementB.getUid() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertEquals( 2, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
@@ -268,14 +268,14 @@
event = createEvent( programA.getUid(), programStageB.getUid(), organisationUnitA.getUid(),
trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementB.getUid() );
event.setEvent( importSummary.getReference() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertEquals( 2, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
event = createEvent( programA.getUid(), programStageA.getUid(), organisationUnitA.getUid(),
trackedEntityInstanceMaleA.getTrackedEntityInstance(), dataElementA.getUid() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertEquals( 2, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java 2014-03-17 08:22:01 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java 2014-03-17 13:44:19 +0000
@@ -147,7 +147,7 @@
public void testSaveWithoutEnrollmentShouldFail()
{
Event event = createEvent( programA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance() );
- ImportSummary importSummary = eventService.saveEvent( event );
+ ImportSummary importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.ERROR, importSummary.getStatus() );
assertThat( importSummary.getDescription(), CoreMatchers.containsString( "is not enrolled in program" ) );
}
@@ -160,7 +160,7 @@
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
Event event = createEvent( programA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
}
@@ -172,19 +172,19 @@
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
Event event = createEvent( programA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance() );
- importSummary = eventService.saveEvent( event );
- assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
-
- assertEquals( 1, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
-
- event = createEvent( programA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance() );
- importSummary = eventService.saveEvent( event );
- assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
-
- assertEquals( 1, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
-
- event = createEvent( programA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance() );
- importSummary = eventService.saveEvent( event );
+ importSummary = eventService.addEvent( event );
+ assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
+
+ assertEquals( 1, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
+
+ event = createEvent( programA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance() );
+ importSummary = eventService.addEvent( event );
+ assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
+
+ assertEquals( 1, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
+
+ event = createEvent( programA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance() );
+ importSummary = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary.getStatus() );
assertEquals( 1, eventService.getEvents( programA, organisationUnitA ).getEvents().size() );
@@ -198,7 +198,7 @@
Event event = createEvent( programA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance() );
event.setStatus( EventStatus.COMPLETED );
- ImportSummary importSummary1 = eventService.saveEvent( event );
+ ImportSummary importSummary1 = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary1.getStatus() );
enrollment = enrollmentService.getEnrollments( trackedEntityInstanceMaleA ).getEnrollments().get( 0 );
enrollmentService.completeEnrollment( enrollment );
@@ -208,7 +208,7 @@
event = createEvent( programA.getUid(), organisationUnitA.getUid(), trackedEntityInstanceMaleA.getTrackedEntityInstance() );
event.setStatus( EventStatus.COMPLETED );
- ImportSummary importSummary2 = eventService.saveEvent( event );
+ ImportSummary importSummary2 = eventService.addEvent( event );
assertEquals( ImportStatus.SUCCESS, importSummary2.getStatus() );
enrollment = enrollmentService.getEnrollments( trackedEntityInstanceMaleA ).getEnrollments().get( 0 );
enrollmentService.completeEnrollment( enrollment );
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventController.java 2014-03-17 08:22:01 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventController.java 2014-03-17 13:44:19 +0000
@@ -239,7 +239,7 @@
if ( !importOptions.isAsync() )
{
- ImportSummaries importSummaries = eventService.saveEventsXml( inputStream, importOptions );
+ ImportSummaries importSummaries = eventService.addEventsXml( inputStream, importOptions );
for ( ImportSummary importSummary : importSummaries.getImportSummaries() )
{
@@ -284,7 +284,7 @@
if ( !importOptions.isAsync() )
{
- ImportSummaries importSummaries = eventService.saveEventsJson( inputStream, importOptions );
+ ImportSummaries importSummaries = eventService.addEventsJson( inputStream, importOptions );
for ( ImportSummary importSummary : importSummaries.getImportSummaries() )
{