diff --git a/server/test/com/cloud/snapshot/SnapshotDaoTest.java b/server/test/com/cloud/snapshot/SnapshotDaoTest.java new file mode 100644 index 00000000000..863f7cabbbb --- /dev/null +++ b/server/test/com/cloud/snapshot/SnapshotDaoTest.java @@ -0,0 +1,23 @@ +package com.cloud.snapshot; + +import java.util.List; + +import com.cloud.storage.Snapshot; +import com.cloud.storage.SnapshotVO; +import com.cloud.storage.dao.SnapshotDaoImpl; +import com.cloud.utils.component.ComponentLocator; + +import junit.framework.Assert; +import junit.framework.TestCase; + +public class SnapshotDaoTest extends TestCase { + + public void testListBy() { + SnapshotDaoImpl dao = ComponentLocator.inject(SnapshotDaoImpl.class); + + List snapshots = dao.listByInstanceId(3, Snapshot.Status.BackedUp); + for(SnapshotVO snapshot : snapshots) { + Assert.assertTrue(snapshot.getStatus() == Snapshot.Status.BackedUp); + } + } +}