Added parameterized procedures

Add tests, including concurrent/parameterized execution
delete and query procedures can both use parameters
these will use Asterix job parameters to assign at runtime
Add timeStamp index to channel results
Cleanup result code for query procedures
Prevent repetitive jobs from executing
multiple iterations concurrently

Change-Id: I999879b1cae0de179a1d3c232fa940228979f4fe
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.1.ddl.sqlpp
new file mode 100644
index 0000000..e8d57a6
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.1.ddl.sqlpp
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Disasters with friends
+* Expected Res : Success
+* Date         : May 17
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type UserLocation as {
+  recordId: uuid,
+  latitude: double,
+  longitude: double,
+  user_id: int,
+  timestamp: datetime
+};
+
+create type EmergencyShelter as {
+  name: string,
+  location: point
+};
+
+create type EmergencyReport as {
+  reportId: uuid,
+  impactZone: circle,
+  timestamp: datetime,
+  emergencyType: string
+};
+
+//create datasets
+create dataset EmergencyReports(EmergencyReport) primary key reportId autogenerated;
+create dataset UserLocations(UserLocation) primary key recordId autogenerated;
+create dataset EmergencyShelters(EmergencyShelter) primary key name;
+
+create broker brokerA at "http://www.notifyA.com";
+
+create function EmergenciesNearMe(emergencyType, uid){
+  (with tenMinutesAgo as current_datetime() - day_time_duration("PT10S")
+  select report as report, shelters as shelters
+  from EmergencyReports report, UserLocations user
+  let shelters = (select * from EmergencyShelters shelter
+    where spatial_intersect(report.impactZone,shelter.location))
+  where user.user_id = uid
+    and report.timestamp >= tenMinutesAgo
+    and user.timestamp >= tenMinutesAgo
+    and report.emergencyType = emergencyType
+    and spatial_intersect(report.impactZone,create_point(user.latitude,user.longitude)))
+};
+
+create repetitive channel EmergenciesNearMeChannel using EmergenciesNearMe@2 period duration("PT5S");
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.2.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.2.update.sqlpp
new file mode 100644
index 0000000..b1a132b
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.2.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Disasters with friends
+* Expected Res : Success
+* Date         : May 17
+* Author       : Steven Jacobs
+*/
+use channels;
+
+subscribe to EmergenciesNearMeChannel("tornado", 1) on brokerA;
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.3.update.sqlpp
new file mode 100644
index 0000000..292151e
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.3.update.sqlpp
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Disasters with friends
+* Expected Res : Success
+* Date         : May 17
+* Author       : Steven Jacobs
+*/
+
+use channels;
+upsert into UserLocations([
+{"user_id":1, "latitude":5, "longitude":5, "timestamp":current_datetime()},
+{"user_id":2, "latitude":10, "longitude":10, "timestamp":current_datetime()},
+{"user_id":3, "latitude":15, "longitude":15, "timestamp":current_datetime()}]
+);
+upsert into EmergencyShelters([
+{"name":"A", "location":create_point(5.0,5.0)},
+{"name":"B", "location":create_point(10.0,10.0)},
+{"name":"C", "location":create_point(15.0,15.0)}]
+);
+upsert into EmergencyReports([
+{"emergencyType":"tornado", "impactZone":create_circle(create_point(5.0,6.0), 10.0), "timestamp":current_datetime()},
+{"emergencyType":"flood", "impactZone":create_circle(create_point(5.0,6.0), 5.0), "timestamp":current_datetime()},
+{"emergencyType":"tornado", "impactZone":create_circle(create_point(30.0,70.0), 5.0), "timestamp":current_datetime()}]
+);
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.4.sleep.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.4.sleep.sqlpp
new file mode 100644
index 0000000..67c5efa
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.4.sleep.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Disasters with friends
+* Expected Res : Success
+* Date         : May 17
+* Author       : Steven Jacobs
+*/
+
+5000
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.5.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.5.query.sqlpp
new file mode 100644
index 0000000..2fbd21d
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.5.query.sqlpp
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Disasters with friends
+* Expected Res : Success
+* Date         : May 17
+* Author       : Steven Jacobs
+*/
+
+use channels;
+select value array_count (result.result.shelters)
+from EmergenciesNearMeChannelResults result;
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.6.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.6.ddl.sqlpp
new file mode 100644
index 0000000..220f05a
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/disasters_with_friends/disasters_with_friends.6.ddl.sqlpp
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Disasters with friends
+* Expected Res : Success
+* Date         : May 17
+* Author       : Steven Jacobs
+*/
+
+use channels;
+
+drop channel EmergenciesNearMeChannel;
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.sqlpp
index 42fd4aa..11b7b33 100644
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.sqlpp
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.1.ddl.sqlpp
@@ -35,12 +35,12 @@
 create dataset UserLocations(userLocation)
 primary key userId;
 
-create function RoomOccupants($room) {
-    for $location in dataset UserLocations
-    where $location.roomNumber = $room
-    return $location.userId
+create function RoomOccupants(room) {
+  (select location.userId
+  from UserLocations location
+  where location.roomNumber = room)
 };
 
 create broker brokerA at "http://www.notifyA.com";
 
-create repetitive channel roomRecords using RoomOccupants@1 period duration("PT1S");
+create repetitive channel roomRecords using RoomOccupants@1 period duration("PT30S");
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.sqlpp
index 270326b..d5f4290 100644
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.sqlpp
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.4.sleep.sqlpp
@@ -22,4 +22,4 @@
 * Date         : Sep 2016
 * Author       : Steven Jacobs
 */
-600000
+630000
diff --git a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.sqlpp
index 8db3fde..cfe92c9 100644
--- a/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.sqlpp
+++ b/asterix-bad/src/test/resources/runtimets/queries/channel/ten_minute_channel/ten_minute_channel.5.query.sqlpp
@@ -25,6 +25,4 @@
 
 use channels;
 
-count (from $result in dataset roomRecordsResults
-order by $result.result
-select $result.result) > 599;
+(select value count(result) from roomRecordsResults)[0] > 19;
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.1.ddl.sqlpp
new file mode 100644
index 0000000..06ca3d5
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.1.ddl.sqlpp
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Run Procedure Concurrently
+* Expected Res : Success
+* Date         : Oct 2017
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type myLocation as {
+  id : uuid,
+  timeStamp: datetime,
+  roomNumber: int
+};
+
+
+create dataset UserLocations(myLocation)
+primary key id autogenerated;
+
+create procedure addMe() {
+  insert into UserLocations([
+    {"timeStamp":current_datetime(), "roomNumber":222}]
+  )
+};
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.2.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.2.update.sqlpp
new file mode 100644
index 0000000..ac88f47
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.2.update.sqlpp
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute addMe();
+execute addMe();
+execute addMe();
+execute addMe();
+execute addMe();
+execute addMe();
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.3.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.3.ddl.sqlpp
new file mode 100644
index 0000000..5ed56cf
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.3.ddl.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : 3
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+drop procedure addMe@0;
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.4.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.4.query.sqlpp
new file mode 100644
index 0000000..2094a77
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/concurrent_procedure/concurrent_procedure.4.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Insert Procedure
+* Expected Res : Success
+* Date         : Jan 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+select value count(location) from UserLocations location;
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.1.ddl.sqlpp
new file mode 100644
index 0000000..42b0d40
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.1.ddl.sqlpp
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Delete Procedure with parameters
+* Expected Res : Success
+* Date         : May 2017
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+create type myLocation as {
+  id: int
+};
+create dataset UserLocations(myLocation)
+primary key id;
+insert into UserLocations(
+  [{"id":0, "roomNumber":4815162342},
+  {"id":1, "roomNumber":"lost"},
+  {"id":2, "roomNumber":108},
+  {"id":3, "roomNumber":"jacob"}]
+);
+create procedure deleteSome(r, otherRoom) {
+delete from UserLocations
+where roomNumber = r
+or roomNumber = otherRoom
+};
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.2.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.2.query.sqlpp
new file mode 100644
index 0000000..88166bb
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.2.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Delete Procedure with parameters
+* Expected Res : Success
+* Date         : May 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+select value count(roomNumber) from UserLocations;
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.3.update.sqlpp
new file mode 100644
index 0000000..8d03794
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.3.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Delete Procedure with parameters
+* Expected Res : Success
+* Date         : May 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute deleteSome(108,"jacob");
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.4.query.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.4.query.sqlpp
new file mode 100644
index 0000000..88166bb
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.4.query.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Delete Procedure with parameters
+* Expected Res : Success
+* Date         : May 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+select value count(roomNumber) from UserLocations;
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.1.ddl.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.1.ddl.sqlpp
new file mode 100644
index 0000000..8949a4a
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.1.ddl.sqlpp
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Query Procedure with parameters
+* Expected Res : Success
+* Date         : May 2017
+* Author       : Steven Jacobs
+*/
+
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+create type myLocation as {
+  id: int
+};
+create dataset UserLocations(myLocation)
+primary key id;
+insert into UserLocations(
+  [{"id":0, "roomNumber":4815162342},
+  {"id":1, "roomNumber":"lost"},
+  {"id":2, "roomNumber":108},
+  {"id":3, "roomNumber":"jacob"}]
+);
+create procedure selectSome(r, otherRoom) {
+select roomNumber from UserLocations
+where roomNumber = r
+or roomNumber = otherRoom
+order by id
+};
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.2.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.2.update.sqlpp
new file mode 100644
index 0000000..aa0722a
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.2.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Query Procedure with parameters
+* Expected Res : Success
+* Date         : May 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute selectSome(108,"jacob");
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
new file mode 100644
index 0000000..aa0722a
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+* Description  : Simple Query Procedure with parameters
+* Expected Res : Success
+* Date         : May 2017
+* Author       : Steven Jacobs
+*/
+
+use channels;
+execute selectSome(108,"jacob");
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/results/channel/disasters_with_friends/disasters_with_friends.1.adm b/asterix-bad/src/test/resources/runtimets/results/channel/disasters_with_friends/disasters_with_friends.1.adm
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/channel/disasters_with_friends/disasters_with_friends.1.adm
@@ -0,0 +1 @@
+2
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/concurrent_procedure/concurrent_procedure.4.adm b/asterix-bad/src/test/resources/runtimets/results/procedure/concurrent_procedure/concurrent_procedure.4.adm
new file mode 100644
index 0000000..62f9457
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/concurrent_procedure/concurrent_procedure.4.adm
@@ -0,0 +1 @@
+6
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.1.adm b/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.1.adm
new file mode 100644
index 0000000..bf0d87a
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.1.adm
@@ -0,0 +1 @@
+4
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.2.adm b/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.2.adm
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/delete_procedure_with_parameters/delete_procedure_with_parameters.2.adm
@@ -0,0 +1 @@
+2
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure_with_parameters/query_procedure_with_parameters.1.adm b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure_with_parameters/query_procedure_with_parameters.1.adm
new file mode 100644
index 0000000..bee5525
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure_with_parameters/query_procedure_with_parameters.1.adm
@@ -0,0 +1,2 @@
+{ "roomNumber": 108 }
+{ "roomNumber": "jacob" }
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure_with_parameters/query_procedure_with_parameters.2.adm b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure_with_parameters/query_procedure_with_parameters.2.adm
new file mode 100644
index 0000000..bee5525
--- /dev/null
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure_with_parameters/query_procedure_with_parameters.2.adm
@@ -0,0 +1,2 @@
+{ "roomNumber": 108 }
+{ "roomNumber": "jacob" }
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/testsuite.xml b/asterix-bad/src/test/resources/runtimets/testsuite.xml
index 12d7d55..1b2844b 100644
--- a/asterix-bad/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-bad/src/test/resources/runtimets/testsuite.xml
@@ -21,60 +21,80 @@
              QueryOffsetPath="queries"
              QueryFileExtension=".sqlpp">
   <test-group name="channel">
-    <test-case FilePath="channel">
-        <compilation-unit name="room_occupants">
-            <output-dir compare="Text">room_occupants</output-dir>
-        </compilation-unit>
+    <test-case FilePath="procedure">
+      <compilation-unit name="delete_procedure">
+        <output-dir compare="Text">delete_procedure</output-dir>
+      </compilation-unit>
     </test-case>
     <test-case FilePath="procedure">
-        <compilation-unit name="insert_procedure">
-            <output-dir compare="Text">insert_procedure</output-dir>
-        </compilation-unit>
+      <compilation-unit name="delete_procedure_with_parameters">
+        <output-dir compare="Text">delete_procedure_with_parameters</output-dir>
+      </compilation-unit>
     </test-case>
     <test-case FilePath="procedure">
-        <compilation-unit name="delete_procedure">
-            <output-dir compare="Text">delete_procedure</output-dir>
-        </compilation-unit>
+      <compilation-unit name="query_procedure">
+        <output-dir compare="Text">query_procedure</output-dir>
+      </compilation-unit>
     </test-case>
     <test-case FilePath="procedure">
-        <compilation-unit name="query_procedure">
-            <output-dir compare="Text">query_procedure</output-dir>
-        </compilation-unit>
+      <compilation-unit name="query_procedure_with_parameters">
+        <output-dir compare="Text">query_procedure_with_parameters</output-dir>
+      </compilation-unit>
     </test-case>
     <test-case FilePath="procedure">
-        <compilation-unit name="repetitive_insert_procedure">
-            <output-dir compare="Text">repetitive_insert_procedure</output-dir>
-        </compilation-unit>
+      <compilation-unit name="insert_procedure">
+        <output-dir compare="Text">insert_procedure</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="procedure">
+      <compilation-unit name="concurrent_procedure">
+        <output-dir compare="Text">concurrent_procedure</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="procedure">
+      <compilation-unit name="repetitive_insert_procedure">
+        <output-dir compare="Text">repetitive_insert_procedure</output-dir>
+      </compilation-unit>
     </test-case>
     <test-case FilePath="channel">
-        <compilation-unit name="create_channel_check_datasets">
-            <output-dir compare="Text">create_channel_check_datasets</output-dir>
-        </compilation-unit>
+      <compilation-unit name="room_occupants">
+        <output-dir compare="Text">room_occupants</output-dir>
+      </compilation-unit>
     </test-case>
     <test-case FilePath="channel">
-        <compilation-unit name="create_channel_check_metadata">
-            <output-dir compare="Text">create_channel_check_metadata</output-dir>
-        </compilation-unit>
+      <compilation-unit name="create_channel_check_datasets">
+        <output-dir compare="Text">create_channel_check_datasets</output-dir>
+      </compilation-unit>
     </test-case>
     <test-case FilePath="channel">
-        <compilation-unit name="drop_channel_check_datasets">
-            <output-dir compare="Text">drop_channel_check_datasets</output-dir>
-        </compilation-unit>
+      <compilation-unit name="create_channel_check_metadata">
+        <output-dir compare="Text">create_channel_check_metadata</output-dir>
+      </compilation-unit>
     </test-case>
     <test-case FilePath="channel">
-        <compilation-unit name="drop_channel_check_metadata">
-            <output-dir compare="Text">drop_channel_check_metadata</output-dir>
-        </compilation-unit>
+      <compilation-unit name="drop_channel_check_datasets">
+        <output-dir compare="Text">drop_channel_check_datasets</output-dir>
+      </compilation-unit>
     </test-case>
     <test-case FilePath="channel">
-        <compilation-unit name="subscribe_channel_check_subscriptions">
-            <output-dir compare="Text">subscribe_channel_check_subscriptions</output-dir>
-        </compilation-unit>
+      <compilation-unit name="drop_channel_check_metadata">
+        <output-dir compare="Text">drop_channel_check_metadata</output-dir>
+      </compilation-unit>
     </test-case>
-    <!-- <test-case FilePath="channel">
-        <compilation-unit name="ten_minute_channel">
-            <output-dir compare="Text">ten_minute_channel</output-dir>
-        </compilation-unit>
-    </test-case> -->
+    <test-case FilePath="channel">
+      <compilation-unit name="subscribe_channel_check_subscriptions">
+        <output-dir compare="Text">subscribe_channel_check_subscriptions</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="channel">
+      <compilation-unit name="disasters_with_friends">
+        <output-dir compare="Text">disasters_with_friends</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="channel">
+      <compilation-unit name="ten_minute_channel">
+        <output-dir compare="Text">ten_minute_channel</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
 </test-suite>