Alona Kaplan has posted comments on this change.
Change subject: engine: Fix unit tests that were broken by multiple gateways
......................................................................
Patch Set 2: (2 inline comments)
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/host/SetupNetworksHelperTest.java
Line 172: nic.setBootProtocol(NetworkBootProtocol.STATIC_IP);
Line 173: nic.setGateway(RandomUtils.instance().nextString(10));
Line 174: mockExistingIfaces(nic);
Line 175: nic.setGateway(RandomUtils.instance().nextString(10));
Line 176:
Thanks. Now I see the broken tests were fixed by another commit.
I think that it is not correct to add
when(vds.getVdsGroupCompatibilityVersion()).thenReturn(Version.v3_3);
to createHelper(SetupNetworksParameters params) because the createHelper is
used by a lot of tests, and this code is needed just by the gatewayChanged test.
So I leaved the code as is in my patch and removed the code from the
createHelper.
Line 177: VDS vds = mock(VDS.class);
Line 178: when(vds.getId()).thenReturn(Guid.Empty);
Line 179:
when(vds.getVdsGroupCompatibilityVersion()).thenReturn(Version.v3_3);
Line 180:
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/SetupNetworksParametersTest.java
Line 30:
Line 31: Validator validator = ValidationUtils.getValidator();
Line 32:
Line 33: nic.setNetworkName("netName");
Line 34: nic.setGateway("");
Done
Line 35: nic.setBootProtocol(STATIC_IP);
Line 36: nic.setAddress("1.1.1.1");
Line 37:
Line 38: assertTrue(validator.validate(params).isEmpty());
--
To view, visit http://gerrit.ovirt.org/15493
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1d453ea1efe736dd16dea9b793d784bee4225af8
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches