STEP-01
class [Link]{
def newServer(): Server = {
doGet()
parseJson()
readRequest()
writeResponse()
writeJson()
}
addGetEndpoint(endPoint: EndPoint)
addPostEndpoint(endPoint: EndPoint)
stop()
start()
serve()
serveWithSize()
serveIncorrectMetadataSize()
loadData()
serveRandom()
addDelayPerRow()
serveData()
uri()
publishUri()
}
def serve(columns: Seq[String], data: Seq[Any]*): String = {
serveData(columns, [Link], data, None)
}
def serve(columns: Seq[String], dsId:String, data: Seq[Any]*): String = {
serveData(columns, [Link], data, Some(dsId))
}
private def serveData(columns: Seq[String], size: Int, data: Seq[Seq[Any]], dsId:Option[String]
= None): String = {
val metadata = ("count" -> size) ~
("metadata" -> (
("@class" -> "[Link]") ~
("name" -> "Dont Really Care") ~
("columns" -> [Link](c => {
("@class" -> "[Link]") ~
("name" -> c) ~
("colType" -> "String")
}))))
val datasetId = [Link]([Link]().toString)
[Link](datasetId, (metadata, [Link](_.map({
case null => JNull
case s: String => JString(s)
case i: Int => JInt(i)
case d: Double => JDouble(d)
case c: Char => JString([Link])
case b: Boolean => JBool(b)
case d: DateTime => JObject("type" -> JString("DateTime"), "value" -> JString([Link]))
}))))
if (server == null) start()
datasetId
}
STEP-02
trait PipelineTestTrait extends FreeSpec with Matchers with Assertions with
BeforeAndAfterEachTestData with BeforeAndAfterAll
beforeAll(){[Link](appender)}
beforeEach(td:TestData){dataServer = [Link]()}
afterEach(td:TestData){[Link]()}
STEP-03
[Link] extends Eventually{
def runScript[T <: ExecutionResult](action: ExecutableScriptAction[T]): T = {
runAPI(uri, action, makeDummyRequestParams())
}
def uri = [Link]()
def uriBuilder = new
URIBuilder().setScheme("http").setHost([Link]).setPort(CommonTestCons
[Link])
parseView()
parseFacet()
parseFacet30()
parseHistogram2()
parseRow()
parseProfiles()
}
STEP-04 ::: squishly/[Link]
package object squishly {
defaultAuthToken
valueOrNot()
stringFilter()
numberFilter()
datetimeFilter()
percentilesFilter()
sourcesFilter()
libraryOptions()
datagenOptions()
script()
getColNameForPivot()
quoted()
trait CanBuildPipelinesAndActions{}
class ProfileOptions {}
class SquishlyLibraryImportOptions()
class SquishlyDirectImportOptions()
}
STEP-06 ::: [Link] and [Link]
C:\pr_testing\pax\shared\pipeline-
client\src\main\scala\com\paxata\pipeline\generator\[Link]
C:\pr_testing\pax\shared\pipeline-
client\src\main\scala\com\paxata\pipeline\generator\[Link]
C:\pr_testing\pax\shared\pipeline-
client\src\main\scala\com\paxata\pipeline\generator\impl\action\[Link]
STEP-07
class AppendTest extends PipelineTestTrait {
val baseTableId = [Link](baseTableColumns,Seq("Mickey"))
val appendTableId = [Link](appendTableColumns,Seq("Donald"))
val view = runScript(script(appendPipelineId, pna => {
val bId = "importBaseTablePipeline"
[Link](bId)(steps => {
[Link](baseTableColumns, libraryOptions(baseTableId,dataServer))
})
C:\pr_testing\pax\integration-
tests\squishly\src\test\scala\com\paxata\pipeline\squishly\[Link]
At line no. 77, val server = new Server(new InetSocketAddress("[Link]",5000))
C:\pr_testing\pax\integration-
tests\squishly\src\test\scala\com\paxata\pipeline\squishly\[Link]
At line no. 38, def PipelineHost = "[Link]"
At line no. 40, def PipelinePort:Int = 8800
C:\pr_testing\pax\integration-
tests\squishly\src\test\scala\com\paxata\pipeline\squishly\[Link]
def uriBuilder = new
URIBuilder().setScheme("http").setHost([Link]).setPort(CommonTestCons
[Link]).setCustomQuery("?pp_numOfExecutors=1&pp_inactivityThresholdMinutes=3&pp_pip
elineUniqueId=QSSD")
C:\pr_testing\pax\shared\pipeline-
client\src\main\scala\com\paxata\pipeline\generator\[Link]
replace /get with get