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