From b06543a8dbee39db789fc097f141b80962e5156f Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Thu, 22 Sep 2011 16:21:15 -0700 Subject: [PATCH] bug 11531: forget to include newly added JUnit test along with the fix, here it is --- .../com/cloud/snapshot/SnapshotDaoTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 server/test/com/cloud/snapshot/SnapshotDaoTest.java 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); + } + } +}