File tree Expand file tree Collapse file tree
atplug-runtime/src/main/java/com/diffplug/atplug
atplug-test-harness/src/main/java/com/diffplug/atplug Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ class PlugInstanceMap {
1010 internal val descriptorMap = mutableMapOf<String , MutableList <PlugDescriptor >>()
1111 internal val instanceMap = mutableMapOf<PlugDescriptor , Any >()
1212
13- fun put (clazz : String , descriptor : PlugDescriptor ) {
13+ fun putDescriptor (clazz : String , descriptor : PlugDescriptor ) {
1414 val descriptors = descriptorMap.computeIfAbsent(clazz) { mutableListOf<PlugDescriptor >() }
1515 descriptors.add(descriptor)
1616 }
1717
18- fun <T > put (clazz : Class <T >, descriptor : PlugDescriptor , instance : T ) {
19- put (clazz.name, descriptor)
18+ fun <T > putInstance (clazz : Class <T >, descriptor : PlugDescriptor , instance : T ) {
19+ putDescriptor (clazz.name, descriptor)
2020 instanceMap[descriptor] = instance!!
2121 }
2222
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ interface PlugRegistry {
7474 val asString = manifestUrl.toExternalForm()
7575 val component = parseComponent(asString, servicePath)
7676 synchronized(this ) {
77- data.put (component.provides, component)
77+ data.putDescriptor (component.provides, component)
7878 owners.get(component.provides)?.doRegister(component)
7979 }
8080 }
Original file line number Diff line number Diff line change @@ -8,13 +8,12 @@ package com.diffplug.atplug
88
99import java.lang.AutoCloseable
1010
11- /* * Creates a harness for local plugin setup. */
1211class PlugHarness {
1312 var map = PlugInstanceMap ()
1413
1514 fun <T > add (clazz : Class <T >, instance : T ): PlugHarness {
1615 val descriptor = SocketOwner .metadataGeneratorFor(clazz).apply (instance)
17- map.put (clazz, PlugDescriptor .fromJson(descriptor), instance)
16+ map.putInstance (clazz, PlugDescriptor .fromJson(descriptor), instance)
1817 return this
1918 }
2019
@@ -23,5 +22,6 @@ class PlugHarness {
2322 return AutoCloseable { PlugRegistry .setHarness(null ) }
2423 }
2524
25+ /* * Returns a beforeEach/afterEach plugin for JUnit5. */
2626 fun junit5 () = com.diffplug.atplug.junit5.AtPlugJUnit5 (this )
2727}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ allprojects {
1212apply from : 干. file(' spotless/freshmark.gradle' )
1313apply from : 干. file(' base/sonatype.gradle' )
1414
15- String VER_JUNIT_JUPITER = ' 5.0.0 '
15+ String VER_JUNIT_JUPITER = ' 5.8.2 '
1616subprojects {
1717 apply from : 干. file(' base/java8.gradle' )
1818 apply from : 干. file(' base/kotlin.gradle' )
@@ -36,7 +36,7 @@ subprojects {
3636 } else if (it. name == ' atplug-test-harness' ) {
3737 ext. maven_name= ' AtPlug test harness'
3838 dependencies {
39- compileOnly " org.junit.jupiter:junit-jupiter-api:${ VER_JUNIT_JUPITER } "
39+ compileOnly " org.junit.jupiter:junit-jupiter-api:5.0.0 "
4040 implementation " org.jetbrains.kotlin:kotlin-reflect:1.6.10"
4141 implementation project(' :atplug-runtime' )
4242 }
You can’t perform that action at this time.
0 commit comments