From 270f50d7ae708354b51c826cbe420db52330c1b3 Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 19 Oct 2023 18:51:39 +0200 Subject: [PATCH 01/13] JUnit5 support for testkit typed --- .../typed/annotations/JUnit5TestKit.java | 25 ++++++ .../typed/javadsl/JUnit5TestKitBuilder.scala | 56 +++++++++++++ .../typed/javadsl/LogCapturingExtension.scala | 53 ++++++++++++ .../javadsl/TestKitJUnit5Extension.scala | 49 +++++++++++ .../javadsl/JUnit5IntegrationExampleTest.java | 60 +++++++++++++ ....java => JUnitIntegrationExampleTest.java} | 2 +- .../LogCapturingExtensionExampleTest.java | 49 +++++++++++ .../typed/javadsl/ActorTestKitJUnit5Test.java | 73 ++++++++++++++++ .../src/test/resources/application.conf | 1 + .../testkit/typed/scaladsl/GreeterMain.scala | 62 ++++++++++++++ .../scaladsl/JUnit5TestKitBuilderSpec.scala | 84 +++++++++++++++++++ .../actor/typed/internal/jfr/Events.scala | 5 +- project/Dependencies.scala | 5 ++ 13 files changed, 521 insertions(+), 3 deletions(-) create mode 100644 actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java create mode 100644 actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala create mode 100644 actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala create mode 100644 actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala create mode 100644 actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java rename actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/{JunitIntegrationExampleTest.java => JUnitIntegrationExampleTest.java} (97%) create mode 100644 actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java create mode 100644 actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java create mode 100644 actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/GreeterMain.scala create mode 100644 actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala diff --git a/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java b/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java new file mode 100644 index 00000000000..cb6f7ed684d --- /dev/null +++ b/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.pekko.actor.testkit.typed.annotations; + +import java.lang.annotation.*; + +@Documented +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface JUnit5TestKit {} diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala new file mode 100644 index 00000000000..f908172cb0b --- /dev/null +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.pekko.actor.testkit.typed.javadsl + +import org.apache.pekko +import com.typesafe.config.Config +import pekko.actor.testkit.typed.internal.TestKitUtils +import pekko.actor.testkit.typed.scaladsl.ActorTestKit.ApplicationTestConfig +import pekko.actor.typed.ActorSystem + +final class JUnit5TestKitBuilder() { + + var system: Option[ActorSystem[_]] = None + + var customConfig: Config = ApplicationTestConfig + + var name: String = TestKitUtils.testNameFromCallStack(classOf[JUnit5TestKitBuilder]) + + def withSystem(system: ActorSystem[_]): JUnit5TestKitBuilder = { + this.system = Some(system) + this + } + + def withCustomConfig(customConfig: Config): JUnit5TestKitBuilder = { + this.customConfig = customConfig + this + } + + def withName(name: String): JUnit5TestKitBuilder = { + this.name = name + this + } + + def build(): ActorTestKit = { + if (system.isDefined) { + return ActorTestKit.create(system.get) + } + ActorTestKit.create(name, customConfig) + } + +} \ No newline at end of file diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala new file mode 100644 index 00000000000..5a153ce2cd3 --- /dev/null +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * license agreements; and to You under the Apache License, version 2.0: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * This file is part of the Apache Pekko project, which was derived from Akka. + */ + +package org.apache.pekko.actor.testkit.typed.javadsl + +import org.junit.jupiter.api.extension.InvocationInterceptor.Invocation +import org.junit.jupiter.api.extension.{ ExtensionContext, InvocationInterceptor, ReflectiveInvocationContext } +import org.slf4j.LoggerFactory +import org.apache.pekko.actor.testkit.typed.internal.CapturingAppender + +import java.lang.reflect.Method +import scala.util.control.NonFatal + +final class LogCapturingExtension extends InvocationInterceptor { + + private val capturingAppender = CapturingAppender.get("") + + private val myLogger = LoggerFactory.getLogger(classOf[LogCapturing]) + + @throws[Throwable] + override def interceptTestMethod(invocation: Invocation[Void], invocationContext: ReflectiveInvocationContext[Method], + extensionContext: ExtensionContext): Unit = { + + val testClassName = invocationContext.getTargetClass.getSimpleName + val testMethodName = invocationContext.getExecutable.getName + + try { + myLogger.info(s"Logging started for test [${testClassName}: ${testMethodName}]") + invocation.proceed + myLogger.info( + s"Logging finished for test [${testClassName}: ${testMethodName}] that was successful") + } catch { + case NonFatal(e) => + println( + s"--> [${Console.BLUE}${testClassName}: ${testMethodName}${Console.RESET}] " + + s"Start of log messages of test that failed with ${e.getMessage}") + capturingAppender.flush() + println( + s"<-- [${Console.BLUE}${testClassName}: ${testMethodName}${Console.RESET}] " + + s"End of log messages of test that failed with ${e.getMessage}") + throw e + } finally { + + capturingAppender.clear() + } + } +} \ No newline at end of file diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala new file mode 100644 index 00000000000..f7e70e159da --- /dev/null +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.pekko.actor.testkit.typed.javadsl + +import org.apache.pekko +import pekko.actor.testkit.typed.annotations.JUnit5TestKit +import org.junit.jupiter.api.extension.{ AfterAllCallback, BeforeTestExecutionCallback, ExtensionContext } +import org.junit.platform.commons.support.AnnotationSupport + +final class TestKitJUnit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback { + + var testKit: Option[ActorTestKit] = None + + /** + * Get a reference to the field annotated with @Junit5Testkit [[Junit5TestKit]] + */ + override def beforeTestExecution(context: ExtensionContext): Unit = { + + context.getTestInstance.ifPresent((instance: AnyRef) => { + val annotations = AnnotationSupport.findAnnotatedFieldValues(instance, classOf[JUnit5TestKit]) + val fieldValue = annotations.stream().findFirst().orElseThrow(() => + throw new IllegalArgumentException("Could not find field annotated with @Junit5TestKit")) + testKit = Some(fieldValue.asInstanceOf[ActorTestKit]) + }) + } + + /** + * Shutdown testKit + */ + override def afterAll(context: ExtensionContext): Unit = { + testKit.get.shutdownTestKit() + } + +} \ No newline at end of file diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java new file mode 100644 index 00000000000..7038d779528 --- /dev/null +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * license agreements; and to You under the Apache License, version 2.0: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * This file is part of the Apache Pekko project, which was derived from Akka. + */ + +package jdocs.org.apache.pekko.actor.testkit.typed.javadsl; + +import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; +import org.apache.pekko.actor.Address; +import org.apache.pekko.actor.testkit.typed.javadsl.*; +import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder; +import org.apache.pekko.actor.typed.ActorRef; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +// #junit5-integration +@DisplayName("JUnit5") +@ExtendWith(TestKitJUnit5Extension.class) +class JUnit5IntegrationExampleTest { + + @JUnit5TestKit public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); + + @Test + void junit5Test() { + Address address = testKit.system().address(); + assertNotNull(address); + } + + @Test + void testSomething() { + + ActorRef pinger = + testKit.spawn(AsyncTestingExampleTest.Echo.create(), "ping"); + TestProbe probe = testKit.createTestProbe(); + pinger.tell(new AsyncTestingExampleTest.Echo.Ping("hello", probe.ref())); + AsyncTestingExampleTest.Echo.Pong pong = + probe.expectMessage(new AsyncTestingExampleTest.Echo.Pong("hello")); + assertEquals("hello", pong.message); + } + + @Test + void testSomething2() { + ActorRef pinger2 = + testKit.spawn(AsyncTestingExampleTest.Echo.create(), "ping2"); + TestProbe probe2 = testKit.createTestProbe(); + pinger2.tell(new AsyncTestingExampleTest.Echo.Ping("hello", probe2.ref())); + AsyncTestingExampleTest.Echo.Pong pong = + probe2.expectMessage(new AsyncTestingExampleTest.Echo.Pong("hello")); + assertEquals("hello", pong.message); + } +} +// #junit5-integration diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JunitIntegrationExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java similarity index 97% rename from actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JunitIntegrationExampleTest.java rename to actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java index 756ea86fce1..d2627983c05 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JunitIntegrationExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java @@ -25,7 +25,7 @@ import org.junit.ClassRule; import org.junit.Test; -public class JunitIntegrationExampleTest { +public class JUnitIntegrationExampleTest { @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java new file mode 100644 index 00000000000..402bc686d96 --- /dev/null +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java @@ -0,0 +1,49 @@ +package jdocs.org.apache.pekko.actor.testkit.typed.javadsl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * license agreements; and to You under the Apache License, version 2.0: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * This file is part of the Apache Pekko project, which was derived from Akka. + */ + +// #log-capturing-junit5 + +import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; +import org.apache.pekko.actor.testkit.typed.javadsl.*; +import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder; +import org.apache.pekko.actor.typed.ActorRef; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +import static jdocs.org.apache.pekko.actor.testkit.typed.javadsl.AsyncTestingExampleTest.Echo; + +// test code copied from LogCapturingExampleTest.java + +@DisplayName("Junit5 log capturing") +@ExtendWith(TestKitJUnit5Extension.class) +@ExtendWith(LogCapturingExtension.class) +class LogCapturingExtensionExampleTest { + + @JUnit5TestKit public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); + + @Test + void testSomething() { + ActorRef pinger = testKit.spawn(Echo.create(), "ping"); + TestProbe probe = testKit.createTestProbe(); + pinger.tell(new Echo.Ping("hello", probe.ref())); + probe.expectMessage(new Echo.Pong("hello")); + } + + @Test + void testSomething2() { + ActorRef pinger = testKit.spawn(Echo.create(), "ping"); + TestProbe probe = testKit.createTestProbe(); + pinger.tell(new Echo.Ping("hello", probe.ref())); + probe.expectMessage(new Echo.Pong("hello")); + } +} +// #log-capturing-junit5 diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java new file mode 100644 index 00000000000..474feb3a006 --- /dev/null +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * license agreements; and to You under the Apache License, version 2.0: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * This file is part of the Apache Pekko project, which was derived from Akka. + */ + +package org.apache.pekko.actor.testkit.typed.javadsl; + +import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; +import org.apache.pekko.Done; +import org.apache.pekko.actor.typed.javadsl.Behaviors; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.scalatestplus.junit.JUnitSuite; + +import java.util.HashMap; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; + +import static org.apache.pekko.Done.done; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +@DisplayName("ActorTestKitTestJunit5") +@ExtendWith(TestKitJUnit5Extension.class) +@ExtendWith(LogCapturingExtension.class) +class ActorTestKitJUnit5Test extends JUnitSuite { + + @JUnit5TestKit public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); + + @Test + void systemNameShouldComeFromTestClassViaJunitResource() { + assertEquals("ActorTestKitJUnit5Test", testKit.system().name()); + } + + @Test + void systemNameShouldComeFromTestClass() { + final ActorTestKit testKit2 = ActorTestKit.create(); + try { + assertEquals("ActorTestKitJUnit5Test", testKit2.system().name()); + } finally { + testKit2.shutdownTestKit(); + } + } + + @Test + void systemNameShouldComeFromGivenClassName() { + final ActorTestKit testKit2 = ActorTestKit.create(HashMap.class.getName()); + try { + // removing package name and such + assertEquals("HashMap", testKit2.system().name()); + } finally { + testKit2.shutdownTestKit(); + } + } + + @Test + void testKitShouldSpawnActor() throws Exception { + final CompletableFuture started = new CompletableFuture<>(); + testKit.spawn( + Behaviors.setup( + (context) -> { + started.complete(done()); + return Behaviors.same(); + })); + assertNotNull(started.get(3, TimeUnit.SECONDS)); + } +} diff --git a/actor-testkit-typed/src/test/resources/application.conf b/actor-testkit-typed/src/test/resources/application.conf index 594856dc472..a332383c97d 100644 --- a/actor-testkit-typed/src/test/resources/application.conf +++ b/actor-testkit-typed/src/test/resources/application.conf @@ -2,3 +2,4 @@ # used by ActorTestKitSpec test.from-application = yes +test.value = someValue \ No newline at end of file diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/GreeterMain.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/GreeterMain.scala new file mode 100644 index 00000000000..ec1467664d7 --- /dev/null +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/GreeterMain.scala @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * license agreements; and to You under the Apache License, version 2.0: + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * This file is part of the Apache Pekko project, which was derived from Akka. + */ + +package org.apache.pekko.actor.testkit.typed.scaladsl + +import org.apache.pekko +import pekko.actor.typed.{ ActorRef, Behavior } +import pekko.actor.typed.scaladsl.Behaviors + +object Greeter { + final case class Greet(whom: String, replyTo: ActorRef[Greeted]) + final case class Greeted(whom: String, from: ActorRef[Greet]) + + def apply(): Behavior[Greet] = Behaviors.receive { (context, message) => + context.log.info("Hello {}!", message.whom) + // #greeter-send-messages + message.replyTo ! Greeted(message.whom, context.self) + // #greeter-send-messages + Behaviors.same + } +} + +object GreeterBot { + + def apply(max: Int): Behavior[Greeter.Greeted] = { + bot(0, max) + } + + private def bot(greetingCounter: Int, max: Int): Behavior[Greeter.Greeted] = + Behaviors.receive { (context, message) => + val n = greetingCounter + 1 + context.log.info("Greeting {} for {}", n, message.whom) + if (n == max) { + Behaviors.stopped + } else { + message.from ! Greeter.Greet(message.whom, context.self) + bot(n, max) + } + } +} + +object GreeterMain { + + final case class SayHello(name: String) + + def apply(): Behavior[SayHello] = + Behaviors.setup { context => + val greeter = context.spawn(Greeter(), "greeter") + + Behaviors.receiveMessage { message => + val replyTo = context.spawn(GreeterBot(max = 3), message.name) + greeter ! Greeter.Greet(message.name, replyTo) + Behaviors.same + } + } +} \ No newline at end of file diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala new file mode 100644 index 00000000000..68571d6fe57 --- /dev/null +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.pekko.actor.testkit.typed.scaladsl + +import org.apache.pekko +import pekko.actor.typed.ActorSystem +import com.typesafe.config.ConfigFactory +import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder +import org.scalatest.wordspec.AnyWordSpec + +class JUnit5TestKitBuilderSpec extends AnyWordSpec { + + "the Junit5TestKitBuilder" should { + "create a Testkit with name hello" in { + val actualTestKit = new JUnit5TestKitBuilder().withName("hello").build() + + assertResult("hello")(actualTestKit.system.name) + } + } + + "the Junit5TestKitBuilder" should { + "create a Testkit with the classname as name" in { + val actualTestKit = new JUnit5TestKitBuilder() + .build() + + assertResult("JUnit5TestKitBuilderSpec")(actualTestKit.system.name) + } + } + + "the Junit5TestKitBuilder" should { + "create a Testkit with a custom config" in { + + val conf = ConfigFactory.load("application.conf") + val actualTestKit = new JUnit5TestKitBuilder() + .withCustomConfig(conf) + .build() + assertResult("someValue")(actualTestKit.system.settings.config.getString("test.value")) + assertResult("JUnit5TestKitBuilderSpec")(actualTestKit.system.name) + + } + } + + "the Junit5TestKitBuilder" should { + "create a Testkit with a custom config and name" in { + + val conf = ConfigFactory.load("application.conf") + val actualTestKit = new JUnit5TestKitBuilder() + .withCustomConfig(conf) + .withName("hello") + .build() + assertResult("someValue")(actualTestKit.system.settings.config.getString("test.value")) + assertResult("hello")(actualTestKit.system.name) + + } + } + + "the Junit5TestKitBuilder" should { + "create a Testkit with a custom system" in { + + val system: ActorSystem[GreeterMain.SayHello] = ActorSystem(GreeterMain(), "AkkaQuickStart") + + val actualTestKit = new JUnit5TestKitBuilder() + .withSystem(system) + .build() + assertResult("AkkaQuickStart")(actualTestKit.system.name) + } + } + +} \ No newline at end of file diff --git a/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala b/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala index 02311044278..8fd6978ea84 100644 --- a/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala +++ b/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala @@ -18,9 +18,10 @@ import jdk.jfr.Enabled import jdk.jfr.Event import jdk.jfr.Label import jdk.jfr.StackTrace - import org.apache.pekko.annotation.InternalApi +import scala.annotation.unused + // requires jdk9+ to compile // for editing these in IntelliJ, open module settings, change JDK dependency to 11 for only this module @@ -96,7 +97,7 @@ final class DeliveryProducerReceived(val producerId: String, val currentSeqNr: L @StackTrace(false) @Category(Array("Pekko", "Delivery", "ProducerController")) @Label( "Delivery ProducerController received demand request") -final class DeliveryProducerReceivedRequest(val producerId: String, val requestedSeqNr: Long, confirmedSeqNr: Long) +final class DeliveryProducerReceivedRequest(val producerId: String, val requestedSeqNr: Long, @unused confirmedSeqNr: Long) extends Event /** INTERNAL API */ diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 5df8569f776..a6f2f98123a 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -22,6 +22,7 @@ object Dependencies { .withRank(KeyRanks.Invisible) // avoid 'unused key' warning val junitVersion = "4.13.2" + val junit5Version = "5.10.0" val slf4jVersion = "2.0.9" // check agrona version when updating this val aeronVersion = "1.42.1" @@ -85,6 +86,7 @@ object Dependencies { val lmdb = "org.lmdbjava" % "lmdbjava" % "0.8.3" val junit = "junit" % "junit" % junitVersion + val junit5 = "org.junit.jupiter" % "junit-jupiter-engine" % junit5Version // For Java 8 Conversions val java8Compat = Def.setting { @@ -138,6 +140,7 @@ object Dependencies { val commonsCodec = "commons-codec" % "commons-codec" % "1.16.0" % Test val commonsCompress = "org.apache.commons" % "commons-compress" % "1.24.0" % Test val junit = "junit" % "junit" % junitVersion % Test + val junit5 = "org.junit.jupiter" % "junit-jupiter-engine" % junit5Version % Test val httpClient = "org.apache.httpcomponents" % "httpclient" % "4.5.14" % Test val logback = Compile.logback % Test @@ -212,6 +215,7 @@ object Dependencies { val levelDBNative = "org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8" % "optional;provided" val junit = Compile.junit % "optional;provided;test" + val junit5 = Compile.junit5 % "optional;provided;test" val scalatest = Def.setting { "org.scalatest" %% "scalatest" % scalaTestVersion % "optional;provided;test" } @@ -265,6 +269,7 @@ object Dependencies { val actorTestkitTyped = l ++= Seq( Provided.logback, Provided.junit, + Provided.junit5, Provided.scalatest.value, TestDependencies.scalatestJUnit.value) From 7e895c854cd0f4ecfa66dfd90c7495026465cb28 Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 19 Oct 2023 18:53:28 +0200 Subject: [PATCH 02/13] renamed TestKitJunitResource to TestKitJUnitResource --- .../actor/testkit/typed/javadsl/ActorTestKit.scala | 4 ++-- ...tJunitResource.scala => TestKitJUnitResource.scala} | 10 +++++----- .../typed/javadsl/JUnitIntegrationExampleTest.java | 4 ++-- .../testkit/typed/javadsl/LogCapturingExampleTest.java | 4 ++-- .../testkit/typed/javadsl/ManualTimerExampleTest.java | 4 ++-- .../actor/testkit/typed/javadsl/ActorTestKitTest.java | 2 +- .../testkit/typed/javadsl/LoggingTestKitTest.java | 2 +- .../actor/testkit/typed/javadsl/TestProbeTest.java | 2 +- .../jdocs/org/apache/pekko/typed/AggregatorTest.java | 4 ++-- .../org/apache/pekko/typed/BubblingSampleTest.java | 6 +++--- .../typed/InteractionPatternsAskWithStatusTest.java | 4 ++-- .../apache/pekko/typed/InteractionPatternsTest.java | 4 ++-- .../jdocs/org/apache/pekko/typed/MailboxDocTest.java | 6 +++--- .../java/jdocs/org/apache/pekko/typed/RouterTest.java | 4 ++-- .../jdocs/org/apache/pekko/typed/StashDocTest.java | 4 ++-- .../pekko/actor/typed/javadsl/ActorContextAskTest.java | 4 ++-- .../typed/javadsl/ActorContextPipeToSelfTest.java | 6 +++--- .../pekko/actor/typed/javadsl/ActorLoggingTest.java | 6 +++--- .../pekko/actor/typed/javadsl/BehaviorBuilderTest.java | 4 ++-- .../pekko/actor/typed/javadsl/InterceptTest.java | 4 ++-- .../pekko/actor/typed/javadsl/ReceiveBuilderTest.java | 4 ++-- .../apache/pekko/actor/typed/javadsl/RoutersTest.java | 4 ++-- .../apache/pekko/actor/typed/javadsl/WatchTest.java | 4 ++-- .../cluster/sharding/typed/AccountExampleDocTest.java | 6 +++--- .../cluster/sharding/typed/AccountExampleTest.java | 4 ++-- .../typed/HelloWorldEventSourcedEntityExampleTest.java | 4 ++-- .../cluster/sharding/typed/ReplicatedShardingTest.java | 6 +++--- .../typed/javadsl/ClusterShardingPersistenceTest.java | 4 ++-- ...ourcedEntityWithEnforcedRepliesCompileOnlyTest.java | 4 ++-- .../cluster/ddata/typed/javadsl/ReplicatorDocTest.java | 4 ++-- .../jdocs/persistence/testkit/PersistenceInitTest.java | 6 +++--- .../testkit/PersistenceTestKitPolicySampleTest.java | 6 +++--- .../testkit/PersistenceTestKitSampleTest.java | 6 +++--- .../java/jdocs/stream/operators/SourceDocExamples.java | 4 ++-- .../test/java/jdocs/typed/tutorial_3/DeviceTest.java | 4 ++-- .../java/jdocs/typed/tutorial_4/DeviceGroupTest.java | 4 ++-- .../java/jdocs/typed/tutorial_4/DeviceManagerTest.java | 4 ++-- .../test/java/jdocs/typed/tutorial_4/DeviceTest.java | 4 ++-- .../jdocs/typed/tutorial_5/DeviceGroupQueryTest.java | 4 ++-- .../java/jdocs/typed/tutorial_5/DeviceGroupTest.java | 4 ++-- .../java/jdocs/typed/tutorial_5/DeviceManagerTest.java | 4 ++-- .../test/java/jdocs/typed/tutorial_5/DeviceTest.java | 4 ++-- .../typed/ReplicatedAuctionExampleTest.java | 6 +++--- .../persistence/typed/ReplicatedEventSourcingTest.java | 6 +++--- .../typed/javadsl/EventSourcedActorFailureTest.java | 4 ++-- .../typed/javadsl/EventSourcedBehaviorJavaDslTest.java | 6 +++--- .../persistence/typed/javadsl/LoggerSourceTest.java | 4 ++-- .../persistence/typed/javadsl/NullEmptyStateTest.java | 4 ++-- .../persistence/typed/javadsl/PrimitiveStateTest.java | 4 ++-- .../javadsl/CustomGuardianAndMaterializerTest.java | 4 ++-- 50 files changed, 112 insertions(+), 112 deletions(-) rename actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/{TestKitJunitResource.scala => TestKitJUnitResource.scala} (95%) diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala index f8503872a2c..8e52229abde 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala @@ -161,9 +161,9 @@ object ActorTestKit { * The actor system has a custom guardian that allows for spawning arbitrary actors using the `spawn` methods. * * Designed to work with any test framework, but framework glue code that calls `shutdownTestKit` after all tests has - * run needs to be provided by the user or with [[TestKitJunitResource]]. + * run needs to be provided by the user or with [[TestKitJUnitResource]]. * - * Use `TestKit.create` factories to construct manually or [[TestKitJunitResource]] to use together with JUnit tests + * Use `TestKit.create` factories to construct manually or [[TestKitJUnitResource]] to use together with JUnit tests * * For synchronous testing of a `Behavior` see [[BehaviorTestKit]] */ diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnitResource.scala similarity index 95% rename from actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala rename to actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnitResource.scala index 72f7e14d323..a92af603015 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnitResource.scala @@ -59,14 +59,14 @@ import pekko.util.Timeout * The application.conf of your project is not used in this case. * A specific configuration can be passed as constructor parameter. */ -final class TestKitJunitResource(_kit: ActorTestKit) extends ExternalResource { +final class TestKitJUnitResource(_kit: ActorTestKit) extends ExternalResource { /** * Config loaded from `application-test.conf` if that exists, otherwise * using default configuration from the reference.conf resources that ship with the Akka libraries. * The application.conf of your project is not used in this case. */ - def this() = this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]))) + def this() = this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJUnitResource]))) /** * Use a custom [[pekko.actor.typed.ActorSystem]] for the actor system. @@ -79,20 +79,20 @@ final class TestKitJunitResource(_kit: ActorTestKit) extends ExternalResource { def this(customConfig: String) = this( ActorTestKit.create( - TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]), + TestKitUtils.testNameFromCallStack(classOf[TestKitJUnitResource]), ConfigFactory.parseString(customConfig))) /** * Use a custom config for the actor system. */ def this(customConfig: Config) = - this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]), customConfig)) + this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJUnitResource]), customConfig)) /** * Use a custom config for the actor system, and a custom [[pekko.actor.testkit.typed.TestKitSettings]]. */ def this(customConfig: Config, settings: TestKitSettings) = - this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]), customConfig, settings)) + this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJUnitResource]), customConfig, settings)) @Rule val testKit: ActorTestKit = _kit diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java index d2627983c05..d6916d5d422 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java @@ -19,7 +19,7 @@ import org.junit.Rule; // #junit-integration -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -27,7 +27,7 @@ public class JUnitIntegrationExampleTest { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); // #junit-integration // this is shown in LogCapturingExampleTest diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExampleTest.java index 5e2e4e322c9..a4aa4eceb3c 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExampleTest.java @@ -17,7 +17,7 @@ // #log-capturing import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -26,7 +26,7 @@ public class LogCapturingExampleTest { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/ManualTimerExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/ManualTimerExampleTest.java index 107ddd56396..e298db70c4b 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/ManualTimerExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/ManualTimerExampleTest.java @@ -18,7 +18,7 @@ import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.actor.testkit.typed.javadsl.ManualTime; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.junit.ClassRule; import org.junit.Rule; import org.scalatestplus.junit.JUnitSuite; @@ -33,7 +33,7 @@ public class ManualTimerExampleTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = new TestKitJunitResource(ManualTime.config()); + public static final TestKitJUnitResource testKit = new TestKitJUnitResource(ManualTime.config()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitTest.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitTest.java index ec6209a06c8..8d539b31ad7 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitTest.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitTest.java @@ -29,7 +29,7 @@ public class ActorTestKitTest extends JUnitSuite { - @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKitTest.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKitTest.java index 83bb9bb7b68..990da0ac8cb 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKitTest.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKitTest.java @@ -29,7 +29,7 @@ public class LoggingTestKitTest extends JUnitSuite { - @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/TestProbeTest.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/TestProbeTest.java index e8cffba7d34..afba0c0a749 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/TestProbeTest.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/TestProbeTest.java @@ -28,7 +28,7 @@ public class TestProbeTest extends JUnitSuite { - @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/AggregatorTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/AggregatorTest.java index 7cbe7ddf2aa..faac99d6a30 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/AggregatorTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/AggregatorTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -42,7 +42,7 @@ import static org.junit.Assert.assertEquals; public class AggregatorTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/BubblingSampleTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/BubblingSampleTest.java index 9154a2c03b4..36cc019ef56 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/BubblingSampleTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/BubblingSampleTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -30,8 +30,8 @@ public class BubblingSampleTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource("pekko.loglevel = off"); + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource("pekko.loglevel = off"); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsAskWithStatusTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsAskWithStatusTest.java index 487ab389cb0..a37cd326f1b 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsAskWithStatusTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsAskWithStatusTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.ActorSystem; import org.apache.pekko.actor.typed.Behavior; @@ -34,7 +34,7 @@ public class InteractionPatternsAskWithStatusTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsTest.java index 6db6677fa5f..4fe181f71a0 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.ActorSystem; import org.apache.pekko.actor.typed.Behavior; @@ -875,7 +875,7 @@ private Behavior onUpdateResult(WrappedUpdateResult wrapped) { } - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/MailboxDocTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/MailboxDocTest.java index c0486f57d8c..9e6957533af 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/MailboxDocTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/MailboxDocTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -30,8 +30,8 @@ public class MailboxDocTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource(ConfigFactory.load("mailbox-config-sample.conf")); + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource(ConfigFactory.load("mailbox-config-sample.conf")); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/RouterTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/RouterTest.java index d0852dda26e..fc72c2b2225 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/RouterTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/RouterTest.java @@ -30,7 +30,7 @@ import org.apache.pekko.actor.typed.receptionist.Receptionist; import org.apache.pekko.actor.typed.receptionist.ServiceKey; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.junit.ClassRule; @@ -41,7 +41,7 @@ public class RouterTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); static // #routee class Worker { diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/StashDocTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/StashDocTest.java index 629de968843..1fad353732b 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/StashDocTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/StashDocTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -31,7 +31,7 @@ public class StashDocTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextAskTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextAskTest.java index a2778dca287..6cd142df69c 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextAskTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextAskTest.java @@ -19,7 +19,7 @@ import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.pattern.StatusReply; import org.apache.pekko.testkit.PekkoSpec; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.junit.ClassRule; import org.junit.Rule; @@ -31,7 +31,7 @@ public class ActorContextAskTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = new TestKitJunitResource(PekkoSpec.testConf()); + public static final TestKitJUnitResource testKit = new TestKitJUnitResource(PekkoSpec.testConf()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextPipeToSelfTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextPipeToSelfTest.java index c9c25644341..36d5aba056f 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextPipeToSelfTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextPipeToSelfTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; import org.apache.pekko.actor.testkit.typed.javadsl.LoggingTestKit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -36,8 +36,8 @@ public final class ActorContextPipeToSelfTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource( + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource( ConfigFactory.parseString( "pipe-to-self-spec-dispatcher.executor = thread-pool-executor\n" + "pipe-to-self-spec-dispatcher.type = PinnedDispatcher\n")); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorLoggingTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorLoggingTest.java index aebaf8a84a8..87a262d9325 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorLoggingTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorLoggingTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.actor.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.event.Logging; @@ -34,8 +34,8 @@ public class ActorLoggingTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource( + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource( ConfigFactory.parseString( "pekko.loglevel = INFO\n" + "pekko.loggers = [\"org.apache.pekko.testkit.TestEventListener\"]")); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/BehaviorBuilderTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/BehaviorBuilderTest.java index 6e6d3ebf534..f7baa56a061 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/BehaviorBuilderTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/BehaviorBuilderTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.actor.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.junit.ClassRule; import org.junit.Rule; @@ -34,7 +34,7 @@ /** Test creating [[Behavior]]s using [[BehaviorBuilder]] */ public class BehaviorBuilderTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/InterceptTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/InterceptTest.java index fb956b89ec7..37ae36b9046 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/InterceptTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/InterceptTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.actor.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.*; import org.apache.pekko.testkit.PekkoSpec; @@ -26,7 +26,7 @@ public class InterceptTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = new TestKitJunitResource(PekkoSpec.testConf()); + public static final TestKitJUnitResource testKit = new TestKitJUnitResource(PekkoSpec.testConf()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ReceiveBuilderTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ReceiveBuilderTest.java index 552598cf550..1a587bdb89d 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ReceiveBuilderTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ReceiveBuilderTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.actor.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.PostStop; @@ -30,7 +30,7 @@ /** Test creating [[MutableActor]]s using [[ReceiveBuilder]] */ public class ReceiveBuilderTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/RoutersTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/RoutersTest.java index 914f35a0bbb..1406854edfb 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/RoutersTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/RoutersTest.java @@ -16,7 +16,7 @@ import java.util.List; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -33,7 +33,7 @@ public class RoutersTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = new TestKitJunitResource(PekkoSpec.testConf()); + public static final TestKitJUnitResource testKit = new TestKitJUnitResource(PekkoSpec.testConf()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/WatchTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/WatchTest.java index 07d9734f96b..7f0c25fb7fd 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/WatchTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/WatchTest.java @@ -18,7 +18,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.junit.ClassRule; import org.junit.Rule; import org.scalatestplus.junit.JUnitSuite; @@ -33,7 +33,7 @@ public class WatchTest extends JUnitSuite { - @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleDocTest.java b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleDocTest.java index 96704d26d1c..ca1f506fd65 100644 --- a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleDocTest.java +++ b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleDocTest.java @@ -23,7 +23,7 @@ // #test import java.math.BigDecimal; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.persistence.testkit.javadsl.EventSourcedBehaviorTestKit; import org.apache.pekko.persistence.testkit.javadsl.EventSourcedBehaviorTestKit.CommandResultWithReply; @@ -45,8 +45,8 @@ public class AccountExampleDocTest // #testkit @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource(EventSourcedBehaviorTestKit.config()); + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource(EventSourcedBehaviorTestKit.config()); private EventSourcedBehaviorTestKit< AccountEntity.Command, AccountEntity.Event, AccountEntity.Account> diff --git a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleTest.java b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleTest.java index 9c7be244d05..519b5008131 100644 --- a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleTest.java +++ b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.cluster.sharding.typed.javadsl.ClusterSharding; import org.apache.pekko.cluster.sharding.typed.javadsl.Entity; @@ -53,7 +53,7 @@ public class AccountExampleTest extends JUnitSuite { + "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java index 1956740303c..09593da595e 100644 --- a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java +++ b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.cluster.sharding.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.cluster.sharding.typed.javadsl.ClusterSharding; import org.apache.pekko.cluster.sharding.typed.javadsl.EntityRef; @@ -43,7 +43,7 @@ public class HelloWorldEventSourcedEntityExampleTest extends JUnitSuite { + "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingTest.java b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingTest.java index 25599dd4d1d..7d0ca931daf 100644 --- a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingTest.java +++ b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.cluster.sharding.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -217,8 +217,8 @@ private Behavior onForwardToAll(ForwardToAll forwardToAll) { } @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource( + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource( ConfigFactory.parseString( " pekko.loglevel = DEBUG\n" + " pekko.loggers = [\"org.apache.pekko.testkit.SilenceAllTestEventListener\"]\n" diff --git a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java index 31b731b43ac..6533d2ab18e 100644 --- a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java +++ b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.cluster.typed.Cluster; @@ -45,7 +45,7 @@ public class ClusterShardingPersistenceTest extends JUnitSuite { + "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest.java b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest.java index 5cd44b69037..066de57bf27 100644 --- a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest.java +++ b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.cluster.sharding.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.cluster.typed.Cluster; @@ -26,7 +26,7 @@ public class ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-typed/src/test/java/jdocs/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorDocTest.java b/cluster-typed/src/test/java/jdocs/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorDocTest.java index 51b57039f88..0d8cf2ae9a3 100644 --- a/cluster-typed/src/test/java/jdocs/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorDocTest.java +++ b/cluster-typed/src/test/java/jdocs/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorDocTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.cluster.ddata.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.cluster.ddata.GCounter; @@ -43,7 +43,7 @@ public class ReplicatorDocTest extends JUnitSuite { + "pekko.remote.artery.canonical.port = 0 \n" + "pekko.remote.artery.canonical.hostname = 127.0.0.1 \n"); - @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(config); + @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/docs/src/test/java/jdocs/persistence/testkit/PersistenceInitTest.java b/docs/src/test/java/jdocs/persistence/testkit/PersistenceInitTest.java index 39728dadfab..74a5acf8b7b 100644 --- a/docs/src/test/java/jdocs/persistence/testkit/PersistenceInitTest.java +++ b/docs/src/test/java/jdocs/persistence/testkit/PersistenceInitTest.java @@ -13,7 +13,7 @@ package jdocs.persistence.testkit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import com.typesafe.config.ConfigFactory; import jdocs.AbstractJavaTest; @@ -34,8 +34,8 @@ public class PersistenceInitTest extends AbstractJavaTest { @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource( + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource( ConfigFactory.parseString( "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n" diff --git a/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitPolicySampleTest.java b/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitPolicySampleTest.java index 866db91d55f..4da0ca96ada 100644 --- a/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitPolicySampleTest.java +++ b/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitPolicySampleTest.java @@ -13,7 +13,7 @@ package jdocs.persistence.testkit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.persistence.testkit.JournalOperation; import org.apache.pekko.persistence.testkit.PersistenceTestKitPlugin; @@ -34,8 +34,8 @@ public class PersistenceTestKitPolicySampleTest extends AbstractJavaTest { @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource( + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource( PersistenceTestKitPlugin.getInstance() .config() .withFallback(ConfigFactory.defaultApplication())); diff --git a/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitSampleTest.java b/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitSampleTest.java index fbd26f1082e..15e802297c7 100644 --- a/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitSampleTest.java +++ b/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitSampleTest.java @@ -13,7 +13,7 @@ package jdocs.persistence.testkit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.actor.typed.javadsl.Behaviors; @@ -35,8 +35,8 @@ public class PersistenceTestKitSampleTest extends AbstractJavaTest { @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource( + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource( PersistenceTestKitPlugin.getInstance() .config() .withFallback(ConfigFactory.defaultApplication())); diff --git a/docs/src/test/java/jdocs/stream/operators/SourceDocExamples.java b/docs/src/test/java/jdocs/stream/operators/SourceDocExamples.java index 531d4f38778..675fdabda5b 100644 --- a/docs/src/test/java/jdocs/stream/operators/SourceDocExamples.java +++ b/docs/src/test/java/jdocs/stream/operators/SourceDocExamples.java @@ -19,7 +19,7 @@ import org.apache.pekko.NotUsed; import org.apache.pekko.actor.ActorSystem; import org.apache.pekko.actor.testkit.typed.javadsl.ManualTime; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.stream.javadsl.Source; // #range-imports @@ -43,7 +43,7 @@ public class SourceDocExamples { - public static final TestKitJunitResource testKit = new TestKitJunitResource(ManualTime.config()); + public static final TestKitJUnitResource testKit = new TestKitJUnitResource(ManualTime.config()); public static void fromExample() { final ActorSystem system = null; diff --git a/docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java b/docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java index 1121e80ee1a..c98320b18e8 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java @@ -14,7 +14,7 @@ package jdocs.typed.tutorial_3; // #device-read-test -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -33,7 +33,7 @@ public class DeviceTest { public class DeviceTest extends org.scalatestplus.junit.JUnitSuite { // #device-read-test - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Test public void testReplyWithEmptyReadingIfNoTemperatureIsKnown() { diff --git a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java index b794142f4c3..52528d6e693 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_4; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -33,7 +33,7 @@ public class DeviceGroupTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); // #device-group-test-registration @Test diff --git a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java index 9103980fbdc..0e2804559cd 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_4; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -27,7 +27,7 @@ public class DeviceManagerTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Test public void testReplyToRegistrationRequests() { diff --git a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java index 198c99d843f..f5c24755741 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_4; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -26,7 +26,7 @@ public class DeviceTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); // #device-read-test @Test diff --git a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java index 2e342f9d5c8..030ad2ec38c 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_5; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -36,7 +36,7 @@ public class DeviceGroupQueryTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); // #query-test-normal @Test diff --git a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java index 4785c242416..83e2bf4f906 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_5; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -40,7 +40,7 @@ public class DeviceGroupTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Test public void testReplyToRegistrationRequests() { diff --git a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java index f3b91d3bebe..f27744cab74 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_5; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -27,7 +27,7 @@ public class DeviceManagerTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Test public void testReplyToRegistrationRequests() { diff --git a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java index c9603524ca9..91a470fcbf7 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_5; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -26,7 +26,7 @@ public class DeviceTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Test public void testReplyWithEmptyReadingIfNoTemperatureIsKnown() { diff --git a/persistence-typed-tests/src/test/java/jdocs/org/apache/pekko/persistence/typed/ReplicatedAuctionExampleTest.java b/persistence-typed-tests/src/test/java/jdocs/org/apache/pekko/persistence/typed/ReplicatedAuctionExampleTest.java index 0b39f4ee057..37306989604 100644 --- a/persistence-typed-tests/src/test/java/jdocs/org/apache/pekko/persistence/typed/ReplicatedAuctionExampleTest.java +++ b/persistence-typed-tests/src/test/java/jdocs/org/apache/pekko/persistence/typed/ReplicatedAuctionExampleTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.persistence.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -54,8 +54,8 @@ public class ReplicatedAuctionExampleTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource(PersistenceTestKitPlugin.getInstance().config()); + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource(PersistenceTestKitPlugin.getInstance().config()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTest.java b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTest.java index 282b33c648d..272a134f4bf 100644 --- a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTest.java +++ b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -152,8 +152,8 @@ public EventHandler, String> eventHandler() { } @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource( + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource( ConfigFactory.parseString( "pekko.loglevel = INFO\n" + "pekko.loggers = [\"org.apache.pekko.testkit.TestEventListener\"]") diff --git a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedActorFailureTest.java b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedActorFailureTest.java index cbc28ba550a..ad8b3aa2b8e 100644 --- a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedActorFailureTest.java +++ b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedActorFailureTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.actor.testkit.typed.TestException; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -93,7 +93,7 @@ public class EventSourcedActorFailureTest extends JUnitSuite { public static final Config config = conf().withFallback(ConfigFactory.load()); - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehaviorJavaDslTest.java b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehaviorJavaDslTest.java index bb75d62b409..ed8becc8402 100644 --- a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehaviorJavaDslTest.java +++ b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehaviorJavaDslTest.java @@ -16,7 +16,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; import org.apache.pekko.actor.testkit.typed.javadsl.LoggingTestKit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.*; import org.apache.pekko.actor.typed.javadsl.ActorContext; @@ -54,8 +54,8 @@ public class EventSourcedBehaviorJavaDslTest extends JUnitSuite { @ClassRule - public static final TestKitJunitResource testKit = - new TestKitJunitResource( + public static final TestKitJUnitResource testKit = + new TestKitJUnitResource( ConfigFactory.parseString( "pekko.loglevel = INFO\n" + "pekko.loggers = [\"org.apache.pekko.testkit.TestEventListener\"]") diff --git a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/LoggerSourceTest.java b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/LoggerSourceTest.java index a6fab5a6117..b2c628db5a5 100644 --- a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/LoggerSourceTest.java +++ b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/LoggerSourceTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; import org.apache.pekko.actor.testkit.typed.javadsl.LoggingTestKit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -41,7 +41,7 @@ public class LoggerSourceTest extends JUnitSuite { "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/NullEmptyStateTest.java b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/NullEmptyStateTest.java index c0a3401b28e..82a85711107 100644 --- a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/NullEmptyStateTest.java +++ b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/NullEmptyStateTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.persistence.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -35,7 +35,7 @@ public class NullEmptyStateTest extends JUnitSuite { "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/PrimitiveStateTest.java b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/PrimitiveStateTest.java index 2ad5fd4beac..f330da8b8bf 100644 --- a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/PrimitiveStateTest.java +++ b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/PrimitiveStateTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.persistence.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -35,7 +35,7 @@ public class PrimitiveStateTest extends JUnitSuite { "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/stream-typed/src/test/java/org/apache/pekko/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java b/stream-typed/src/test/java/org/apache/pekko/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java index 0fe48c045a5..abe158d730b 100644 --- a/stream-typed/src/test/java/org/apache/pekko/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java +++ b/stream-typed/src/test/java/org/apache/pekko/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.stream.typed.javadsl; import org.apache.pekko.Done; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -34,7 +34,7 @@ public class CustomGuardianAndMaterializerTest extends JUnitSuite { - @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); + @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); @Test public void useSystemWideMaterialiser() throws Exception { From 7021904d82b2a26b82e9d715958e9104bb7ac0e2 Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 19 Oct 2023 20:19:08 +0200 Subject: [PATCH 03/13] renamed "JUnit" to "Junit" to adhere to previous standard --- .../testkit/typed/javadsl/ActorTestKit.scala | 4 ++-- ...uilder.scala => Junit5TestKitBuilder.scala} | 10 +++++----- ...sion.scala => TestKitJunit5Extension.scala} | 2 +- ...source.scala => TestKitJunitResource.scala} | 10 +++++----- ....java => Junit5IntegrationExampleTest.java} | 8 ++++---- ...t.java => JunitIntegrationExampleTest.java} | 6 +++--- .../typed/javadsl/LogCapturingExampleTest.java | 4 ++-- .../LogCapturingExtensionExampleTest.java | 6 +++--- .../typed/javadsl/ManualTimerExampleTest.java | 4 ++-- ...t5Test.java => ActorTestKitJunit5Test.java} | 10 +++++----- .../typed/javadsl/ActorTestKitTest.java | 2 +- .../typed/javadsl/LoggingTestKitTest.java | 2 +- .../testkit/typed/javadsl/TestProbeTest.java | 2 +- ...ec.scala => Junit5TestKitBuilderSpec.scala} | 18 +++++++++--------- .../org/apache/pekko/typed/AggregatorTest.java | 4 ++-- .../apache/pekko/typed/BubblingSampleTest.java | 6 +++--- .../InteractionPatternsAskWithStatusTest.java | 4 ++-- .../pekko/typed/InteractionPatternsTest.java | 4 ++-- .../org/apache/pekko/typed/MailboxDocTest.java | 6 +++--- .../org/apache/pekko/typed/RouterTest.java | 4 ++-- .../org/apache/pekko/typed/StashDocTest.java | 4 ++-- .../typed/javadsl/ActorContextAskTest.java | 4 ++-- .../javadsl/ActorContextPipeToSelfTest.java | 6 +++--- .../actor/typed/javadsl/ActorLoggingTest.java | 6 +++--- .../typed/javadsl/BehaviorBuilderTest.java | 4 ++-- .../actor/typed/javadsl/InterceptTest.java | 4 ++-- .../typed/javadsl/ReceiveBuilderTest.java | 4 ++-- .../pekko/actor/typed/javadsl/RoutersTest.java | 4 ++-- .../pekko/actor/typed/javadsl/WatchTest.java | 4 ++-- .../sharding/typed/AccountExampleDocTest.java | 6 +++--- .../sharding/typed/AccountExampleTest.java | 4 ++-- ...elloWorldEventSourcedEntityExampleTest.java | 4 ++-- .../sharding/typed/ReplicatedShardingTest.java | 6 +++--- .../ClusterShardingPersistenceTest.java | 4 ++-- ...tityWithEnforcedRepliesCompileOnlyTest.java | 4 ++-- .../ddata/typed/javadsl/ReplicatorDocTest.java | 4 ++-- .../testkit/PersistenceInitTest.java | 6 +++--- .../PersistenceTestKitPolicySampleTest.java | 6 +++--- .../testkit/PersistenceTestKitSampleTest.java | 6 +++--- .../stream/operators/SourceDocExamples.java | 4 ++-- .../jdocs/typed/tutorial_3/DeviceTest.java | 4 ++-- .../typed/tutorial_4/DeviceGroupTest.java | 4 ++-- .../typed/tutorial_4/DeviceManagerTest.java | 4 ++-- .../jdocs/typed/tutorial_4/DeviceTest.java | 4 ++-- .../typed/tutorial_5/DeviceGroupQueryTest.java | 4 ++-- .../typed/tutorial_5/DeviceGroupTest.java | 4 ++-- .../typed/tutorial_5/DeviceManagerTest.java | 4 ++-- .../jdocs/typed/tutorial_5/DeviceTest.java | 4 ++-- .../typed/ReplicatedAuctionExampleTest.java | 6 +++--- .../typed/ReplicatedEventSourcingTest.java | 6 +++--- .../javadsl/EventSourcedActorFailureTest.java | 4 ++-- .../EventSourcedBehaviorJavaDslTest.java | 6 +++--- .../typed/javadsl/LoggerSourceTest.java | 4 ++-- .../typed/javadsl/NullEmptyStateTest.java | 4 ++-- .../typed/javadsl/PrimitiveStateTest.java | 4 ++-- .../CustomGuardianAndMaterializerTest.java | 4 ++-- 56 files changed, 140 insertions(+), 140 deletions(-) rename actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/{JUnit5TestKitBuilder.scala => Junit5TestKitBuilder.scala} (86%) rename actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/{TestKitJUnit5Extension.scala => TestKitJunit5Extension.scala} (96%) rename actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/{TestKitJUnitResource.scala => TestKitJunitResource.scala} (95%) rename actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/{JUnit5IntegrationExampleTest.java => Junit5IntegrationExampleTest.java} (90%) rename actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/{JUnitIntegrationExampleTest.java => JunitIntegrationExampleTest.java} (86%) rename actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/{ActorTestKitJUnit5Test.java => ActorTestKitJunit5Test.java} (87%) rename actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/{JUnit5TestKitBuilderSpec.scala => Junit5TestKitBuilderSpec.scala} (81%) diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala index 8e52229abde..f8503872a2c 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKit.scala @@ -161,9 +161,9 @@ object ActorTestKit { * The actor system has a custom guardian that allows for spawning arbitrary actors using the `spawn` methods. * * Designed to work with any test framework, but framework glue code that calls `shutdownTestKit` after all tests has - * run needs to be provided by the user or with [[TestKitJUnitResource]]. + * run needs to be provided by the user or with [[TestKitJunitResource]]. * - * Use `TestKit.create` factories to construct manually or [[TestKitJUnitResource]] to use together with JUnit tests + * Use `TestKit.create` factories to construct manually or [[TestKitJunitResource]] to use together with JUnit tests * * For synchronous testing of a `Behavior` see [[BehaviorTestKit]] */ diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala similarity index 86% rename from actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala rename to actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala index f908172cb0b..6105cb2a547 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala @@ -23,25 +23,25 @@ import pekko.actor.testkit.typed.internal.TestKitUtils import pekko.actor.testkit.typed.scaladsl.ActorTestKit.ApplicationTestConfig import pekko.actor.typed.ActorSystem -final class JUnit5TestKitBuilder() { +final class Junit5TestKitBuilder() { var system: Option[ActorSystem[_]] = None var customConfig: Config = ApplicationTestConfig - var name: String = TestKitUtils.testNameFromCallStack(classOf[JUnit5TestKitBuilder]) + var name: String = TestKitUtils.testNameFromCallStack(classOf[Junit5TestKitBuilder]) - def withSystem(system: ActorSystem[_]): JUnit5TestKitBuilder = { + def withSystem(system: ActorSystem[_]): Junit5TestKitBuilder = { this.system = Some(system) this } - def withCustomConfig(customConfig: Config): JUnit5TestKitBuilder = { + def withCustomConfig(customConfig: Config): Junit5TestKitBuilder = { this.customConfig = customConfig this } - def withName(name: String): JUnit5TestKitBuilder = { + def withName(name: String): Junit5TestKitBuilder = { this.name = name this } diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala similarity index 96% rename from actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala rename to actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala index f7e70e159da..71f78de6646 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala @@ -22,7 +22,7 @@ import pekko.actor.testkit.typed.annotations.JUnit5TestKit import org.junit.jupiter.api.extension.{ AfterAllCallback, BeforeTestExecutionCallback, ExtensionContext } import org.junit.platform.commons.support.AnnotationSupport -final class TestKitJUnit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback { +final class TestKitJunit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback { var testKit: Option[ActorTestKit] = None diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnitResource.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala similarity index 95% rename from actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnitResource.scala rename to actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala index a92af603015..72f7e14d323 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnitResource.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunitResource.scala @@ -59,14 +59,14 @@ import pekko.util.Timeout * The application.conf of your project is not used in this case. * A specific configuration can be passed as constructor parameter. */ -final class TestKitJUnitResource(_kit: ActorTestKit) extends ExternalResource { +final class TestKitJunitResource(_kit: ActorTestKit) extends ExternalResource { /** * Config loaded from `application-test.conf` if that exists, otherwise * using default configuration from the reference.conf resources that ship with the Akka libraries. * The application.conf of your project is not used in this case. */ - def this() = this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJUnitResource]))) + def this() = this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]))) /** * Use a custom [[pekko.actor.typed.ActorSystem]] for the actor system. @@ -79,20 +79,20 @@ final class TestKitJUnitResource(_kit: ActorTestKit) extends ExternalResource { def this(customConfig: String) = this( ActorTestKit.create( - TestKitUtils.testNameFromCallStack(classOf[TestKitJUnitResource]), + TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]), ConfigFactory.parseString(customConfig))) /** * Use a custom config for the actor system. */ def this(customConfig: Config) = - this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJUnitResource]), customConfig)) + this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]), customConfig)) /** * Use a custom config for the actor system, and a custom [[pekko.actor.testkit.typed.TestKitSettings]]. */ def this(customConfig: Config, settings: TestKitSettings) = - this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJUnitResource]), customConfig, settings)) + this(ActorTestKit.create(TestKitUtils.testNameFromCallStack(classOf[TestKitJunitResource]), customConfig, settings)) @Rule val testKit: ActorTestKit = _kit diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java similarity index 90% rename from actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java rename to actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java index 7038d779528..0873455e688 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java @@ -12,7 +12,7 @@ import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; import org.apache.pekko.actor.Address; import org.apache.pekko.actor.testkit.typed.javadsl.*; -import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder; +import org.apache.pekko.actor.testkit.typed.javadsl.Junit5TestKitBuilder; import org.apache.pekko.actor.typed.ActorRef; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -23,10 +23,10 @@ // #junit5-integration @DisplayName("JUnit5") -@ExtendWith(TestKitJUnit5Extension.class) -class JUnit5IntegrationExampleTest { +@ExtendWith(TestKitJunit5Extension.class) +class Junit5IntegrationExampleTest { - @JUnit5TestKit public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); + @JUnit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); @Test void junit5Test() { diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JunitIntegrationExampleTest.java similarity index 86% rename from actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java rename to actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JunitIntegrationExampleTest.java index d6916d5d422..756ea86fce1 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnitIntegrationExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JunitIntegrationExampleTest.java @@ -19,15 +19,15 @@ import org.junit.Rule; // #junit-integration -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; import org.junit.Test; -public class JUnitIntegrationExampleTest { +public class JunitIntegrationExampleTest { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); // #junit-integration // this is shown in LogCapturingExampleTest diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExampleTest.java index a4aa4eceb3c..5e2e4e322c9 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExampleTest.java @@ -17,7 +17,7 @@ // #log-capturing import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -26,7 +26,7 @@ public class LogCapturingExampleTest { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java index 402bc686d96..cc091f43ffa 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java @@ -13,7 +13,7 @@ import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; import org.apache.pekko.actor.testkit.typed.javadsl.*; -import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder; +import org.apache.pekko.actor.testkit.typed.javadsl.Junit5TestKitBuilder; import org.apache.pekko.actor.typed.ActorRef; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -24,11 +24,11 @@ // test code copied from LogCapturingExampleTest.java @DisplayName("Junit5 log capturing") -@ExtendWith(TestKitJUnit5Extension.class) +@ExtendWith(TestKitJunit5Extension.class) @ExtendWith(LogCapturingExtension.class) class LogCapturingExtensionExampleTest { - @JUnit5TestKit public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); + @JUnit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); @Test void testSomething() { diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/ManualTimerExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/ManualTimerExampleTest.java index e298db70c4b..107ddd56396 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/ManualTimerExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/ManualTimerExampleTest.java @@ -18,7 +18,7 @@ import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.actor.testkit.typed.javadsl.ManualTime; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.junit.ClassRule; import org.junit.Rule; import org.scalatestplus.junit.JUnitSuite; @@ -33,7 +33,7 @@ public class ManualTimerExampleTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = new TestKitJUnitResource(ManualTime.config()); + public static final TestKitJunitResource testKit = new TestKitJunitResource(ManualTime.config()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java similarity index 87% rename from actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java rename to actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java index 474feb3a006..1114c62dda5 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java @@ -27,22 +27,22 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; @DisplayName("ActorTestKitTestJunit5") -@ExtendWith(TestKitJUnit5Extension.class) +@ExtendWith(TestKitJunit5Extension.class) @ExtendWith(LogCapturingExtension.class) -class ActorTestKitJUnit5Test extends JUnitSuite { +class ActorTestKitJunit5Test extends JUnitSuite { - @JUnit5TestKit public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); + @JUnit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); @Test void systemNameShouldComeFromTestClassViaJunitResource() { - assertEquals("ActorTestKitJUnit5Test", testKit.system().name()); + assertEquals("ActorTestKitJunit5Test", testKit.system().name()); } @Test void systemNameShouldComeFromTestClass() { final ActorTestKit testKit2 = ActorTestKit.create(); try { - assertEquals("ActorTestKitJUnit5Test", testKit2.system().name()); + assertEquals("ActorTestKitJunit5Test", testKit2.system().name()); } finally { testKit2.shutdownTestKit(); } diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitTest.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitTest.java index 8d539b31ad7..ec6209a06c8 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitTest.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitTest.java @@ -29,7 +29,7 @@ public class ActorTestKitTest extends JUnitSuite { - @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKitTest.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKitTest.java index 990da0ac8cb..83bb9bb7b68 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKitTest.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/LoggingTestKitTest.java @@ -29,7 +29,7 @@ public class LoggingTestKitTest extends JUnitSuite { - @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/TestProbeTest.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/TestProbeTest.java index afba0c0a749..e8cffba7d34 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/TestProbeTest.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/TestProbeTest.java @@ -28,7 +28,7 @@ public class TestProbeTest extends JUnitSuite { - @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala similarity index 81% rename from actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala rename to actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala index 68571d6fe57..a6c4d56f71e 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala @@ -20,14 +20,14 @@ package org.apache.pekko.actor.testkit.typed.scaladsl import org.apache.pekko import pekko.actor.typed.ActorSystem import com.typesafe.config.ConfigFactory -import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder +import org.apache.pekko.actor.testkit.typed.javadsl.Junit5TestKitBuilder import org.scalatest.wordspec.AnyWordSpec -class JUnit5TestKitBuilderSpec extends AnyWordSpec { +class Junit5TestKitBuilderSpec extends AnyWordSpec { "the Junit5TestKitBuilder" should { "create a Testkit with name hello" in { - val actualTestKit = new JUnit5TestKitBuilder().withName("hello").build() + val actualTestKit = new Junit5TestKitBuilder().withName("hello").build() assertResult("hello")(actualTestKit.system.name) } @@ -35,10 +35,10 @@ class JUnit5TestKitBuilderSpec extends AnyWordSpec { "the Junit5TestKitBuilder" should { "create a Testkit with the classname as name" in { - val actualTestKit = new JUnit5TestKitBuilder() + val actualTestKit = new Junit5TestKitBuilder() .build() - assertResult("JUnit5TestKitBuilderSpec")(actualTestKit.system.name) + assertResult("Junit5TestKitBuilderSpec")(actualTestKit.system.name) } } @@ -46,11 +46,11 @@ class JUnit5TestKitBuilderSpec extends AnyWordSpec { "create a Testkit with a custom config" in { val conf = ConfigFactory.load("application.conf") - val actualTestKit = new JUnit5TestKitBuilder() + val actualTestKit = new Junit5TestKitBuilder() .withCustomConfig(conf) .build() assertResult("someValue")(actualTestKit.system.settings.config.getString("test.value")) - assertResult("JUnit5TestKitBuilderSpec")(actualTestKit.system.name) + assertResult("Junit5TestKitBuilderSpec")(actualTestKit.system.name) } } @@ -59,7 +59,7 @@ class JUnit5TestKitBuilderSpec extends AnyWordSpec { "create a Testkit with a custom config and name" in { val conf = ConfigFactory.load("application.conf") - val actualTestKit = new JUnit5TestKitBuilder() + val actualTestKit = new Junit5TestKitBuilder() .withCustomConfig(conf) .withName("hello") .build() @@ -74,7 +74,7 @@ class JUnit5TestKitBuilderSpec extends AnyWordSpec { val system: ActorSystem[GreeterMain.SayHello] = ActorSystem(GreeterMain(), "AkkaQuickStart") - val actualTestKit = new JUnit5TestKitBuilder() + val actualTestKit = new Junit5TestKitBuilder() .withSystem(system) .build() assertResult("AkkaQuickStart")(actualTestKit.system.name) diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/AggregatorTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/AggregatorTest.java index faac99d6a30..7cbe7ddf2aa 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/AggregatorTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/AggregatorTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -42,7 +42,7 @@ import static org.junit.Assert.assertEquals; public class AggregatorTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/BubblingSampleTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/BubblingSampleTest.java index 36cc019ef56..9154a2c03b4 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/BubblingSampleTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/BubblingSampleTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -30,8 +30,8 @@ public class BubblingSampleTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource("pekko.loglevel = off"); + public static final TestKitJunitResource testKit = + new TestKitJunitResource("pekko.loglevel = off"); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsAskWithStatusTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsAskWithStatusTest.java index a37cd326f1b..487ab389cb0 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsAskWithStatusTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsAskWithStatusTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.ActorSystem; import org.apache.pekko.actor.typed.Behavior; @@ -34,7 +34,7 @@ public class InteractionPatternsAskWithStatusTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsTest.java index 4fe181f71a0..6db6677fa5f 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/InteractionPatternsTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.ActorSystem; import org.apache.pekko.actor.typed.Behavior; @@ -875,7 +875,7 @@ private Behavior onUpdateResult(WrappedUpdateResult wrapped) { } - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/MailboxDocTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/MailboxDocTest.java index 9e6957533af..c0486f57d8c 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/MailboxDocTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/MailboxDocTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -30,8 +30,8 @@ public class MailboxDocTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource(ConfigFactory.load("mailbox-config-sample.conf")); + public static final TestKitJunitResource testKit = + new TestKitJunitResource(ConfigFactory.load("mailbox-config-sample.conf")); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/RouterTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/RouterTest.java index fc72c2b2225..d0852dda26e 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/RouterTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/RouterTest.java @@ -30,7 +30,7 @@ import org.apache.pekko.actor.typed.receptionist.Receptionist; import org.apache.pekko.actor.typed.receptionist.ServiceKey; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.junit.ClassRule; @@ -41,7 +41,7 @@ public class RouterTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); static // #routee class Worker { diff --git a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/StashDocTest.java b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/StashDocTest.java index 1fad353732b..629de968843 100644 --- a/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/StashDocTest.java +++ b/actor-typed-tests/src/test/java/jdocs/org/apache/pekko/typed/StashDocTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -31,7 +31,7 @@ public class StashDocTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextAskTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextAskTest.java index 6cd142df69c..a2778dca287 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextAskTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextAskTest.java @@ -19,7 +19,7 @@ import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.pattern.StatusReply; import org.apache.pekko.testkit.PekkoSpec; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.junit.ClassRule; import org.junit.Rule; @@ -31,7 +31,7 @@ public class ActorContextAskTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = new TestKitJUnitResource(PekkoSpec.testConf()); + public static final TestKitJunitResource testKit = new TestKitJunitResource(PekkoSpec.testConf()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextPipeToSelfTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextPipeToSelfTest.java index 36d5aba056f..c9c25644341 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextPipeToSelfTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorContextPipeToSelfTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; import org.apache.pekko.actor.testkit.typed.javadsl.LoggingTestKit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -36,8 +36,8 @@ public final class ActorContextPipeToSelfTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource( + public static final TestKitJunitResource testKit = + new TestKitJunitResource( ConfigFactory.parseString( "pipe-to-self-spec-dispatcher.executor = thread-pool-executor\n" + "pipe-to-self-spec-dispatcher.type = PinnedDispatcher\n")); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorLoggingTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorLoggingTest.java index 87a262d9325..aebaf8a84a8 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorLoggingTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ActorLoggingTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.actor.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.event.Logging; @@ -34,8 +34,8 @@ public class ActorLoggingTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource( + public static final TestKitJunitResource testKit = + new TestKitJunitResource( ConfigFactory.parseString( "pekko.loglevel = INFO\n" + "pekko.loggers = [\"org.apache.pekko.testkit.TestEventListener\"]")); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/BehaviorBuilderTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/BehaviorBuilderTest.java index f7baa56a061..6e6d3ebf534 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/BehaviorBuilderTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/BehaviorBuilderTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.actor.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.junit.ClassRule; import org.junit.Rule; @@ -34,7 +34,7 @@ /** Test creating [[Behavior]]s using [[BehaviorBuilder]] */ public class BehaviorBuilderTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/InterceptTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/InterceptTest.java index 37ae36b9046..fb956b89ec7 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/InterceptTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/InterceptTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.actor.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.*; import org.apache.pekko.testkit.PekkoSpec; @@ -26,7 +26,7 @@ public class InterceptTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = new TestKitJUnitResource(PekkoSpec.testConf()); + public static final TestKitJunitResource testKit = new TestKitJunitResource(PekkoSpec.testConf()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ReceiveBuilderTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ReceiveBuilderTest.java index 1a587bdb89d..552598cf550 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ReceiveBuilderTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/ReceiveBuilderTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.actor.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.PostStop; @@ -30,7 +30,7 @@ /** Test creating [[MutableActor]]s using [[ReceiveBuilder]] */ public class ReceiveBuilderTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/RoutersTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/RoutersTest.java index 1406854edfb..914f35a0bbb 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/RoutersTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/RoutersTest.java @@ -16,7 +16,7 @@ import java.util.List; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -33,7 +33,7 @@ public class RoutersTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = new TestKitJUnitResource(PekkoSpec.testConf()); + public static final TestKitJunitResource testKit = new TestKitJunitResource(PekkoSpec.testConf()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/WatchTest.java b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/WatchTest.java index 7f0c25fb7fd..07d9734f96b 100644 --- a/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/WatchTest.java +++ b/actor-typed-tests/src/test/java/org/apache/pekko/actor/typed/javadsl/WatchTest.java @@ -18,7 +18,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.junit.ClassRule; import org.junit.Rule; import org.scalatestplus.junit.JUnitSuite; @@ -33,7 +33,7 @@ public class WatchTest extends JUnitSuite { - @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleDocTest.java b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleDocTest.java index ca1f506fd65..96704d26d1c 100644 --- a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleDocTest.java +++ b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleDocTest.java @@ -23,7 +23,7 @@ // #test import java.math.BigDecimal; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.persistence.testkit.javadsl.EventSourcedBehaviorTestKit; import org.apache.pekko.persistence.testkit.javadsl.EventSourcedBehaviorTestKit.CommandResultWithReply; @@ -45,8 +45,8 @@ public class AccountExampleDocTest // #testkit @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource(EventSourcedBehaviorTestKit.config()); + public static final TestKitJunitResource testKit = + new TestKitJunitResource(EventSourcedBehaviorTestKit.config()); private EventSourcedBehaviorTestKit< AccountEntity.Command, AccountEntity.Event, AccountEntity.Account> diff --git a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleTest.java b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleTest.java index 519b5008131..9c7be244d05 100644 --- a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleTest.java +++ b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/AccountExampleTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.cluster.sharding.typed.javadsl.ClusterSharding; import org.apache.pekko.cluster.sharding.typed.javadsl.Entity; @@ -53,7 +53,7 @@ public class AccountExampleTest extends JUnitSuite { + "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java index 09593da595e..1956740303c 100644 --- a/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java +++ b/cluster-sharding-typed/src/test/java/jdocs/org/apache/pekko/cluster/sharding/typed/HelloWorldEventSourcedEntityExampleTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.cluster.sharding.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.cluster.sharding.typed.javadsl.ClusterSharding; import org.apache.pekko.cluster.sharding.typed.javadsl.EntityRef; @@ -43,7 +43,7 @@ public class HelloWorldEventSourcedEntityExampleTest extends JUnitSuite { + "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingTest.java b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingTest.java index 7d0ca931daf..25599dd4d1d 100644 --- a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingTest.java +++ b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/ReplicatedShardingTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.cluster.sharding.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -217,8 +217,8 @@ private Behavior onForwardToAll(ForwardToAll forwardToAll) { } @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource( + public static final TestKitJunitResource testKit = + new TestKitJunitResource( ConfigFactory.parseString( " pekko.loglevel = DEBUG\n" + " pekko.loggers = [\"org.apache.pekko.testkit.SilenceAllTestEventListener\"]\n" diff --git a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java index 6533d2ab18e..31b731b43ac 100644 --- a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java +++ b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ClusterShardingPersistenceTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.cluster.typed.Cluster; @@ -45,7 +45,7 @@ public class ClusterShardingPersistenceTest extends JUnitSuite { + "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest.java b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest.java index 066de57bf27..5cd44b69037 100644 --- a/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest.java +++ b/cluster-sharding-typed/src/test/java/org/apache/pekko/cluster/sharding/typed/javadsl/ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.cluster.sharding.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.cluster.typed.Cluster; @@ -26,7 +26,7 @@ public class ShardingEventSourcedEntityWithEnforcedRepliesCompileOnlyTest { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/cluster-typed/src/test/java/jdocs/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorDocTest.java b/cluster-typed/src/test/java/jdocs/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorDocTest.java index 0d8cf2ae9a3..51b57039f88 100644 --- a/cluster-typed/src/test/java/jdocs/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorDocTest.java +++ b/cluster-typed/src/test/java/jdocs/org/apache/pekko/cluster/ddata/typed/javadsl/ReplicatorDocTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.cluster.ddata.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.cluster.ddata.GCounter; @@ -43,7 +43,7 @@ public class ReplicatorDocTest extends JUnitSuite { + "pekko.remote.artery.canonical.port = 0 \n" + "pekko.remote.artery.canonical.hostname = 127.0.0.1 \n"); - @ClassRule public static TestKitJUnitResource testKit = new TestKitJUnitResource(config); + @ClassRule public static TestKitJunitResource testKit = new TestKitJunitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/docs/src/test/java/jdocs/persistence/testkit/PersistenceInitTest.java b/docs/src/test/java/jdocs/persistence/testkit/PersistenceInitTest.java index 74a5acf8b7b..39728dadfab 100644 --- a/docs/src/test/java/jdocs/persistence/testkit/PersistenceInitTest.java +++ b/docs/src/test/java/jdocs/persistence/testkit/PersistenceInitTest.java @@ -13,7 +13,7 @@ package jdocs.persistence.testkit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import com.typesafe.config.ConfigFactory; import jdocs.AbstractJavaTest; @@ -34,8 +34,8 @@ public class PersistenceInitTest extends AbstractJavaTest { @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource( + public static final TestKitJunitResource testKit = + new TestKitJunitResource( ConfigFactory.parseString( "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n" diff --git a/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitPolicySampleTest.java b/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitPolicySampleTest.java index 4da0ca96ada..866db91d55f 100644 --- a/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitPolicySampleTest.java +++ b/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitPolicySampleTest.java @@ -13,7 +13,7 @@ package jdocs.persistence.testkit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.persistence.testkit.JournalOperation; import org.apache.pekko.persistence.testkit.PersistenceTestKitPlugin; @@ -34,8 +34,8 @@ public class PersistenceTestKitPolicySampleTest extends AbstractJavaTest { @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource( + public static final TestKitJunitResource testKit = + new TestKitJunitResource( PersistenceTestKitPlugin.getInstance() .config() .withFallback(ConfigFactory.defaultApplication())); diff --git a/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitSampleTest.java b/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitSampleTest.java index 15e802297c7..fbd26f1082e 100644 --- a/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitSampleTest.java +++ b/docs/src/test/java/jdocs/persistence/testkit/PersistenceTestKitSampleTest.java @@ -13,7 +13,7 @@ package jdocs.persistence.testkit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; import org.apache.pekko.actor.typed.javadsl.Behaviors; @@ -35,8 +35,8 @@ public class PersistenceTestKitSampleTest extends AbstractJavaTest { @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource( + public static final TestKitJunitResource testKit = + new TestKitJunitResource( PersistenceTestKitPlugin.getInstance() .config() .withFallback(ConfigFactory.defaultApplication())); diff --git a/docs/src/test/java/jdocs/stream/operators/SourceDocExamples.java b/docs/src/test/java/jdocs/stream/operators/SourceDocExamples.java index 675fdabda5b..531d4f38778 100644 --- a/docs/src/test/java/jdocs/stream/operators/SourceDocExamples.java +++ b/docs/src/test/java/jdocs/stream/operators/SourceDocExamples.java @@ -19,7 +19,7 @@ import org.apache.pekko.NotUsed; import org.apache.pekko.actor.ActorSystem; import org.apache.pekko.actor.testkit.typed.javadsl.ManualTime; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.stream.javadsl.Source; // #range-imports @@ -43,7 +43,7 @@ public class SourceDocExamples { - public static final TestKitJUnitResource testKit = new TestKitJUnitResource(ManualTime.config()); + public static final TestKitJunitResource testKit = new TestKitJunitResource(ManualTime.config()); public static void fromExample() { final ActorSystem system = null; diff --git a/docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java b/docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java index c98320b18e8..1121e80ee1a 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_3/DeviceTest.java @@ -14,7 +14,7 @@ package jdocs.typed.tutorial_3; // #device-read-test -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -33,7 +33,7 @@ public class DeviceTest { public class DeviceTest extends org.scalatestplus.junit.JUnitSuite { // #device-read-test - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Test public void testReplyWithEmptyReadingIfNoTemperatureIsKnown() { diff --git a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java index 52528d6e693..b794142f4c3 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceGroupTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_4; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -33,7 +33,7 @@ public class DeviceGroupTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); // #device-group-test-registration @Test diff --git a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java index 0e2804559cd..9103980fbdc 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceManagerTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_4; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -27,7 +27,7 @@ public class DeviceManagerTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Test public void testReplyToRegistrationRequests() { diff --git a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java index f5c24755741..198c99d843f 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_4/DeviceTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_4; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -26,7 +26,7 @@ public class DeviceTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); // #device-read-test @Test diff --git a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java index 030ad2ec38c..2e342f9d5c8 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupQueryTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_5; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -36,7 +36,7 @@ public class DeviceGroupQueryTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); // #query-test-normal @Test diff --git a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java index 83e2bf4f906..4785c242416 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceGroupTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_5; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -40,7 +40,7 @@ public class DeviceGroupTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Test public void testReplyToRegistrationRequests() { diff --git a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java index f27744cab74..f3b91d3bebe 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceManagerTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_5; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -27,7 +27,7 @@ public class DeviceManagerTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Test public void testReplyToRegistrationRequests() { diff --git a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java index 91a470fcbf7..c9603524ca9 100644 --- a/docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java +++ b/docs/src/test/java/jdocs/typed/tutorial_5/DeviceTest.java @@ -13,7 +13,7 @@ package jdocs.typed.tutorial_5; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.junit.ClassRule; @@ -26,7 +26,7 @@ public class DeviceTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Test public void testReplyWithEmptyReadingIfNoTemperatureIsKnown() { diff --git a/persistence-typed-tests/src/test/java/jdocs/org/apache/pekko/persistence/typed/ReplicatedAuctionExampleTest.java b/persistence-typed-tests/src/test/java/jdocs/org/apache/pekko/persistence/typed/ReplicatedAuctionExampleTest.java index 37306989604..0b39f4ee057 100644 --- a/persistence-typed-tests/src/test/java/jdocs/org/apache/pekko/persistence/typed/ReplicatedAuctionExampleTest.java +++ b/persistence-typed-tests/src/test/java/jdocs/org/apache/pekko/persistence/typed/ReplicatedAuctionExampleTest.java @@ -14,7 +14,7 @@ package jdocs.org.apache.pekko.persistence.typed; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -54,8 +54,8 @@ public class ReplicatedAuctionExampleTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource(PersistenceTestKitPlugin.getInstance().config()); + public static final TestKitJunitResource testKit = + new TestKitJunitResource(PersistenceTestKitPlugin.getInstance().config()); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTest.java b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTest.java index 272a134f4bf..282b33c648d 100644 --- a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTest.java +++ b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/ReplicatedEventSourcingTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -152,8 +152,8 @@ public EventHandler, String> eventHandler() { } @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource( + public static final TestKitJunitResource testKit = + new TestKitJunitResource( ConfigFactory.parseString( "pekko.loglevel = INFO\n" + "pekko.loggers = [\"org.apache.pekko.testkit.TestEventListener\"]") diff --git a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedActorFailureTest.java b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedActorFailureTest.java index ad8b3aa2b8e..cbc28ba550a 100644 --- a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedActorFailureTest.java +++ b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedActorFailureTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.actor.testkit.typed.TestException; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -93,7 +93,7 @@ public class EventSourcedActorFailureTest extends JUnitSuite { public static final Config config = conf().withFallback(ConfigFactory.load()); - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehaviorJavaDslTest.java b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehaviorJavaDslTest.java index ed8becc8402..bb75d62b409 100644 --- a/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehaviorJavaDslTest.java +++ b/persistence-typed-tests/src/test/java/org/apache/pekko/persistence/typed/javadsl/EventSourcedBehaviorJavaDslTest.java @@ -16,7 +16,7 @@ import org.apache.pekko.Done; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; import org.apache.pekko.actor.testkit.typed.javadsl.LoggingTestKit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.*; import org.apache.pekko.actor.typed.javadsl.ActorContext; @@ -54,8 +54,8 @@ public class EventSourcedBehaviorJavaDslTest extends JUnitSuite { @ClassRule - public static final TestKitJUnitResource testKit = - new TestKitJUnitResource( + public static final TestKitJunitResource testKit = + new TestKitJunitResource( ConfigFactory.parseString( "pekko.loglevel = INFO\n" + "pekko.loggers = [\"org.apache.pekko.testkit.TestEventListener\"]") diff --git a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/LoggerSourceTest.java b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/LoggerSourceTest.java index b2c628db5a5..a6fab5a6117 100644 --- a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/LoggerSourceTest.java +++ b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/LoggerSourceTest.java @@ -15,7 +15,7 @@ import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; import org.apache.pekko.actor.testkit.typed.javadsl.LoggingTestKit; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -41,7 +41,7 @@ public class LoggerSourceTest extends JUnitSuite { "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/NullEmptyStateTest.java b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/NullEmptyStateTest.java index 82a85711107..c0a3401b28e 100644 --- a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/NullEmptyStateTest.java +++ b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/NullEmptyStateTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.persistence.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -35,7 +35,7 @@ public class NullEmptyStateTest extends JUnitSuite { "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/PrimitiveStateTest.java b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/PrimitiveStateTest.java index f330da8b8bf..2ad5fd4beac 100644 --- a/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/PrimitiveStateTest.java +++ b/persistence-typed/src/test/java/org/apache/pekko/persistence/typed/javadsl/PrimitiveStateTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.persistence.typed.javadsl; import org.apache.pekko.actor.testkit.typed.javadsl.LogCapturing; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -35,7 +35,7 @@ public class PrimitiveStateTest extends JUnitSuite { "pekko.persistence.journal.plugin = \"pekko.persistence.journal.inmem\" \n" + "pekko.persistence.journal.inmem.test-serialization = on \n"); - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(config); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(config); @Rule public final LogCapturing logCapturing = new LogCapturing(); diff --git a/stream-typed/src/test/java/org/apache/pekko/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java b/stream-typed/src/test/java/org/apache/pekko/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java index abe158d730b..0fe48c045a5 100644 --- a/stream-typed/src/test/java/org/apache/pekko/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java +++ b/stream-typed/src/test/java/org/apache/pekko/stream/typed/javadsl/CustomGuardianAndMaterializerTest.java @@ -14,7 +14,7 @@ package org.apache.pekko.stream.typed.javadsl; import org.apache.pekko.Done; -import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJUnitResource; +import org.apache.pekko.actor.testkit.typed.javadsl.TestKitJunitResource; import org.apache.pekko.actor.testkit.typed.javadsl.TestProbe; import org.apache.pekko.actor.typed.ActorRef; import org.apache.pekko.actor.typed.Behavior; @@ -34,7 +34,7 @@ public class CustomGuardianAndMaterializerTest extends JUnitSuite { - @ClassRule public static final TestKitJUnitResource testKit = new TestKitJUnitResource(); + @ClassRule public static final TestKitJunitResource testKit = new TestKitJunitResource(); @Test public void useSystemWideMaterialiser() throws Exception { From 55e834a1ed64100e161c2d3e815f0e1ce485e8cd Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 19 Oct 2023 21:18:23 +0200 Subject: [PATCH 04/13] Cleanup remaining residuals of renaming from JUnit to Junit --- .../annotations/{JUnit5TestKit.java => Junit5TestKit.java} | 2 +- .../testkit/typed/javadsl/TestKitJunit5Extension.scala | 7 +++---- .../typed/javadsl/Junit5IntegrationExampleTest.java | 6 +++--- .../typed/javadsl/LogCapturingExtensionExampleTest.java | 4 ++-- .../testkit/typed/javadsl/ActorTestKitJunit5Test.java | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) rename actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/{JUnit5TestKit.java => Junit5TestKit.java} (96%) diff --git a/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java b/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/Junit5TestKit.java similarity index 96% rename from actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java rename to actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/Junit5TestKit.java index cb6f7ed684d..adbbf80d378 100644 --- a/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java +++ b/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/Junit5TestKit.java @@ -22,4 +22,4 @@ @Documented @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) -public @interface JUnit5TestKit {} +public @interface Junit5TestKit {} diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala index 71f78de6646..e3b1fb409a9 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala @@ -17,9 +17,8 @@ package org.apache.pekko.actor.testkit.typed.javadsl -import org.apache.pekko -import pekko.actor.testkit.typed.annotations.JUnit5TestKit -import org.junit.jupiter.api.extension.{ AfterAllCallback, BeforeTestExecutionCallback, ExtensionContext } +import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit +import org.junit.jupiter.api.extension.{AfterAllCallback, BeforeTestExecutionCallback, ExtensionContext} import org.junit.platform.commons.support.AnnotationSupport final class TestKitJunit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback { @@ -32,7 +31,7 @@ final class TestKitJunit5Extension() extends AfterAllCallback with BeforeTestExe override def beforeTestExecution(context: ExtensionContext): Unit = { context.getTestInstance.ifPresent((instance: AnyRef) => { - val annotations = AnnotationSupport.findAnnotatedFieldValues(instance, classOf[JUnit5TestKit]) + val annotations = AnnotationSupport.findAnnotatedFieldValues(instance, classOf[Junit5TestKit]) val fieldValue = annotations.stream().findFirst().orElseThrow(() => throw new IllegalArgumentException("Could not find field annotated with @Junit5TestKit")) testKit = Some(fieldValue.asInstanceOf[ActorTestKit]) diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java index 0873455e688..5f14d5f0106 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java @@ -9,7 +9,7 @@ package jdocs.org.apache.pekko.actor.testkit.typed.javadsl; -import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; +import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit; import org.apache.pekko.actor.Address; import org.apache.pekko.actor.testkit.typed.javadsl.*; import org.apache.pekko.actor.testkit.typed.javadsl.Junit5TestKitBuilder; @@ -22,11 +22,11 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; // #junit5-integration -@DisplayName("JUnit5") +@DisplayName("Junit5") @ExtendWith(TestKitJunit5Extension.class) class Junit5IntegrationExampleTest { - @JUnit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); + @Junit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); @Test void junit5Test() { diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java index cc091f43ffa..7aeab314f18 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java @@ -11,7 +11,7 @@ // #log-capturing-junit5 -import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; +import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit; import org.apache.pekko.actor.testkit.typed.javadsl.*; import org.apache.pekko.actor.testkit.typed.javadsl.Junit5TestKitBuilder; import org.apache.pekko.actor.typed.ActorRef; @@ -28,7 +28,7 @@ @ExtendWith(LogCapturingExtension.class) class LogCapturingExtensionExampleTest { - @JUnit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); + @Junit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); @Test void testSomething() { diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java index 1114c62dda5..663705ac940 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java @@ -9,7 +9,7 @@ package org.apache.pekko.actor.testkit.typed.javadsl; -import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; +import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit; import org.apache.pekko.Done; import org.apache.pekko.actor.typed.javadsl.Behaviors; @@ -31,7 +31,7 @@ @ExtendWith(LogCapturingExtension.class) class ActorTestKitJunit5Test extends JUnitSuite { - @JUnit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); + @Junit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); @Test void systemNameShouldComeFromTestClassViaJunitResource() { From 4e3c30c9d2d0f2d339392628426cbf23a9412e73 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 20 Oct 2023 08:12:38 +0200 Subject: [PATCH 05/13] headers and scalafmt --- .../typed/javadsl/Junit5TestKitBuilder.scala | 2 +- .../typed/javadsl/LogCapturingExtension.scala | 8 ++++---- .../typed/javadsl/TestKitJunit5Extension.scala | 4 ++-- .../LogCapturingExtensionExampleTest.java | 18 ++++++++++++------ .../testkit/typed/scaladsl/GreeterMain.scala | 2 +- .../scaladsl/Junit5TestKitBuilderSpec.scala | 2 +- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala index 6105cb2a547..cdf171dd500 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala @@ -53,4 +53,4 @@ final class Junit5TestKitBuilder() { ActorTestKit.create(name, customConfig) } -} \ No newline at end of file +} diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala index 5a153ce2cd3..e4fd37c41eb 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtension.scala @@ -25,7 +25,7 @@ final class LogCapturingExtension extends InvocationInterceptor { @throws[Throwable] override def interceptTestMethod(invocation: Invocation[Void], invocationContext: ReflectiveInvocationContext[Method], - extensionContext: ExtensionContext): Unit = { + extensionContext: ExtensionContext): Unit = { val testClassName = invocationContext.getTargetClass.getSimpleName val testMethodName = invocationContext.getExecutable.getName @@ -39,15 +39,15 @@ final class LogCapturingExtension extends InvocationInterceptor { case NonFatal(e) => println( s"--> [${Console.BLUE}${testClassName}: ${testMethodName}${Console.RESET}] " + - s"Start of log messages of test that failed with ${e.getMessage}") + s"Start of log messages of test that failed with ${e.getMessage}") capturingAppender.flush() println( s"<-- [${Console.BLUE}${testClassName}: ${testMethodName}${Console.RESET}] " + - s"End of log messages of test that failed with ${e.getMessage}") + s"End of log messages of test that failed with ${e.getMessage}") throw e } finally { capturingAppender.clear() } } -} \ No newline at end of file +} diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala index e3b1fb409a9..a0731353507 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala @@ -18,7 +18,7 @@ package org.apache.pekko.actor.testkit.typed.javadsl import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit -import org.junit.jupiter.api.extension.{AfterAllCallback, BeforeTestExecutionCallback, ExtensionContext} +import org.junit.jupiter.api.extension.{ AfterAllCallback, BeforeTestExecutionCallback, ExtensionContext } import org.junit.platform.commons.support.AnnotationSupport final class TestKitJunit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback { @@ -45,4 +45,4 @@ final class TestKitJunit5Extension() extends AfterAllCallback with BeforeTestExe testKit.get.shutdownTestKit() } -} \ No newline at end of file +} diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java index 7aeab314f18..0ca0fb95b74 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java @@ -1,15 +1,21 @@ -package jdocs.org.apache.pekko.actor.testkit.typed.javadsl; - /* * Licensed to the Apache Software Foundation (ASF) under one or more - * license agreements; and to You under the Apache License, version 2.0: + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * This file is part of the Apache Pekko project, which was derived from Akka. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -// #log-capturing-junit5 +package jdocs.org.apache.pekko.actor.testkit.typed.javadsl; import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit; import org.apache.pekko.actor.testkit.typed.javadsl.*; diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/GreeterMain.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/GreeterMain.scala index ec1467664d7..456298d3308 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/GreeterMain.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/GreeterMain.scala @@ -59,4 +59,4 @@ object GreeterMain { Behaviors.same } } -} \ No newline at end of file +} diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala index a6c4d56f71e..94f3932b9fe 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala @@ -81,4 +81,4 @@ class Junit5TestKitBuilderSpec extends AnyWordSpec { } } -} \ No newline at end of file +} From 411d80191e0d045e82a31f8a546217a178f2d716 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 20 Oct 2023 08:26:08 +0200 Subject: [PATCH 06/13] Change Junit5 to JUnit5 --- ...{Junit5TestKit.java => JUnit5TestKit.java} | 2 +- ...ilder.scala => JUnit5TestKitBuilder.scala} | 10 +++---- ...ion.scala => TestKitJUnit5Extension.scala} | 10 +++---- ...java => JUnit5IntegrationExampleTest.java} | 13 +++++---- .../LogCapturingExtensionExampleTest.java | 11 ++++---- ...5Test.java => ActorTestKitJUnit5Test.java} | 15 +++++----- ...c.scala => JUnit5TestKitBuilderSpec.scala} | 28 +++++++++---------- 7 files changed, 46 insertions(+), 43 deletions(-) rename actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/{Junit5TestKit.java => JUnit5TestKit.java} (96%) rename actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/{Junit5TestKitBuilder.scala => JUnit5TestKitBuilder.scala} (86%) rename actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/{TestKitJunit5Extension.scala => TestKitJUnit5Extension.scala} (85%) rename actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/{Junit5IntegrationExampleTest.java => JUnit5IntegrationExampleTest.java} (85%) rename actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/{ActorTestKitJunit5Test.java => ActorTestKitJUnit5Test.java} (81%) rename actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/{Junit5TestKitBuilderSpec.scala => JUnit5TestKitBuilderSpec.scala} (74%) diff --git a/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/Junit5TestKit.java b/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java similarity index 96% rename from actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/Junit5TestKit.java rename to actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java index adbbf80d378..cb6f7ed684d 100644 --- a/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/Junit5TestKit.java +++ b/actor-testkit-typed/src/main/java/org/apache/pekko/actor/testkit/typed/annotations/JUnit5TestKit.java @@ -22,4 +22,4 @@ @Documented @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) -public @interface Junit5TestKit {} +public @interface JUnit5TestKit {} diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala similarity index 86% rename from actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala rename to actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala index cdf171dd500..ac3ae80e6e9 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/Junit5TestKitBuilder.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5TestKitBuilder.scala @@ -23,25 +23,25 @@ import pekko.actor.testkit.typed.internal.TestKitUtils import pekko.actor.testkit.typed.scaladsl.ActorTestKit.ApplicationTestConfig import pekko.actor.typed.ActorSystem -final class Junit5TestKitBuilder() { +final class JUnit5TestKitBuilder() { var system: Option[ActorSystem[_]] = None var customConfig: Config = ApplicationTestConfig - var name: String = TestKitUtils.testNameFromCallStack(classOf[Junit5TestKitBuilder]) + var name: String = TestKitUtils.testNameFromCallStack(classOf[JUnit5TestKitBuilder]) - def withSystem(system: ActorSystem[_]): Junit5TestKitBuilder = { + def withSystem(system: ActorSystem[_]): JUnit5TestKitBuilder = { this.system = Some(system) this } - def withCustomConfig(customConfig: Config): Junit5TestKitBuilder = { + def withCustomConfig(customConfig: Config): JUnit5TestKitBuilder = { this.customConfig = customConfig this } - def withName(name: String): Junit5TestKitBuilder = { + def withName(name: String): JUnit5TestKitBuilder = { this.name = name this } diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala similarity index 85% rename from actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala rename to actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala index a0731353507..5ce9e1cf0ce 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJunit5Extension.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala @@ -17,23 +17,23 @@ package org.apache.pekko.actor.testkit.typed.javadsl -import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit +import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit import org.junit.jupiter.api.extension.{ AfterAllCallback, BeforeTestExecutionCallback, ExtensionContext } import org.junit.platform.commons.support.AnnotationSupport -final class TestKitJunit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback { +final class TestKitJUnit5Extension() extends AfterAllCallback with BeforeTestExecutionCallback { var testKit: Option[ActorTestKit] = None /** - * Get a reference to the field annotated with @Junit5Testkit [[Junit5TestKit]] + * Get a reference to the field annotated with @JUnit5Testkit [[JUnit5TestKit]] */ override def beforeTestExecution(context: ExtensionContext): Unit = { context.getTestInstance.ifPresent((instance: AnyRef) => { - val annotations = AnnotationSupport.findAnnotatedFieldValues(instance, classOf[Junit5TestKit]) + val annotations = AnnotationSupport.findAnnotatedFieldValues(instance, classOf[JUnit5TestKit]) val fieldValue = annotations.stream().findFirst().orElseThrow(() => - throw new IllegalArgumentException("Could not find field annotated with @Junit5TestKit")) + throw new IllegalArgumentException("Could not find field annotated with @JUnit5TestKit")) testKit = Some(fieldValue.asInstanceOf[ActorTestKit]) }) } diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java similarity index 85% rename from actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java rename to actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java index 5f14d5f0106..38caae47cf5 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/Junit5IntegrationExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java @@ -9,10 +9,10 @@ package jdocs.org.apache.pekko.actor.testkit.typed.javadsl; -import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit; +import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; import org.apache.pekko.actor.Address; import org.apache.pekko.actor.testkit.typed.javadsl.*; -import org.apache.pekko.actor.testkit.typed.javadsl.Junit5TestKitBuilder; +import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder; import org.apache.pekko.actor.typed.ActorRef; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -22,11 +22,12 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; // #junit5-integration -@DisplayName("Junit5") -@ExtendWith(TestKitJunit5Extension.class) -class Junit5IntegrationExampleTest { +@DisplayName("JUnit5") +@ExtendWith(TestKitJUnit5Extension.class) +class JUnit5IntegrationExampleTest { - @Junit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); + @JUnit5TestKit + public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); @Test void junit5Test() { diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java index 0ca0fb95b74..150914bb23e 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java @@ -17,9 +17,9 @@ package jdocs.org.apache.pekko.actor.testkit.typed.javadsl; -import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit; +import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; import org.apache.pekko.actor.testkit.typed.javadsl.*; -import org.apache.pekko.actor.testkit.typed.javadsl.Junit5TestKitBuilder; +import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder; import org.apache.pekko.actor.typed.ActorRef; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -29,12 +29,13 @@ // test code copied from LogCapturingExampleTest.java -@DisplayName("Junit5 log capturing") -@ExtendWith(TestKitJunit5Extension.class) +@DisplayName("JUnit5 log capturing") +@ExtendWith(TestKitJUnit5Extension.class) @ExtendWith(LogCapturingExtension.class) class LogCapturingExtensionExampleTest { - @Junit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); + @JUnit5TestKit + public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); @Test void testSomething() { diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java similarity index 81% rename from actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java rename to actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java index 663705ac940..6b28f9f9f24 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJunit5Test.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java @@ -9,7 +9,7 @@ package org.apache.pekko.actor.testkit.typed.javadsl; -import org.apache.pekko.actor.testkit.typed.annotations.Junit5TestKit; +import org.apache.pekko.actor.testkit.typed.annotations.JUnit5TestKit; import org.apache.pekko.Done; import org.apache.pekko.actor.typed.javadsl.Behaviors; @@ -26,23 +26,24 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -@DisplayName("ActorTestKitTestJunit5") -@ExtendWith(TestKitJunit5Extension.class) +@DisplayName("ActorTestKitTestJUnit5") +@ExtendWith(TestKitJUnit5Extension.class) @ExtendWith(LogCapturingExtension.class) -class ActorTestKitJunit5Test extends JUnitSuite { +class ActorTestKitJUnit5Test extends JUnitSuite { - @Junit5TestKit public ActorTestKit testKit = new Junit5TestKitBuilder().build(); + @JUnit5TestKit + public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); @Test void systemNameShouldComeFromTestClassViaJunitResource() { - assertEquals("ActorTestKitJunit5Test", testKit.system().name()); + assertEquals("ActorTestKitJUnit5Test", testKit.system().name()); } @Test void systemNameShouldComeFromTestClass() { final ActorTestKit testKit2 = ActorTestKit.create(); try { - assertEquals("ActorTestKitJunit5Test", testKit2.system().name()); + assertEquals("ActorTestKitJUnit5Test", testKit2.system().name()); } finally { testKit2.shutdownTestKit(); } diff --git a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala similarity index 74% rename from actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala rename to actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala index 94f3932b9fe..15bc751dad4 100644 --- a/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/Junit5TestKitBuilderSpec.scala +++ b/actor-testkit-typed/src/test/scala/org/apache/pekko/actor/testkit/typed/scaladsl/JUnit5TestKitBuilderSpec.scala @@ -20,46 +20,46 @@ package org.apache.pekko.actor.testkit.typed.scaladsl import org.apache.pekko import pekko.actor.typed.ActorSystem import com.typesafe.config.ConfigFactory -import org.apache.pekko.actor.testkit.typed.javadsl.Junit5TestKitBuilder +import org.apache.pekko.actor.testkit.typed.javadsl.JUnit5TestKitBuilder import org.scalatest.wordspec.AnyWordSpec -class Junit5TestKitBuilderSpec extends AnyWordSpec { +class JUnit5TestKitBuilderSpec extends AnyWordSpec { - "the Junit5TestKitBuilder" should { + "the JUnit5TestKitBuilder" should { "create a Testkit with name hello" in { - val actualTestKit = new Junit5TestKitBuilder().withName("hello").build() + val actualTestKit = new JUnit5TestKitBuilder().withName("hello").build() assertResult("hello")(actualTestKit.system.name) } } - "the Junit5TestKitBuilder" should { + "the JUnit5TestKitBuilder" should { "create a Testkit with the classname as name" in { - val actualTestKit = new Junit5TestKitBuilder() + val actualTestKit = new JUnit5TestKitBuilder() .build() - assertResult("Junit5TestKitBuilderSpec")(actualTestKit.system.name) + assertResult("JUnit5TestKitBuilderSpec")(actualTestKit.system.name) } } - "the Junit5TestKitBuilder" should { + "the JUnit5TestKitBuilder" should { "create a Testkit with a custom config" in { val conf = ConfigFactory.load("application.conf") - val actualTestKit = new Junit5TestKitBuilder() + val actualTestKit = new JUnit5TestKitBuilder() .withCustomConfig(conf) .build() assertResult("someValue")(actualTestKit.system.settings.config.getString("test.value")) - assertResult("Junit5TestKitBuilderSpec")(actualTestKit.system.name) + assertResult("JUnit5TestKitBuilderSpec")(actualTestKit.system.name) } } - "the Junit5TestKitBuilder" should { + "the JUnit5TestKitBuilder" should { "create a Testkit with a custom config and name" in { val conf = ConfigFactory.load("application.conf") - val actualTestKit = new Junit5TestKitBuilder() + val actualTestKit = new JUnit5TestKitBuilder() .withCustomConfig(conf) .withName("hello") .build() @@ -69,12 +69,12 @@ class Junit5TestKitBuilderSpec extends AnyWordSpec { } } - "the Junit5TestKitBuilder" should { + "the JUnit5TestKitBuilder" should { "create a Testkit with a custom system" in { val system: ActorSystem[GreeterMain.SayHello] = ActorSystem(GreeterMain(), "AkkaQuickStart") - val actualTestKit = new Junit5TestKitBuilder() + val actualTestKit = new JUnit5TestKitBuilder() .withSystem(system) .build() assertResult("AkkaQuickStart")(actualTestKit.system.name) From 785d8be024497b5c6b55daccf535d42e24a91479 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 20 Oct 2023 08:27:34 +0200 Subject: [PATCH 07/13] revert @unused annotation --- .../org/apache/pekko/actor/typed/internal/jfr/Events.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala b/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala index 8fd6978ea84..5158feb4b1b 100644 --- a/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala +++ b/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala @@ -20,8 +20,6 @@ import jdk.jfr.Label import jdk.jfr.StackTrace import org.apache.pekko.annotation.InternalApi -import scala.annotation.unused - // requires jdk9+ to compile // for editing these in IntelliJ, open module settings, change JDK dependency to 11 for only this module @@ -97,7 +95,7 @@ final class DeliveryProducerReceived(val producerId: String, val currentSeqNr: L @StackTrace(false) @Category(Array("Pekko", "Delivery", "ProducerController")) @Label( "Delivery ProducerController received demand request") -final class DeliveryProducerReceivedRequest(val producerId: String, val requestedSeqNr: Long, @unused confirmedSeqNr: Long) +final class DeliveryProducerReceivedRequest(val producerId: String, val requestedSeqNr: Long, confirmedSeqNr: Long) extends Event /** INTERNAL API */ From ce8eb0af9b7abe46ab242da296f2b4704d12f471 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 20 Oct 2023 08:44:00 +0200 Subject: [PATCH 08/13] scalafmt --- .../org/apache/pekko/actor/typed/internal/jfr/Events.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala b/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala index 5158feb4b1b..c0296f6cce1 100644 --- a/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala +++ b/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala @@ -95,7 +95,7 @@ final class DeliveryProducerReceived(val producerId: String, val currentSeqNr: L @StackTrace(false) @Category(Array("Pekko", "Delivery", "ProducerController")) @Label( "Delivery ProducerController received demand request") -final class DeliveryProducerReceivedRequest(val producerId: String, val requestedSeqNr: Long, confirmedSeqNr: Long) +final class DeliveryProducerReceivedRequest(val producerId: String, val requestedSeqNr: Long, confirmedSeqNr: Long) extends Event /** INTERNAL API */ From 42a7ec87670b9223c9ac635ef695ee3435f4fc4e Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 20 Oct 2023 08:58:31 +0200 Subject: [PATCH 09/13] javafmt --- .../testkit/typed/javadsl/JUnit5IntegrationExampleTest.java | 3 +-- .../typed/javadsl/LogCapturingExtensionExampleTest.java | 3 +-- .../actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java index 38caae47cf5..7038d779528 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/JUnit5IntegrationExampleTest.java @@ -26,8 +26,7 @@ @ExtendWith(TestKitJUnit5Extension.class) class JUnit5IntegrationExampleTest { - @JUnit5TestKit - public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); + @JUnit5TestKit public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); @Test void junit5Test() { diff --git a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java index 150914bb23e..1ff8676555f 100644 --- a/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java +++ b/actor-testkit-typed/src/test/java/jdocs/org/apache/pekko/actor/testkit/typed/javadsl/LogCapturingExtensionExampleTest.java @@ -34,8 +34,7 @@ @ExtendWith(LogCapturingExtension.class) class LogCapturingExtensionExampleTest { - @JUnit5TestKit - public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); + @JUnit5TestKit public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); @Test void testSomething() { diff --git a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java index 6b28f9f9f24..4e03cc0bbcd 100644 --- a/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java +++ b/actor-testkit-typed/src/test/java/org/apache/pekko/actor/testkit/typed/javadsl/ActorTestKitJUnit5Test.java @@ -31,8 +31,7 @@ @ExtendWith(LogCapturingExtension.class) class ActorTestKitJUnit5Test extends JUnitSuite { - @JUnit5TestKit - public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); + @JUnit5TestKit public ActorTestKit testKit = new JUnit5TestKitBuilder().build(); @Test void systemNameShouldComeFromTestClassViaJunitResource() { From 1811cb3f28e7ffa422325350eed3a300670c938f Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 20 Oct 2023 15:07:11 +0200 Subject: [PATCH 10/13] scalaify use of java optional --- .../actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala index 5ce9e1cf0ce..dbd6311d283 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala @@ -29,8 +29,8 @@ final class TestKitJUnit5Extension() extends AfterAllCallback with BeforeTestExe * Get a reference to the field annotated with @JUnit5Testkit [[JUnit5TestKit]] */ override def beforeTestExecution(context: ExtensionContext): Unit = { - - context.getTestInstance.ifPresent((instance: AnyRef) => { + val testInstance: Option[AnyRef] = Option.when(context.getTestInstance.isPresent)(context.getTestInstance.get()) + testInstance.map(instance => { val annotations = AnnotationSupport.findAnnotatedFieldValues(instance, classOf[JUnit5TestKit]) val fieldValue = annotations.stream().findFirst().orElseThrow(() => throw new IllegalArgumentException("Could not find field annotated with @JUnit5TestKit")) From a083a19682ebea94a0a2a68e86e32e5b676a8ec6 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 20 Oct 2023 15:23:23 +0200 Subject: [PATCH 11/13] add newline --- actor-testkit-typed/src/test/resources/application.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/actor-testkit-typed/src/test/resources/application.conf b/actor-testkit-typed/src/test/resources/application.conf index a332383c97d..37fd4b4549f 100644 --- a/actor-testkit-typed/src/test/resources/application.conf +++ b/actor-testkit-typed/src/test/resources/application.conf @@ -2,4 +2,6 @@ # used by ActorTestKitSpec test.from-application = yes -test.value = someValue \ No newline at end of file + +# used by JUnit5TestKitBuilderSpec +test.value = someValue From 8961433585ec0bef4bcd77c8e38e64d821189789 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 20 Oct 2023 15:27:45 +0200 Subject: [PATCH 12/13] revert changes to Events.scala --- .../org/apache/pekko/actor/typed/internal/jfr/Events.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala b/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala index c0296f6cce1..02311044278 100644 --- a/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala +++ b/actor-typed/src/main/scala-jdk-9/org/apache/pekko/actor/typed/internal/jfr/Events.scala @@ -18,6 +18,7 @@ import jdk.jfr.Enabled import jdk.jfr.Event import jdk.jfr.Label import jdk.jfr.StackTrace + import org.apache.pekko.annotation.InternalApi // requires jdk9+ to compile From 5b4300c6ecc83063292fd3b05db71adc8fe77bf0 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 20 Oct 2023 15:38:52 +0200 Subject: [PATCH 13/13] replace Option.when with if statement --- .../actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala index dbd6311d283..50d63af7609 100644 --- a/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala +++ b/actor-testkit-typed/src/main/scala/org/apache/pekko/actor/testkit/typed/javadsl/TestKitJUnit5Extension.scala @@ -29,7 +29,8 @@ final class TestKitJUnit5Extension() extends AfterAllCallback with BeforeTestExe * Get a reference to the field annotated with @JUnit5Testkit [[JUnit5TestKit]] */ override def beforeTestExecution(context: ExtensionContext): Unit = { - val testInstance: Option[AnyRef] = Option.when(context.getTestInstance.isPresent)(context.getTestInstance.get()) + val testInstance: Option[AnyRef] = + if (context.getTestInstance.isPresent) Some(context.getTestInstance.get()) else None testInstance.map(instance => { val annotations = AnnotationSupport.findAnnotatedFieldValues(instance, classOf[JUnit5TestKit]) val fieldValue = annotations.stream().findFirst().orElseThrow(() =>