Search in sources :

Example 1 with VertxProjectCodec

use of io.vertx.starter.VertxProjectCodec in project vertx-starter by vert-x3.

the class AnalyticsTest method beforeEach.

@BeforeEach
void beforeEach(Vertx vertx, VertxTestContext testContext) throws IOException {
    vertx.eventBus().registerDefaultCodec(VertxProject.class, new VertxProjectCodec());
    JsonObject config = new JsonObject().put("host", mongo.getContainerIpAddress()).put("port", mongo.getMappedPort(27017));
    client = MongoClient.create(vertx, config);
    DeploymentOptions options = new DeploymentOptions().setConfig(config);
    vertx.deployVerticle(new AnalyticsVerticle(), options, testContext.succeeding(id -> testContext.completeNow()));
}
Also used : VertxTestContext(io.vertx.junit5.VertxTestContext) BeforeEach(org.junit.jupiter.api.BeforeEach) AnalyticsVerticle(io.vertx.starter.AnalyticsVerticle) Testcontainers(org.testcontainers.junit.jupiter.Testcontainers) Vertx(io.vertx.core.Vertx) MongoClient(io.vertx.ext.mongo.MongoClient) IOException(java.io.IOException) VertxExtension(io.vertx.junit5.VertxExtension) Instant(java.time.Instant) VertxProjectCodec(io.vertx.starter.VertxProjectCodec) MongoDBContainer(org.testcontainers.containers.MongoDBContainer) Test(org.junit.jupiter.api.Test) Topics(io.vertx.starter.config.Topics) AfterEach(org.junit.jupiter.api.AfterEach) Stream(java.util.stream.Stream) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) DeploymentOptions(io.vertx.core.DeploymentOptions) MINUTES(java.time.temporal.ChronoUnit.MINUTES) Assertions(org.junit.jupiter.api.Assertions) JsonObject(io.vertx.core.json.JsonObject) Checkpoint(io.vertx.junit5.Checkpoint) VertxProject(io.vertx.starter.model.VertxProject) Container(org.testcontainers.junit.jupiter.Container) AnalyticsVerticle(io.vertx.starter.AnalyticsVerticle) DeploymentOptions(io.vertx.core.DeploymentOptions) VertxProjectCodec(io.vertx.starter.VertxProjectCodec) JsonObject(io.vertx.core.json.JsonObject) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with VertxProjectCodec

use of io.vertx.starter.VertxProjectCodec in project vertx-starter by vert-x3.

the class GeneratorTest method beforeEach.

@BeforeEach
void beforeEach(Vertx vertx, VertxTestContext testContext) throws Exception {
    workdir = tempDir.resolve(UUID.randomUUID().toString());
    Files.createDirectories(workdir);
    cleanupTasks = new ArrayList<>();
    vertx.eventBus().registerDefaultCodec(VertxProject.class, new VertxProjectCodec());
    vertx.deployVerticle(new GeneratorVerticle(), testContext.succeeding(id -> testContext.completeNow()));
}
Also used : VertxTestContext(io.vertx.junit5.VertxTestContext) java.util(java.util) io.vertx.core(io.vertx.core) TarArchiveInputStream(org.apache.commons.compress.archivers.tar.TarArchiveInputStream) Process(com.julienviet.childprocess.Process) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) JdkVersion(io.vertx.starter.model.JdkVersion) KOTLIN(io.vertx.starter.model.Language.KOTLIN) GeneratorVerticle(io.vertx.starter.GeneratorVerticle) VertxProjectCodec(io.vertx.starter.VertxProjectCodec) Utils(io.vertx.core.impl.Utils) Timeout(io.vertx.junit5.Timeout) MAVEN(io.vertx.starter.model.BuildTool.MAVEN) JAVA(io.vertx.starter.model.Language.JAVA) TarArchiveEntry(org.apache.commons.compress.archivers.tar.TarArchiveEntry) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) GRADLE(io.vertx.starter.model.BuildTool.GRADLE) RecordParser(io.vertx.core.parsetools.RecordParser) JsonObject(io.vertx.core.json.JsonObject) Assume(org.junit.Assume) BuildTool(io.vertx.starter.model.BuildTool) Path(java.nio.file.Path) ByteBufInputStream(io.netty.buffer.ByteBufInputStream) GzipCompressorInputStream(org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream) MethodSource(org.junit.jupiter.params.provider.MethodSource) OutputStream(java.io.OutputStream) AssumptionViolatedException(org.junit.AssumptionViolatedException) Assumptions.assumeThat(org.assertj.core.api.Assumptions.assumeThat) Files(java.nio.file.Files) NoStackTraceThrowable(io.vertx.core.impl.NoStackTraceThrowable) TGZ(io.vertx.starter.model.ArchiveFormat.TGZ) IOUtils(org.apache.commons.compress.utils.IOUtils) IOException(java.io.IOException) VertxExtension(io.vertx.junit5.VertxExtension) Util(io.vertx.starter.Util) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) Topics(io.vertx.starter.config.Topics) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Collectors.toList(java.util.stream.Collectors.toList) Stream(java.util.stream.Stream) Buffer(io.vertx.core.buffer.Buffer) Language(io.vertx.starter.model.Language) org.junit.jupiter.api(org.junit.jupiter.api) ProcessOptions(com.julienviet.childprocess.ProcessOptions) VertxProject(io.vertx.starter.model.VertxProject) GeneratorVerticle(io.vertx.starter.GeneratorVerticle) VertxProjectCodec(io.vertx.starter.VertxProjectCodec)

Aggregations

JsonObject (io.vertx.core.json.JsonObject)2 VertxExtension (io.vertx.junit5.VertxExtension)2 VertxTestContext (io.vertx.junit5.VertxTestContext)2 VertxProjectCodec (io.vertx.starter.VertxProjectCodec)2 Topics (io.vertx.starter.config.Topics)2 VertxProject (io.vertx.starter.model.VertxProject)2 IOException (java.io.IOException)2 Stream (java.util.stream.Stream)2 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)2 Process (com.julienviet.childprocess.Process)1 ProcessOptions (com.julienviet.childprocess.ProcessOptions)1 ByteBufInputStream (io.netty.buffer.ByteBufInputStream)1 io.vertx.core (io.vertx.core)1 DeploymentOptions (io.vertx.core.DeploymentOptions)1 Vertx (io.vertx.core.Vertx)1 Buffer (io.vertx.core.buffer.Buffer)1 NoStackTraceThrowable (io.vertx.core.impl.NoStackTraceThrowable)1 Utils (io.vertx.core.impl.Utils)1 RecordParser (io.vertx.core.parsetools.RecordParser)1 MongoClient (io.vertx.ext.mongo.MongoClient)1