Allon Mureinik has posted comments on this change.

Change subject: core: ImportVm test cleanup: VM name generation
......................................................................


Patch Set 10: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVmCommandTest.java
Line 28:     @ClassRule
Line 29:     public static MockConfigRule mcr = new MockConfigRule();
Line 30: 
Line 31:     @Rule
Line 32:     public RandomUtilsSeedingRule rusr = new RandomUtilsSeedingRule();
It is not used directly.
It's presence here several aspects to the test:

1. It logs the random seed at the beginning of each test
2. It allows this seed to be set externally (e.g., from a maven command line) 
if you want to reproduce a specific usecase/failure.

You can read all about it in its wiki page:
http://www.ovirt.org/RandomUtilsSeedingRule
Line 33: 
Line 34:     @Test
Line 35:     @Ignore
Line 36:     public void insufficientDiskSpace() {


Line 103: 
Line 104:     /**
Line 105:      * Checking that other fields in
Line 106:      * {@link 
org.ovirt.engine.core.common.businessentities.VmStatic.VmStatic}
Line 107:      * aren't get validated in import or import as cloned.
indeed. Didn't even bother looking at the broken English - will fix.
Line 108:      */
Line 109:     @Test
Line 110:     public void testOtherFieldsNotValidatedInImport() {
Line 111:         ImportVmParameters parameters = createParameters();


Line 108:      */
Line 109:     @Test
Line 110:     public void testOtherFieldsNotValidatedInImport() {
Line 111:         ImportVmParameters parameters = createParameters();
Line 112:         String stringOf5000Chars =
Yup.
Leftover from the original code - will fix.
Line 113:                 
RandomUtils.instance().nextNameString(BusinessEntitiesDefinitions.GENERAL_MAX_SIZE
 + 1);
Line 114:         
parameters.getVm().setUserDefinedProperties(stringOf5000Chars);
Line 115:         parameters.setImportAsNewEntity(true);
Line 116:         ImportVmCommand command = new ImportVmCommand(parameters);


....................................................
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/RandomUtils.java
Line 368:      *
Line 369:      * @param length
Line 370:      *            The requested length of the string.
Line 371:      */
Line 372:     public String nextNameString(int length) {
The intent was to randomize a string from the characters that are legal in an 
entity name, as described in ValidationUtils.

If you have a better suggestion it would be welcome.
Line 373:         return nextString(length, ENTITY_NAME_CHARS);
Line 374:     }
Line 375: 
Line 376:     /**


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1f04e067e8bce2c6cd1010f83a44809a3c8c464c
Gerrit-PatchSet: 10
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Alissa Bonas <abo...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Ayal Baron <aba...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to