Allon Mureinik has uploaded a new change for review.

Change subject: core: Fix NPE in AuditLogableBaseTest
......................................................................

core: Fix NPE in AuditLogableBaseTest

AuditLogableBaseTest would print an annoying NullPointerException
stacktrace due to getVm() trying to access VmNetworkInterfaceDao in
getVm().

This patch adds a mock for that DAO (with no additional behavior, as to
not change the test's semantics) to avoid this annoying output.

Change-Id: I24940142c12e0259544f3e3cb8bc8bd8ca2c2cfa
Signed-off-by: Allon Mureinik <[email protected]>
---
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBaseTest.java
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/65/12265/1

diff --git 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBaseTest.java
 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBaseTest.java
index 151ced9..a760743 100644
--- 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBaseTest.java
+++ 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBaseTest.java
@@ -12,12 +12,12 @@
 
 import org.junit.Test;
 import org.ovirt.engine.core.common.AuditLogType;
+import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.StorageDomainStatus;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
 import org.ovirt.engine.core.common.businessentities.VM;
 import org.ovirt.engine.core.common.businessentities.VmTemplate;
-import org.ovirt.engine.core.common.businessentities.StorageDomain;
 import org.ovirt.engine.core.common.businessentities.storage_pool;
 import org.ovirt.engine.core.common.interfaces.IVdcUser;
 import org.ovirt.engine.core.common.users.VdcUser;
@@ -29,6 +29,7 @@
 import org.ovirt.engine.core.dao.VdsGroupDAO;
 import org.ovirt.engine.core.dao.VmDAO;
 import org.ovirt.engine.core.dao.VmTemplateDAO;
+import org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao;
 
 public class AuditLogableBaseTest {
 
@@ -1114,6 +1115,11 @@
             return v;
         }
 
+        @Override
+        protected VmNetworkInterfaceDao getVmNetworkInterfaceDao() {
+            return mock(VmNetworkInterfaceDao.class);
+        }
+
         private List<StorageDomain> getStorageDomainList() {
             final List<StorageDomain> l = new ArrayList<StorageDomain>();
             final StorageDomain s = new StorageDomain();


--
To view, visit http://gerrit.ovirt.org/12265
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I24940142c12e0259544f3e3cb8bc8bd8ca2c2cfa
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to