Skip to content

Commit

Permalink
headers and scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas committed Oct 20, 2023
1 parent 55e834a commit 4e3c30c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ final class Junit5TestKitBuilder() {
ActorTestKit.create(name, customConfig)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -45,4 +45,4 @@ final class TestKitJunit5Extension() extends AfterAllCallback with BeforeTestExe
testKit.get.shutdownTestKit()
}

}
}
Original file line number Diff line number Diff line change
@@ -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.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ object GreeterMain {
Behaviors.same
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ class Junit5TestKitBuilderSpec extends AnyWordSpec {
}
}

}
}

0 comments on commit 4e3c30c

Please sign in to comment.