Allon Mureinik has posted comments on this change.
Change subject: core : QuotaMnager Test - basic structure
......................................................................
Patch Set 7: (6 inline comments)
Sorry, missed some issues in the previous patchset - see inline.
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/quota/QuotaManagerTest.java
Line 73:
Line 74: private QuotaManager quotaManager =
Mockito.spy(QuotaManager.getInstance());
Line 75: private storage_pool storage_pool = new storage_pool();
Line 76: private static ArrayList<String> canDoActionMessages = new
ArrayList<String>();
Line 77: private static boolean hardEnforcement = true;
why do you need this static?
Line 78: private static boolean auditLogWritten = false;
Line 79: private static boolean dbWasCalled = false;
Line 80:
Line 81: @Before
Line 74: private QuotaManager quotaManager =
Mockito.spy(QuotaManager.getInstance());
Line 75: private storage_pool storage_pool = new storage_pool();
Line 76: private static ArrayList<String> canDoActionMessages = new
ArrayList<String>();
Line 77: private static boolean hardEnforcement = true;
Line 78: private static boolean auditLogWritten = false;
same
Line 79: private static boolean dbWasCalled = false;
Line 80:
Line 81: @Before
Line 82: public void testSetup() {
Line 75: private storage_pool storage_pool = new storage_pool();
Line 76: private static ArrayList<String> canDoActionMessages = new
ArrayList<String>();
Line 77: private static boolean hardEnforcement = true;
Line 78: private static boolean auditLogWritten = false;
Line 79: private static boolean dbWasCalled = false;
same
Line 80:
Line 81: @Before
Line 82: public void testSetup() {
Line 83: mockQuotaDAO();
Line 130: storage_pool.setId(new
Guid("00000000-0000-0000-0000-000000001111"));
Line 131: }
Line 132:
Line 133: private static void assertNotEmptyCanDoActionMessage() {
Line 134: assertTrue(EXPECTED_CAN_DO_MESSAGE,
canDoActionMessages.size() > 0);
optional: consider using assertFalse(EXPECTED_CAN_DO_MESSAGE,
canDoActionMessages.isEmpty())
Line 135: canDoActionMessages.clear();
Line 136: }
Line 137:
Line 138: private static void assertEmptyCanDoActionMessage() {
Line 135: canDoActionMessages.clear();
Line 136: }
Line 137:
Line 138: private static void assertEmptyCanDoActionMessage() {
Line 139: assertTrue(EXPECTED_EMPTY_CAN_DO_MESSAGE,
canDoActionMessages.size() == 0);
Optional: consider using assertTrue(EXPECTED_EMPTY_CAN_DO_MESSAGE,
canDoActionMessages.isEmpty())
Line 140: }
Line 141:
Line 142: private static void assertAuditLogWritten() {
Line 143: assertTrue(EXPECTED_AUDIT_LOG_MESSAGE, auditLogWritten);
Line 139: assertTrue(EXPECTED_EMPTY_CAN_DO_MESSAGE,
canDoActionMessages.size() == 0);
Line 140: }
Line 141:
Line 142: private static void assertAuditLogWritten() {
Line 143: assertTrue(EXPECTED_AUDIT_LOG_MESSAGE, auditLogWritten);
This seems like a bit of a workaround - why not use mockito's verify?
Line 144: auditLogWritten = false;
Line 145: }
Line 146:
Line 147: private static void assertAuditLogNotWritten() {
--
To view, visit http://gerrit.ovirt.org/8422
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie2ff7377f01fdc9de9edb5650cc796e24a8f65c3
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: ofri masad <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches