Skip to content

Commit

Permalink
Send participant to device #25
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorwolf committed Oct 7, 2016
1 parent 85cf038 commit af0095b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion odatareceptionist/procedures/PrintQueue.xsunit.xsjslib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
describe("Print Queue Tests", function() { var cut = $.import("com.sap.sapmentors.sitreg.odatareceptionist.procedures", "PrintQueue"); var participant; var ParticipantID; var EventID; beforeOnce(function() { var select = 'SELECT TOP 1 "ID", "Participant"."EventID" ' + 'FROM "com.sap.sapmentors.sitreg.data::SITreg.Participant" AS "Participant" ' + 'LEFT JOIN "com.sap.sapmentors.sitreg.data::SITreg.Device" AS "Device" ' + 'ON "Device"."EventID" = "Participant"."EventID" ' + 'WHERE "Device"."DeviceID" IS NOT NULL'; var pStmt = jasmine.dbConnection.prepareStatement(select); var rs = pStmt.executeQuery(); if (rs.next()) { ParticipantID = rs.getInteger(1); EventID = rs.getInteger(2); } pStmt.close(); }); it('should read participant details', function() { participant = cut.readParticipant(ParticipantID); expect(participant.ParticipantID).toBe(ParticipantID); expect(participant.EventID).toBe(EventID); }); it('should read devices for event', function() { var devices = cut.getDevicesForEvent(EventID); expect(devices.length).toBe(1); }); it('should fill print queue', function() { participant.PrintStatus = 'P'; var status = cut.addParticipantToPrintQueue(participant); expect(status.error).toBe(undefined); }); it('check if participant was inserted', function() { var count = cut.isParticipantInPrintQueue(ParticipantID); expect(count).toBe(true); }); afterOnce(function() { var select = 'DELETE FROM "com.sap.sapmentors.sitreg.data::SITreg.PrintQueue" ' + 'WHERE "ParticipantID" = ?'; var pStmt = jasmine.dbConnection.prepareStatement(select); pStmt.setInteger(1, participant.ParticipantID); pStmt.execute(); jasmine.dbConnection.commit(); pStmt.close(); });});
describe("Print Queue Tests", function() { var cut = $.import("com.sap.sapmentors.sitreg.odatareceptionist.procedures", "PrintQueue"); var participant; var ParticipantID; var EventID; beforeOnce(function() { var select = 'SELECT TOP 1 "ID", "Participant"."EventID" ' + 'FROM "com.sap.sapmentors.sitreg.data::SITreg.Participant" AS "Participant" ' + 'LEFT JOIN "com.sap.sapmentors.sitreg.data::SITreg.Device" AS "Device" ' + 'ON "Device"."EventID" = "Participant"."EventID" ' + 'WHERE "Device"."DeviceID" IS NOT NULL'; var pStmt = jasmine.dbConnection.prepareStatement(select); var rs = pStmt.executeQuery(); if (rs.next()) { ParticipantID = rs.getInteger(1); EventID = rs.getInteger(2); } pStmt.close(); }); it('should read participant details', function() { participant = cut.readParticipant(ParticipantID); expect(participant.ParticipantID).toBe(ParticipantID); expect(participant.EventID).toBe(EventID); }); it('should read devices for event', function() { var devices = cut.getDevicesForEvent(EventID); expect(devices.length).toBe(1); }); it('should check that there is no entry in Print Queue with sent status', function() { var boolean = cut.hasPrintQueueElementInSentStatusForEvent(EventID); expect(boolean).toBe(false); }); it('should fill print queue', function() { var status = cut.addParticipantToPrintQueue(participant); expect(status.error).toBe(undefined); }); it('should check that there is an entry in Print Queue with sent status', function() { var boolean = cut.hasPrintQueueElementInSentStatusForEvent(EventID); expect(boolean).toBe(true); }); it('check if participant was inserted', function() { var boolean = cut.isParticipantInPrintQueue(ParticipantID); expect(boolean).toBe(true); }); afterOnce(function() { var select = 'DELETE FROM "com.sap.sapmentors.sitreg.data::SITreg.PrintQueue" ' + 'WHERE "ParticipantID" = ?'; var pStmt = jasmine.dbConnection.prepareStatement(select); pStmt.setInteger(1, participant.ParticipantID); pStmt.execute(); jasmine.dbConnection.commit(); pStmt.close(); });});
Expand Down
10 changes: 10 additions & 0 deletions odatareceptionist/procedures/hcpiotmms.xshttpdest
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
host = "iotmmss0001142741trial.hanatrial.ondemand.com";
port = 443;
pathPrefix = "/com.sap.iotservices.mms/v1/api/http/push/";
proxyType = http;
proxyHost = "proxy-trial";
proxyPort = 8080;
authType = basic;
useSSL = true;
timeout = 30000;
sslAuth = client;
1 change: 1 addition & 0 deletions roles/admin.hdbrole
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ role com.sap.sapmentors.sitreg.roles::admin {
sql object com.sap.sapmentors.sitreg.data::SITreg.Organizer: SELECT, INSERT, UPDATE, DELETE;
sql object com.sap.sapmentors.sitreg.data::SITreg.Ticket: SELECT, INSERT, UPDATE, DELETE;
sql object com.sap.sapmentors.sitreg.data::SITreg.PrintQueue: SELECT, INSERT, UPDATE, DELETE;
sql object com.sap.sapmentors.sitreg.data::SITreg.Device: SELECT, INSERT, UPDATE, DELETE;
sql object com.sap.sapmentors.sitreg.odataparticipant.procedures::TicketCreate: EXECUTE;
sql object com.sap.sapmentors.sitreg.odataadmin.procedures::TicketCreateMissing: EXECUTE;
sql object com.sap.sapmentors.sitreg.odataadmin.procedures::ParticipantUpdateWaitingList: EXECUTE;
Expand Down

0 comments on commit af0095b

Please sign in to comment.