|
16 | 16 | // under the License. |
17 | 17 | package com.cloud.storage.snapshot; |
18 | 18 |
|
| 19 | +import static org.mockito.Matchers.any; |
| 20 | +import static org.mockito.Matchers.anyLong; |
| 21 | +import static org.mockito.Mockito.doNothing; |
| 22 | +import static org.mockito.Mockito.mock; |
| 23 | +import static org.mockito.Mockito.when; |
| 24 | + |
| 25 | +import java.util.List; |
| 26 | +import java.util.UUID; |
| 27 | + |
| 28 | +import org.apache.cloudstack.acl.ControlledEntity; |
| 29 | +import org.apache.cloudstack.acl.SecurityChecker.AccessType; |
| 30 | +import org.apache.cloudstack.context.CallContext; |
| 31 | +import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; |
| 32 | +import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory; |
| 33 | +import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; |
| 34 | +import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotStrategy; |
| 35 | +import org.apache.cloudstack.engine.subsystem.api.storage.StorageStrategyFactory; |
| 36 | +import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory; |
| 37 | +import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; |
| 38 | +import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotStrategy.SnapshotOperation; |
| 39 | +import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; |
| 40 | +import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; |
| 41 | +import org.junit.After; |
| 42 | +import org.junit.Assert; |
| 43 | +import org.junit.Before; |
| 44 | +import org.junit.Test; |
| 45 | +import org.mockito.Mock; |
| 46 | +import org.mockito.Mockito; |
| 47 | +import org.mockito.MockitoAnnotations; |
| 48 | +import org.mockito.Spy; |
| 49 | + |
19 | 50 | import com.cloud.configuration.Resource.ResourceType; |
20 | 51 | import com.cloud.exception.InvalidParameterValueException; |
21 | 52 | import com.cloud.exception.ResourceAllocationException; |
|
44 | 75 | import com.cloud.vm.snapshot.VMSnapshot; |
45 | 76 | import com.cloud.vm.snapshot.VMSnapshotVO; |
46 | 77 | import com.cloud.vm.snapshot.dao.VMSnapshotDao; |
47 | | -import org.apache.cloudstack.acl.ControlledEntity; |
48 | | -import org.apache.cloudstack.acl.SecurityChecker.AccessType; |
49 | | -import org.apache.cloudstack.context.CallContext; |
50 | | -import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; |
51 | | -import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory; |
52 | | -import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; |
53 | | -import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotStrategy; |
54 | | -import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotStrategy.SnapshotOperation; |
55 | | -import org.apache.cloudstack.engine.subsystem.api.storage.StorageStrategyFactory; |
56 | | -import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory; |
57 | | -import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; |
58 | | -import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; |
59 | 78 | import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreDao; |
60 | 79 | import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreVO; |
61 | | -import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; |
62 | | -import org.junit.After; |
63 | | -import org.junit.Assert; |
64 | | -import org.junit.Before; |
65 | | -import org.junit.Test; |
66 | | -import org.mockito.Mock; |
67 | | -import org.mockito.Mockito; |
68 | | -import org.mockito.MockitoAnnotations; |
69 | | -import org.mockito.Spy; |
| 80 | +import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotService; |
70 | 81 |
|
71 | | -import java.util.List; |
72 | | -import java.util.UUID; |
73 | | - |
74 | | -import static org.mockito.Matchers.any; |
75 | | -import static org.mockito.Matchers.anyLong; |
76 | | -import static org.mockito.Mockito.doNothing; |
77 | | -import static org.mockito.Mockito.mock; |
78 | | -import static org.mockito.Mockito.when; |
79 | 82 |
|
80 | 83 | public class SnapshotManagerTest { |
81 | 84 | @Spy |
@@ -126,6 +129,9 @@ public class SnapshotManagerTest { |
126 | 129 | SnapshotDataStoreDao _snapshotStoreDao; |
127 | 130 | @Mock |
128 | 131 | SnapshotDataStoreVO snapshotStoreMock; |
| 132 | + @Mock |
| 133 | + SnapshotService snapshotSrv; |
| 134 | + |
129 | 135 |
|
130 | 136 | private static final long TEST_SNAPSHOT_ID = 3L; |
131 | 137 | private static final long TEST_VOLUME_ID = 4L; |
@@ -330,5 +336,4 @@ public void testBackupSnapshotFromVmSnapshotF3() { |
330 | 336 | Snapshot snapshot = _snapshotMgr.backupSnapshotFromVmSnapshot(TEST_SNAPSHOT_ID, TEST_VM_ID, TEST_VOLUME_ID, TEST_VM_SNAPSHOT_ID); |
331 | 337 | Assert.assertNull(snapshot); |
332 | 338 | } |
333 | | - |
334 | 339 | } |
0 commit comments