Juan Hernandez has posted comments on this change.

Change subject: rest: Validation of the protocol values
......................................................................


Patch Set 4:

(1 comment)

Looks good, just a minor comment about one of the tests.

http://gerrit.ovirt.org/#/c/35865/4/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/MappingTestHelper.java
File 
backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/MappingTestHelper.java:

Line 221:     }
Line 222: 
Line 223:     private static Object garble(Method m) {
Line 224:         return m.getName().endsWith("Id") ? 
GuidUtils.asGuid(UUID.randomUUID().toString()).toString()
Line 225:                 : m.getName().endsWith("Protocol") ? 
HostProtocol.values()[rand(HostProtocol.values().length)].value()
Try to avoid introducing specific concepts (like HostProtocol) in this generic 
class. Instead of that, if you need to set a random value for the protocol do 
it in the test itself. For example, in HostMapperTest.postPopulate add a line 
like this:

  from.setType(MappingTestHelper.shuffle(HostProtocol.class).value());

You can find examples of this in VmMapper.postPopulate.
Line 226:                         : new String(new byte[] { (byte) (65 + 
rand(26)), (byte) (65 + rand(26)),
Line 227:                                 (byte) (65 + rand(26)) });
Line 228:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I666b5469bcaf2bd00f793ad4320c3f37505d49b0
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to