Michael Pasternak has posted comments on this change.

Change subject: restapi : Add /applications sub-collection under vm(#926928)
......................................................................


Patch Set 6: I would prefer that you didn't submit this

(5 inline comments)

well done rav, few comments inline, + you've missed my general comment from 
patch set 5.

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmApplicationsResource.java
Line 23:         VM vm = getEntity(entityType, VdcQueryType.GetVmByVmId, new 
IdQueryParameters(vmId), vmId.toString(), true);
Line 24:         Applications applications = new Applications();
Line 25:         int index = 1;
Line 26:         if (vm.getAppList() != null) {
Line 27:             for (String appName : vm.getAppList().split(",")) {
this should go to mapper => map (String app, Applications application)
Line 28:                 Application app = new Application();
Line 29:                 app.setName(appName);
Line 30:                 app.setId(buildId(index));
Line 31:                 applications.getApplications().add(addLinks(app));


Line 42:         return model;
Line 43:     }
Line 44: 
Line 45:     private String buildId(int index) {
Line 46:         return Guid.createGuidFromString("0-0-0-0-"+index).toString();
this is not correct way to build the id, should be

new NGuid(appname.getBytes(), true).toString()

(apname should be a unique combination of strings)
Line 47:     }
Line 48: 
Line 49:     @Override
Line 50:     @SingleEntityResource


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmApplicationResourceTest.java
Line 86:     public void testGet() throws Exception {
Line 87:         setUriInfo(setUpBasicUriExpectations());
Line 88:         setUpEntityQueryExpectations();
Line 89:         control.replay();
Line 90: 
are you sure it's still works? where is a GetVm query expectation?
Line 91:         Application application = resource.get();
Line 92:         assertEquals(NAMES[APPLICATION_INDEX], application.getName());
Line 93:         verifyLinks(application);
Line 94:     }


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmApplicationsResourceTest.java
Line 39: 
Line 40:     @Override
Line 41:     protected Object getEntity(int index) {
Line 42:         // TODO Auto-generated method stub
Line 43:         return null;
you can reuse it for the application
Line 44:     }
Line 45: 
Line 46:     @Test
Line 47:     public void testList() throws Exception {


....................................................
File packaging/conf/ovirt-websocket-proxy.conf.defaults
Line 11: SSL_KEY=
Line 12: FORCE_DATA_VERIFICATION=False
Line 13: CERT_FOR_DATA_VERIFICATION=
Line 14: SSL_ONLY=False
Line 15: 
LOG_FILE="/home/rnori/ovirt-engine/var/log/ovirt-engine/ovirt-websocket-proxy.log"
this is not related to the patch, please revert.
Line 16: LOG_VERBOSE=False
Line 17: ENGINE_USR="/home/rnori/ovirt-engine/share/ovirt-engine"


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8b7db49d2cc7b47c39ef3d4fff261a99c24dae42
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to