aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/scala/org/apache
diff options
context:
space:
mode:
authorHolden Karau <holden@us.ibm.com>2016-08-08 15:54:03 -0700
committerMarcelo Vanzin <vanzin@cloudera.com>2016-08-08 15:54:03 -0700
commit9216901d52c9c763bfb908013587dcf5e781f15b (patch)
tree7e6e639340f1aef0048e586aa055b97470cafb42 /core/src/test/scala/org/apache
parent8650239050ade91689ffa0672ea094de2594e37c (diff)
downloadspark-9216901d52c9c763bfb908013587dcf5e781f15b.tar.gz
spark-9216901d52c9c763bfb908013587dcf5e781f15b.tar.bz2
spark-9216901d52c9c763bfb908013587dcf5e781f15b.zip
[SPARK-16779][TRIVIAL] Avoid using postfix operators where they do not add much and remove whitelisting
## What changes were proposed in this pull request? Avoid using postfix operation for command execution in SQLQuerySuite where it wasn't whitelisted and audit existing whitelistings removing postfix operators from most places. Some notable places where postfix operation remains is in the XML parsing & time units (seconds, millis, etc.) where it arguably can improve readability. ## How was this patch tested? Existing tests. Author: Holden Karau <holden@us.ibm.com> Closes #14407 from holdenk/SPARK-16779.
Diffstat (limited to 'core/src/test/scala/org/apache')
-rw-r--r--core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala1
-rw-r--r--core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala1
-rw-r--r--core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala4
-rw-r--r--core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala1
4 files changed, 2 insertions, 5 deletions
diff --git a/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala b/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
index 5e2ba311ee..5f59c176ab 100644
--- a/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
+++ b/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
@@ -22,7 +22,6 @@ import java.util.concurrent.{ExecutorService, TimeUnit}
import scala.collection.Map
import scala.collection.mutable
import scala.concurrent.duration._
-import scala.language.postfixOps
import org.mockito.Matchers
import org.mockito.Matchers._
diff --git a/core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala
index 4ab000b53a..e3304be792 100644
--- a/core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala
+++ b/core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala
@@ -23,7 +23,6 @@ import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
-import scala.language.postfixOps
import com.codahale.metrics.Counter
import com.google.common.cache.LoadingCache
diff --git a/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala b/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala
index 59b90974ae..387f3e2502 100644
--- a/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala
+++ b/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala
@@ -21,7 +21,6 @@ import java.io.File
import scala.collection.Map
import scala.io.Codec
-import scala.language.postfixOps
import scala.sys.process._
import scala.util.Try
@@ -215,7 +214,8 @@ class PipedRDDSuite extends SparkFunSuite with SharedSparkContext {
}
def testCommandAvailable(command: String): Boolean = {
- Try(Process(command) !!).isSuccess
+ val attempt = Try(Process(command).run().exitValue())
+ attempt.isSuccess && attempt.get == 0
}
def testExportInputFile(varName: String) {
diff --git a/core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala b/core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala
index 145d432afe..c11de82667 100644
--- a/core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala
+++ b/core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala
@@ -20,7 +20,6 @@ package org.apache.spark.storage
import java.nio.ByteBuffer
import scala.language.implicitConversions
-import scala.language.postfixOps
import scala.language.reflectiveCalls
import scala.reflect.ClassTag