-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mvrpl
committed
Apr 22, 2017
1 parent
04f92d3
commit 6a5a04a
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
package shipper | ||
|
||
import java.io._ | ||
import org.tsers.zeison.Zeison | ||
import org.scalatest.FunSuite | ||
import com.holdenkarau.spark.testing.SharedSparkContext | ||
|
||
class BigShipperTests extends FunSuite with SharedSparkContext{ | ||
import org.apache.spark.sql.types._ | ||
System.setProperty("loglevel", "ERROR") | ||
System.setProperty("loglevel", "FATAL") | ||
test("Checked utils.makeSchema") { | ||
val loader = new Loader(sc) | ||
val expected = new StructType(Array(StructField("field1",IntegerType,true), StructField("field2",StringType,true), StructField("field3",BooleanType,true), StructField("field4",TimestampType,true), StructField("field5",FloatType,true))) | ||
val result = loader.utils.makeSchema("field1:int,field2:string,field3:boolean,field4:date,field5:float") | ||
assert(result == expected) | ||
} | ||
test("Checked utils.fieldTypeInSchema") { | ||
val loader = new Loader(sc) | ||
val expected = LongType | ||
val result = loader.utils.fieldTypeInSchema("bigint") | ||
assert(result == expected) | ||
} | ||
} |