aboutsummaryrefslogtreecommitdiff
path: root/R/pkg/inst/tests/testthat/packageInAJarTest.R
diff options
context:
space:
mode:
authorSun Rui <rui.sun@intel.com>2015-12-07 10:38:17 -0800
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2015-12-07 10:38:17 -0800
commit39d677c8f1ee7ebd7e142bec0415cf8f90ac84b6 (patch)
treea4e8d1cb04e4956d0157819402d88977ab248d89 /R/pkg/inst/tests/testthat/packageInAJarTest.R
parent9cde7d5fa87e7ddfff0b9c1212920a1d9000539b (diff)
downloadspark-39d677c8f1ee7ebd7e142bec0415cf8f90ac84b6.tar.gz
spark-39d677c8f1ee7ebd7e142bec0415cf8f90ac84b6.tar.bz2
spark-39d677c8f1ee7ebd7e142bec0415cf8f90ac84b6.zip
[SPARK-12034][SPARKR] Eliminate warnings in SparkR test cases.
This PR: 1. Suppress all known warnings. 2. Cleanup test cases and fix some errors in test cases. 3. Fix errors in HiveContext related test cases. These test cases are actually not run previously due to a bug of creating TestHiveContext. 4. Support 'testthat' package version 0.11.0 which prefers that test cases be under 'tests/testthat' 5. Make sure the default Hadoop file system is local when running test cases. 6. Turn on warnings into errors. Author: Sun Rui <rui.sun@intel.com> Closes #10030 from sun-rui/SPARK-12034.
Diffstat (limited to 'R/pkg/inst/tests/testthat/packageInAJarTest.R')
-rw-r--r--R/pkg/inst/tests/testthat/packageInAJarTest.R30
1 files changed, 30 insertions, 0 deletions
diff --git a/R/pkg/inst/tests/testthat/packageInAJarTest.R b/R/pkg/inst/tests/testthat/packageInAJarTest.R
new file mode 100644
index 0000000000..207a37a0cb
--- /dev/null
+++ b/R/pkg/inst/tests/testthat/packageInAJarTest.R
@@ -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.
+#
+library(SparkR)
+library(sparkPackageTest)
+
+sc <- sparkR.init()
+
+run1 <- myfunc(5L)
+
+run2 <- myfunc(-4L)
+
+sparkR.stop()
+
+if(run1 != 6) quit(save = "no", status = 1)
+
+if(run2 != -3) quit(save = "no", status = 1)