Last active
August 29, 2015 14:13
-
-
Save jasper07/353c0d173398d086c7a2 to your computer and use it in GitHub Desktop.
Add own Request to MockServer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//initialize the MockServer as per normal | |
jQuery.sap.require("sap.ui.core.util.MockServer"); | |
var oMockServer = new sap.ui.core.util.MockServer({ | |
rootUri: sServiceUrl | |
}); | |
oMockServer.simulate("model/metadata.xml", "model/"); | |
//add your requests to the ones already set | |
try { | |
jQuery.sap.require("myapp.model.mockRequests"); | |
var aMyRequests = myapp.model.mockRequests.getRequests(); | |
if (aMyRequests.length > 0) { | |
oMockServer.setRequests(oMockServer.getRequests().concat(aMyRequests)); | |
} | |
} catch (oErr) { | |
jQuery.sap.log.debug(oErr.message); | |
} | |
//start the mockserver | |
oMockServer.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment