Allon Mureinik has posted comments on this change.
Change subject: core: unit-test for XmlRpcUtils timeouts
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(4 inline comments)
see inline
....................................................
File
backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/xmlrpc/XmlRpcUtilsTest.java
Line 18: import org.ovirt.engine.core.vdsbroker.irsbroker.IrsServerConnector;
Line 19:
Line 20: public class XmlRpcUtilsTest {
Line 21:
Line 22: ServerSocket socket = null;
I'd make this private
Line 23: @Before
Line 24: public void setup() throws Exception {
Line 25: IConfigUtilsInterface configUtil =
Mockito.mock(IConfigUtilsInterface.class);
Line 26:
Mockito.when(configUtil.GetValue(ConfigValues.UseSecureConnectionWithServers,
Line 30:
Mockito.when(configUtil.GetValue(ConfigValues.DefaultMinThreadPoolSize,
Line 31: Config.DefaultConfigurationVersion)).thenReturn(1);
Line 32:
Mockito.when(configUtil.GetValue(ConfigValues.DefaultMaxThreadPoolSize,
Line 33: Config.DefaultConfigurationVersion)).thenReturn(2);
Line 34: Config.setConfigUtils(configUtil);
Wouldn't using MockConfigRule make this block a whole lot easier?
Line 35: //the port is open but we will neer accept()
Line 36: socket = new ServerSocket(6666);
Line 37: }
Line 38:
Line 31: Config.DefaultConfigurationVersion)).thenReturn(1);
Line 32:
Mockito.when(configUtil.GetValue(ConfigValues.DefaultMaxThreadPoolSize,
Line 33: Config.DefaultConfigurationVersion)).thenReturn(2);
Line 34: Config.setConfigUtils(configUtil);
Line 35: //the port is open but we will neer accept()
s/neer/never/ ?
Line 36: socket = new ServerSocket(6666);
Line 37: }
Line 38:
Line 39: @After
Line 32:
Mockito.when(configUtil.GetValue(ConfigValues.DefaultMaxThreadPoolSize,
Line 33: Config.DefaultConfigurationVersion)).thenReturn(2);
Line 34: Config.setConfigUtils(configUtil);
Line 35: //the port is open but we will neer accept()
Line 36: socket = new ServerSocket(6666);
Consider adding something like assumeNotNull(socket), so if opening this socket
is not allowed for some reason related to the local OS/HW, it won't fail the
entire test.
Line 37: }
Line 38:
Line 39: @After
Line 40: public void tearDown() throws Exception {
--
To view, visit http://gerrit.ovirt.org/8427
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I820d0400fef464f9bab7beaa61489d86907218c1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches