Redeploy channels and procedures during recovery

Use the GlobalRecoveryManager extension to redeploy channels/procedures
Restart execution of channels during recovery
Some code cleanup
Added recovery test

Change-Id: I6897ccf9cddb9ec8d10256e252ee893afe6db145
diff --git a/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADAsterixHyracksIntegrationUtil.java b/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADAsterixHyracksIntegrationUtil.java
index 0a2beed..aa1f17b 100644
--- a/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADAsterixHyracksIntegrationUtil.java
+++ b/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADAsterixHyracksIntegrationUtil.java
@@ -19,7 +19,6 @@
 package org.apache.asterix.bad.test;
 
 import org.apache.asterix.api.common.AsterixHyracksIntegrationUtil;
-import org.apache.asterix.common.config.GlobalConfig;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
@@ -36,6 +35,7 @@
         }
     }
 
+    @Override
     protected void run(boolean cleanupOnStart, boolean cleanupOnShutdown, String loadExternalLibs) throws Exception {
         Runtime.getRuntime().addShutdownHook(new Thread() {
             @Override
diff --git a/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADListenerTest.java b/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADListenerTest.java
index 1cd49e3..8dbfc6d 100644
--- a/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADListenerTest.java
+++ b/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADListenerTest.java
@@ -68,7 +68,7 @@
     public static void init() {
         djsel = new DeployedJobSpecEventListener(null,
                 new EntityId(BADConstants.CHANNEL_EXTENSION_NAME, "test", "test"),
-                DeployedJobSpecEventListener.PrecompiledType.CHANNEL, null, "BadListener");
+                DeployedJobSpecEventListener.PrecompiledType.CHANNEL);
     }
 
     @Test
diff --git a/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADRecoveryTest.java b/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADRecoveryTest.java
new file mode 100644
index 0000000..b62e4b9
--- /dev/null
+++ b/asterix-bad/src/test/java/org/apache/asterix/bad/test/BADRecoveryTest.java
@@ -0,0 +1,140 @@
+/*
+ * 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.
+ */
+package org.apache.asterix.bad.test;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.asterix.test.common.TestExecutor;
+import org.apache.asterix.testframework.context.TestCaseContext;
+import org.apache.commons.io.FileUtils;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+@RunWith(Parameterized.class)
+public class BADRecoveryTest {
+
+    private static final java.util.logging.Logger LOGGER =
+            java.util.logging.Logger.getLogger(BADRecoveryTest.class.getName());
+
+    private static final String PATH_ACTUAL = "target" + File.separator + "rttest" + File.separator;
+    private static final String PATH_BASE = "src/test/resources/recoveryts/";
+    private TestCaseContext tcCtx;
+    private static ProcessBuilder pb;
+    private static Map<String, String> env;
+    private final TestExecutor testExecutor = new TestExecutor();
+    private static int testNumber;
+    private static File asterixInstallerPath;
+    private static File installerTargetPath;
+    private static String ncServiceHomeDirName;
+    private static String ncServiceHomePath;
+    private static String scriptHomePath;
+    private static String reportPath;
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        File outdir = new File(PATH_ACTUAL);
+        outdir.mkdirs();
+
+        asterixInstallerPath = new File(System.getProperty("user.dir"));
+        installerTargetPath =
+                new File(new File(asterixInstallerPath.getParentFile().getParentFile(), "asterix-server"), "target");
+        reportPath = new File(installerTargetPath, "failsafe-reports").getAbsolutePath();
+        ncServiceHomeDirName = installerTargetPath.list(new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return new File(dir, name).isDirectory() && name.startsWith("asterix-server")
+                        && name.endsWith("binary-assembly");
+            }
+        })[0];
+        ncServiceHomePath = new File(installerTargetPath, ncServiceHomeDirName).getAbsolutePath();
+
+        pb = new ProcessBuilder();
+        env = pb.environment();
+        env.put("JAVA_HOME", System.getProperty("java.home"));
+        //Create the folder to run asterix with extensions
+        String asterixInstallerTarget = asterixInstallerPath + File.separator + "target";
+        Process p = Runtime.getRuntime().exec("cp -R " + ncServiceHomePath + " " + asterixInstallerTarget);
+        p.waitFor();
+
+        ncServiceHomePath = asterixInstallerTarget + File.separator + ncServiceHomeDirName;
+
+        String confDir = File.separator + "opt" + File.separator + "local" + File.separator + "conf" + File.separator;
+        p = Runtime.getRuntime().exec("rm " + ncServiceHomePath + confDir + "cc.conf");
+        p.waitFor();
+
+        String BADconf = asterixInstallerPath + File.separator + "src" + File.separator + "main" + File.separator
+                + "resources" + File.separator + "cc.conf";
+        p = Runtime.getRuntime().exec("cp " + BADconf + " " + ncServiceHomePath + confDir);
+        p.waitFor();
+
+        LOGGER.info("NCSERVICE_HOME=" + ncServiceHomePath);
+        env.put("NCSERVICE_HOME", ncServiceHomePath);
+        env.put("JAVA_HOME", System.getProperty("java.home"));
+        scriptHomePath = asterixInstallerPath + File.separator + "src" + File.separator + "test" + File.separator
+                + "resources" + File.separator + "recoveryts" + File.separator + "scripts";
+        env.put("SCRIPT_HOME", scriptHomePath);
+
+        TestExecutor.executeScript(pb,
+                scriptHomePath + File.separator + "setup_teardown" + File.separator + "stop_and_delete.sh");
+
+        TestExecutor.executeScript(pb,
+                scriptHomePath + File.separator + "setup_teardown" + File.separator + "configure_and_validate.sh");
+
+    }
+
+    @AfterClass
+    public static void tearDown() throws Exception {
+        TestExecutor.executeScript(pb,
+                scriptHomePath + File.separator + "setup_teardown" + File.separator + "stop_and_delete.sh");
+        File outdir = new File(PATH_ACTUAL);
+        FileUtils.deleteDirectory(outdir);
+        File dataCopyDir = new File(ncServiceHomePath);
+        FileUtils.deleteDirectory(dataCopyDir);
+
+    }
+
+    @Parameters(name = "RecoveryIT {index}: {0}")
+    public static Collection<Object[]> tests() throws Exception {
+        Collection<Object[]> testArgs = new ArrayList<Object[]>();
+        TestCaseContext.Builder b = new TestCaseContext.Builder();
+        for (TestCaseContext ctx : b.build(new File(PATH_BASE))) {
+            testArgs.add(new Object[] { ctx });
+        }
+        return testArgs;
+    }
+
+    public BADRecoveryTest(TestCaseContext tcCtx) {
+        this.tcCtx = tcCtx;
+    }
+
+
+    @Test
+    public void test() throws Exception {
+        testExecutor.executeTest(PATH_ACTUAL, tcCtx, pb, false);
+    }
+
+}
diff --git a/asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.1.ddl.sqlpp b/asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.1.ddl.sqlpp
new file mode 100644
index 0000000..bab0849
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.1.ddl.sqlpp
@@ -0,0 +1,71 @@
+/*
+ * 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  : Restart cluster and confirm that channels and procedures still work
+* Expected Res : Success
+* Date         : 2018
+* Author       : Steven Jacobs
+*/
+
+drop dataverse two if exists;
+drop dataverse channels if exists;
+create dataverse channels;
+use channels;
+
+create type userLocation as {
+  userId: int,
+  roomNumber: int
+};
+
+create dataset UserLocations(userLocation)
+primary key 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("PT5S");
+
+create procedure selectSome(r) {
+select roomNumber from channels.UserLocations
+where roomNumber = r
+order by userId
+};
+
+create procedure deleteSome(r) {
+delete from channels.UserLocations
+where roomNumber = r
+};
+
+create procedure addMe() {
+  insert into channels.UserLocations([
+    {"userId":2, "roomNumber":123}]
+  )
+};
+
+upsert into UserLocations([
+{"userId":1, "roomNumber":123},
+{"userId":3, "roomNumber":350}]
+);
+
+create repetitive channel roomRecords2 using RoomOccupants@1 period duration("PT5S");
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.10.update.sqlpp
similarity index 87%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.10.update.sqlpp
index aa0722a..65386e7 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.10.update.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that procedure still works after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
 
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+execute addMe();
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.11.query.sqlpp
similarity index 86%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.11.query.sqlpp
index aa0722a..f72d947 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.11.query.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that procedure still works after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
 
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+execute selectSome(123);
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.12.update.sqlpp
similarity index 86%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.12.update.sqlpp
index aa0722a..00a6277 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.12.update.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that procedure still works after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
 
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+execute deleteSome(123);
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.13.query.sqlpp
similarity index 86%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.13.query.sqlpp
index aa0722a..f72d947 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.13.query.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that procedure still works after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
 
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+execute selectSome(123);
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.14.ddl.sqlpp
similarity index 84%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.14.ddl.sqlpp
index aa0722a..dc023c4 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.14.ddl.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that channel is still running after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
-
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+drop channel roomRecords;
+drop channel roomRecords2;
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.2.script.sqlpp b/asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.2.script.sqlpp
new file mode 100644
index 0000000..8fd9780
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.2.script.sqlpp
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# 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.
+stop_and_start.sh
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.3.query.sqlpp
similarity index 84%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.3.query.sqlpp
index aa0722a..4b866e6 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.3.query.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that channel is still running after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
-
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+array_count((select *
+from roomRecordsResults result));
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.4.query.sqlpp
similarity index 84%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.4.query.sqlpp
index aa0722a..9408860 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.4.query.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that channel is still running after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
-
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+array_count((select *
+from roomRecords2Results result));
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.5.update.sqlpp
similarity index 81%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.5.update.sqlpp
index aa0722a..9a3931b 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.5.update.sqlpp
@@ -16,12 +16,7 @@
  * 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
+
+subscribe to roomRecords (123) on brokerA;
+subscribe to roomRecords2 (123) on brokerA;
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.6.sleep.sqlpp
similarity index 86%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.6.sleep.sqlpp
index aa0722a..e3641a0 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.6.sleep.sqlpp
@@ -17,11 +17,9 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that channel is still running after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
-
-use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+8000
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.7.query.sqlpp
similarity index 83%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.7.query.sqlpp
index aa0722a..3fb2ebc 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.7.query.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that channel is still running after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
-
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+array_count((select *
+from roomRecordsResults result)) > 0;
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.8.query.sqlpp
similarity index 83%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.8.query.sqlpp
index aa0722a..051738e 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.8.query.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that channel is still running after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
-
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+array_count((select *
+from roomRecords2Results result)) > 0;
\ 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.9.query.sqlpp
similarity index 86%
copy from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
copy to asterix-bad/src/test/resources/recoveryts/queries/recovery/restart_cluster/restart_cluster.9.query.sqlpp
index aa0722a..f72d947 100644
--- 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/recoveryts/queries/recovery/restart_cluster/restart_cluster.9.query.sqlpp
@@ -17,11 +17,12 @@
  * under the License.
  */
 /*
-* Description  : Simple Query Procedure with parameters
+* Description  : Confirm that procedure still works after cluster restart
 * Expected Res : Success
-* Date         : May 2017
+* Date         : May 2018
 * Author       : Steven Jacobs
 */
 
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+
+execute selectSome(123);
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.11.adm b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.11.adm
new file mode 100644
index 0000000..acbb918
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.11.adm
@@ -0,0 +1,2 @@
+{ "roomNumber": 123 }
+{ "roomNumber": 123 }
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.13.adm b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.13.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.13.adm
diff --git a/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.3.adm b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.3.adm
new file mode 100644
index 0000000..c227083
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.3.adm
@@ -0,0 +1 @@
+0
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.4.adm b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.4.adm
new file mode 100644
index 0000000..c227083
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.4.adm
@@ -0,0 +1 @@
+0
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.7.adm b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.7.adm
new file mode 100644
index 0000000..f32a580
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.7.adm
@@ -0,0 +1 @@
+true
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.8.adm b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.8.adm
new file mode 100644
index 0000000..f32a580
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.8.adm
@@ -0,0 +1 @@
+true
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.9.adm b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.9.adm
new file mode 100644
index 0000000..30ffd5c
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/results/recovery/restart_cluster/restart_cluster.9.adm
@@ -0,0 +1 @@
+{ "roomNumber": 123 }
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/scripts/recovery/restart_cluster/stop_and_start.sh b/asterix-bad/src/test/resources/recoveryts/scripts/recovery/restart_cluster/stop_and_start.sh
new file mode 100755
index 0000000..a1d7114
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/scripts/recovery/restart_cluster/stop_and_start.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# 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.
+$NCSERVICE_HOME/opt/local/bin/stop-sample-cluster.sh;
+$NCSERVICE_HOME/opt/local/bin/start-sample-cluster.sh;
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/scripts/setup_teardown/configure_and_validate.sh b/asterix-bad/src/test/resources/recoveryts/scripts/setup_teardown/configure_and_validate.sh
new file mode 100755
index 0000000..ab09dd2
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/scripts/setup_teardown/configure_and_validate.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# 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.
+$NCSERVICE_HOME/opt/local/bin/start-sample-cluster.sh;
diff --git a/asterix-bad/src/test/resources/recoveryts/scripts/setup_teardown/stop_and_delete.sh b/asterix-bad/src/test/resources/recoveryts/scripts/setup_teardown/stop_and_delete.sh
new file mode 100755
index 0000000..99db8b2
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/scripts/setup_teardown/stop_and_delete.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# 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.
+$NCSERVICE_HOME/opt/local/bin/stop-sample-cluster.sh -f;
+rm -rf $NCSERVICE_HOME/opt/local/data;
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/recoveryts/testsuite.xml b/asterix-bad/src/test/resources/recoveryts/testsuite.xml
new file mode 100644
index 0000000..c549a3e
--- /dev/null
+++ b/asterix-bad/src/test/resources/recoveryts/testsuite.xml
@@ -0,0 +1,30 @@
+<!--
+ ! 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.
+ !-->
+<test-suite  xmlns="urn:xml.testframework.asterix.apache.org"
+             ResultOffsetPath="results"
+             QueryOffsetPath="queries"
+             QueryFileExtension=".sqlpp">
+  <test-group name="recovery">
+    <test-case FilePath="recovery">
+      <compilation-unit name="restart_cluster">
+        <output-dir compare="Text">restart_cluster</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+</test-suite>
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.query.sqlpp
similarity index 100%
rename from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.update.sqlpp
rename to asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.3.query.sqlpp
diff --git a/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.sqlpp b/asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.query.sqlpp
similarity index 100%
rename from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.update.sqlpp
rename to asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure/query_procedure.5.query.sqlpp
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.query.sqlpp
similarity index 100%
rename from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.2.update.sqlpp
rename to asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.2.query.sqlpp
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.query.sqlpp
similarity index 95%
rename from asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.update.sqlpp
rename to asterix-bad/src/test/resources/runtimets/queries/procedure/query_procedure_with_parameters/query_procedure_with_parameters.3.query.sqlpp
index aa0722a..e5152e8 100644
--- 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.query.sqlpp
@@ -24,4 +24,4 @@
 */
 
 use channels;
-execute selectSome(108,"jacob");
\ No newline at end of file
+execute selectSome(4815162342,"jacob");
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/create_procedure_check_metadata/create_procedure_check_metadata.1.adm b/asterix-bad/src/test/resources/runtimets/results/procedure/create_procedure_check_metadata/create_procedure_check_metadata.1.adm
index c41aec1..1f55577 100644
--- a/asterix-bad/src/test/resources/runtimets/results/procedure/create_procedure_check_metadata/create_procedure_check_metadata.1.adm
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/create_procedure_check_metadata/create_procedure_check_metadata.1.adm
@@ -1,6 +1,6 @@
-{ "DataverseName": "two", "ProcedureName": "addMe", "Arity": "0", "Params": [  ], "ReturnType": "VOID", "Definition": "use two;\ninsert into channels.UserLocations([\n    {\"timeStamp\":current_datetime(), \"roomNumber\":222}]\n  );", "Language": "AQL", "Duration": "", "Dependencies": [ [ [ "channels", "UserLocations" ] ], [  ] ] }
-{ "DataverseName": "two", "ProcedureName": "deleteSome", "Arity": "2", "Params": [ "r", "otherRoom" ], "ReturnType": "VOID", "Definition": "use two;\ndelete from channels.UserLocations\nwhere roomNumber = get_job_param(\"r\")\nor roomNumber = get_job_param(\"otherRoom\")\nand channels.really_contains(roomNumber,\"l\");", "Language": "AQL", "Duration": "", "Dependencies": [ [ [ "channels", "UserLocations" ] ], [ [ "channels", "really_contains", "2" ], [ "two", "get_job_param", "1" ], [ "two", "get_job_param", "1" ] ] ] }
-{ "DataverseName": "two", "ProcedureName": "localAddMe", "Arity": "0", "Params": [  ], "ReturnType": "VOID", "Definition": "use two;\ninsert into UserLocations([\n    {\"timeStamp\":current_datetime(), \"roomNumber\":222}]\n  );", "Language": "AQL", "Duration": "", "Dependencies": [ [ [ "two", "UserLocations" ] ], [  ] ] }
-{ "DataverseName": "two", "ProcedureName": "localDeleteSome", "Arity": "2", "Params": [ "r", "otherRoom" ], "ReturnType": "VOID", "Definition": "use two;\ndelete from UserLocations\nwhere roomNumber = get_job_param(\"r\")\nor roomNumber = get_job_param(\"otherRoom\")\nand really_contains(roomNumber,\"l\");", "Language": "AQL", "Duration": "", "Dependencies": [ [ [ "two", "UserLocations" ] ], [ [ "two", "get_job_param", "1" ], [ "two", "really_contains", "2" ], [ "two", "get_job_param", "1" ] ] ] }
-{ "DataverseName": "two", "ProcedureName": "localSelectSome", "Arity": "2", "Params": [ "r", "otherRoom" ], "ReturnType": "VOID", "Definition": "use two;\nselect roomNumber from UserLocations\nwhere roomNumber = get_job_param(\"r\")\nor roomNumber = get_job_param(\"otherRoom\")\nand really_contains(roomNumber,\"l\")\norder by id;", "Language": "AQL", "Duration": "", "Dependencies": [ [ [ "two", "UserLocations" ] ], [ [ "two", "get_job_param", "1" ], [ "two", "really_contains", "2" ], [ "two", "get_job_param", "1" ] ] ] }
-{ "DataverseName": "two", "ProcedureName": "selectSome", "Arity": "2", "Params": [ "r", "otherRoom" ], "ReturnType": "VOID", "Definition": "use two;\nselect roomNumber from channels.UserLocations\nwhere roomNumber = get_job_param(\"r\")\nor roomNumber = get_job_param(\"otherRoom\")\nand channels.really_contains(roomNumber,\"l\")\norder by id;", "Language": "AQL", "Duration": "", "Dependencies": [ [ [ "channels", "UserLocations" ] ], [ [ "channels", "really_contains", "2" ], [ "two", "get_job_param", "1" ], [ "two", "get_job_param", "1" ] ] ] }
\ No newline at end of file
+{ "DataverseName": "two", "ProcedureName": "addMe", "Arity": "0", "Params": [  ], "Type": "INSERT", "Definition": "use two;\ninsert into channels.UserLocations([\n    {\"timeStamp\":current_datetime(), \"roomNumber\":222}]\n  );", "Language": "SQLPP", "Duration": "", "Dependencies": [ [ [ "channels", "UserLocations" ] ], [  ] ] }
+{ "DataverseName": "two", "ProcedureName": "deleteSome", "Arity": "2", "Params": [ "r", "otherRoom" ], "Type": "DELETE", "Definition": "use two;\ndelete from channels.UserLocations\nwhere roomNumber = get_job_param(\"r\")\nor roomNumber = get_job_param(\"otherRoom\")\nand channels.really_contains(roomNumber,\"l\");", "Language": "SQLPP", "Duration": "", "Dependencies": [ [ [ "channels", "UserLocations" ] ], [ [ "channels", "really_contains", "2" ], [ "two", "get_job_param", "1" ], [ "two", "get_job_param", "1" ] ] ] }
+{ "DataverseName": "two", "ProcedureName": "localAddMe", "Arity": "0", "Params": [  ], "Type": "INSERT", "Definition": "use two;\ninsert into UserLocations([\n    {\"timeStamp\":current_datetime(), \"roomNumber\":222}]\n  );", "Language": "SQLPP", "Duration": "", "Dependencies": [ [ [ "two", "UserLocations" ] ], [  ] ] }
+{ "DataverseName": "two", "ProcedureName": "localDeleteSome", "Arity": "2", "Params": [ "r", "otherRoom" ], "Type": "DELETE", "Definition": "use two;\ndelete from UserLocations\nwhere roomNumber = get_job_param(\"r\")\nor roomNumber = get_job_param(\"otherRoom\")\nand really_contains(roomNumber,\"l\");", "Language": "SQLPP", "Duration": "", "Dependencies": [ [ [ "two", "UserLocations" ] ], [ [ "two", "get_job_param", "1" ], [ "two", "really_contains", "2" ], [ "two", "get_job_param", "1" ] ] ] }
+{ "DataverseName": "two", "ProcedureName": "localSelectSome", "Arity": "2", "Params": [ "r", "otherRoom" ], "Type": "QUERY", "Definition": "use two;\nselect roomNumber from UserLocations\nwhere roomNumber = get_job_param(\"r\")\nor roomNumber = get_job_param(\"otherRoom\")\nand really_contains(roomNumber,\"l\")\norder by id;", "Language": "SQLPP", "Duration": "", "Dependencies": [ [ [ "two", "UserLocations" ] ], [ [ "two", "get_job_param", "1" ], [ "two", "really_contains", "2" ], [ "two", "get_job_param", "1" ] ] ] }
+{ "DataverseName": "two", "ProcedureName": "selectSome", "Arity": "2", "Params": [ "r", "otherRoom" ], "Type": "QUERY", "Definition": "use two;\nselect roomNumber from channels.UserLocations\nwhere roomNumber = get_job_param(\"r\")\nor roomNumber = get_job_param(\"otherRoom\")\nand channels.really_contains(roomNumber,\"l\")\norder by id;", "Language": "SQLPP", "Duration": "", "Dependencies": [ [ [ "channels", "UserLocations" ] ], [ [ "channels", "really_contains", "2" ], [ "two", "get_job_param", "1" ], [ "two", "get_job_param", "1" ] ] ] }
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.3.adm b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.3.adm
index 6dd90d2..7b188e8 100644
--- a/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.3.adm
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.3.adm
@@ -1 +1 @@
-222
\ No newline at end of file
+{ "roomNumber": 222 }
\ No newline at end of file
diff --git a/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.5.adm b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.5.adm
index b1d4fa9..7de1800 100644
--- a/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.5.adm
+++ b/asterix-bad/src/test/resources/runtimets/results/procedure/query_procedure/query_procedure.5.adm
@@ -1,2 +1,2 @@
-222
-225
\ No newline at end of file
+{ "roomNumber": 222 }
+{ "roomNumber": 225 }
\ 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
index bee5525..298d0c5 100644
--- 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
@@ -1,2 +1,2 @@
-{ "roomNumber": 108 }
+{ "roomNumber": 4815162342 }
 { "roomNumber": "jacob" }
\ No newline at end of file