-
Notifications
You must be signed in to change notification settings - Fork 188
/
TestThresholdsLiveSyncSimulate.java
79 lines (62 loc) · 3.1 KB
/
TestThresholdsLiveSyncSimulate.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Copyright (c) 2010-2018 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.testing.story;
import static org.testng.Assert.assertEquals;
import java.io.File;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationInformationType;
/**
* @author katka
*/
@ContextConfiguration(locations = { "classpath:ctx-story-test-main.xml" })
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public class TestThresholdsLiveSyncSimulate extends TestThresholds {
private static final File TASK_LIVESYNC_OPENDJ_SIMULATE_FILE = new File(TEST_DIR, "task-opendj-livesync-simulate.xml");
private static final String TASK_LIVESYNC_OPENDJ_SIMULATE_OID = "10335c7c-838f-11e8-93a6-4b1dd0ab58e4";
@Override
protected File getTaskFile() {
return TASK_LIVESYNC_OPENDJ_SIMULATE_FILE;
}
@Override
protected String getTaskOid() {
return TASK_LIVESYNC_OPENDJ_SIMULATE_OID;
}
@Override
protected int getProcessedUsers() {
return 0;
}
@Override
protected void assertSynchronizationStatisticsAfterImport(Task taskAfter) throws Exception {
SynchronizationInformationType syncInfo = taskAfter.getStoredOperationStats().getSynchronizationInformation();
assertSyncToken(taskAfter, 4, taskAfter.getResult());
assertEquals(syncInfo.getCountUnmatchedAfter(), 0);
assertEquals(syncInfo.getCountDeletedAfter(), 0);
assertEquals(syncInfo.getCountLinkedAfter(), 0);
assertEquals(syncInfo.getCountUnlinkedAfter(), 0);
}
protected void assertSynchronizationStatisticsActivation(Task taskAfter) {
assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnmatched(), 3);
assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountDeleted(), 0);
assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountLinked(), 0);
assertEquals(taskAfter.getStoredOperationStats().getSynchronizationInformation().getCountUnlinked(), 0);
}
/* (non-Javadoc)
* @see com.evolveum.midpoint.testing.story.TestThresholds#assertSynchronizationStatisticsAfterSecondImport(com.evolveum.midpoint.task.api.Task)
*/
@Override
protected void assertSynchronizationStatisticsAfterSecondImport(Task taskAfter) throws Exception {
SynchronizationInformationType syncInfo = taskAfter.getStoredOperationStats().getSynchronizationInformation();
assertSyncToken(taskAfter, 4, taskAfter.getResult());
assertEquals(syncInfo.getCountUnmatchedAfter(), 0);
assertEquals(syncInfo.getCountDeletedAfter(), 0);
assertEquals(syncInfo.getCountLinkedAfter(), 0);
assertEquals(syncInfo.getCountUnlinkedAfter(), 0);
}
}