Alona Kaplan has posted comments on this change.

Change subject: core: Modified statistics removal DAO test
......................................................................


Patch Set 4: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/36462/4/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/InterfaceDaoTest.java
File 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/InterfaceDaoTest.java:

Line 148:         
dao.removeStatisticsForVds(FixturesTool.VDS_NETWORK_INTERFACE);
Line 149: 
Line 150:         List<VdsNetworkInterface> after = 
dao.getAllInterfacesForVds(VDS_ID);
Line 151: 
Line 152:         for (VdsNetworkInterface iface : after) {
Seems that the previous test indeed didn't tested anything.

But-
If an interface doesn't have entry in the statistics table, 
dao.getAllInterfaceForVds(..) won't return this interface in its result set. 
Since the result is a join of the interface and the statistics table.
You should check that 'after' doesn't contain interface with id 
FixturesTool.VDS_NETWORK_INTERFACE.

BTW, iface.getStatictics is never null, the default ctor of VdsNetworkInterface 
sets default value to the statistics.
Line 153:             
assertTrue(iface.getId().equals(FixturesTool.VDS_NETWORK_INTERFACE) ? 
iface.getStatistics() == null
Line 154:                     : iface.getStatistics() != null);
Line 155:         }
Line 156:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I79979f22ad17db9e12d403774cd84d77338a43ab
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Martin Mucha <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to