forked from ShellRechargeSolutionsEU/docile-charge-point
-
Notifications
You must be signed in to change notification settings - Fork 1
/
TestScript.scala
59 lines (46 loc) · 1.82 KB
/
TestScript.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.net.URI
import com.thenewmotion.ocpp.messages.v1x._
import scala.language.postfixOps
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext
import scala.util.Random
import java.time._
import com.typesafe.scalalogging.Logger
import org.slf4j.LoggerFactory
import chargepoint.docile.dsl.{AwaitTimeout, AwaitTimeoutInMillis}
import chargepoint.docile.dsl.Randomized._
import chargepoint.docile.test.{RunOnce, Runner, RunnerConfig, TestCase}
import com.thenewmotion.ocpp.Version
import javax.net.ssl.SSLContext
object Main extends App {
val test = new chargepoint.docile.dsl.Ocpp1XTest with chargepoint.docile.dsl.Ocpp1XTest.V1XOps {
implicit val executionContext: ExecutionContext = ExecutionContext.global
implicit val csmsMessageTypes = com.thenewmotion.ocpp.VersionFamily.V1XCentralSystemMessages
implicit val csMessageTypes = com.thenewmotion.ocpp.VersionFamily.V1XChargePointMessages
private implicit val rand: Random = new Random()
def run(defaultAwaitTimeout: AwaitTimeout) {
implicit val awaitTimeout: AwaitTimeout = defaultAwaitTimeout;
// INSERT SCRIPT HERE
// for example:
//
// say("going to send heartbeat...")
// heartbeat()
// say("heartbeat request sent and response received!")
say("going to send heartbeat...")
heartbeat()
say("heartbeat request sent and response received!")
}
}
val testCase = TestCase("the single autocomplete test", () => test)
val runner = new Runner(Seq(testCase))
runner.run(RunnerConfig(
number = 1,
chargePointId = "reintest01",
uri = new URI("ws://compliancy.ihomer.nl:9090"),
ocppVersion = Version.V16,
authKey = None,
repeat = RunOnce,
defaultAwaitTimeout = AwaitTimeoutInMillis(60000),
sslContext = SSLContext.getDefault
))
}