diff --git a/run-agent.sh b/run-agent.sh index 98a6b337..71199ba5 100755 --- a/run-agent.sh +++ b/run-agent.sh @@ -1,6 +1,6 @@ #!/bin/bash -./gradlew build -p scavenger-agent-java -x test +./gradlew build -p scavenger-agent-java -x test -x integrationTest ./gradlew build -p scavenger-demo -x test java -Dscavenger.configuration=./scavenger-demo/scavenger.conf \ diff --git a/scavenger-demo/src/main/kotlin/com/example/demo/controller/MyController.kt b/scavenger-demo/src/main/kotlin/com/example/demo/controller/MyController.kt index c9a6b6a8..bad4868b 100644 --- a/scavenger-demo/src/main/kotlin/com/example/demo/controller/MyController.kt +++ b/scavenger-demo/src/main/kotlin/com/example/demo/controller/MyController.kt @@ -6,6 +6,7 @@ import com.example.demo.service.BridgeService import com.example.demo.service.CglibProxyService import com.example.demo.service.DynamicProxyService import com.example.demo.service.PojoService +import com.example.demo.service2.TestService import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RestController @@ -14,13 +15,14 @@ class MyController( private val myService: BridgeService, private val dynamicProxyService: DynamicProxyService, private val cglibProxyService: CglibProxyService, - private val asyncService: AsyncService + private val asyncService: AsyncService, + private val testService: TestService ): BaseController() { @GetMapping("") fun hello(): String { dynamicProxyService.aspect() cglibProxyService.aspect() - return "myservice called ${myService.doSth()} / pojoService called ${PojoService().pojoHello()}" + return "myservice called ${myService.doSth()} / pojoService called ${PojoService().pojoHello()} / myService2 called ${testService.call()}" } @GetMapping("/additional") diff --git a/scavenger-demo/src/main/kotlin/com/example/demo/service2/TestService.kt b/scavenger-demo/src/main/kotlin/com/example/demo/service2/TestService.kt new file mode 100644 index 00000000..0a08bd6d --- /dev/null +++ b/scavenger-demo/src/main/kotlin/com/example/demo/service2/TestService.kt @@ -0,0 +1,14 @@ +package com.example.demo.service2 + +import com.example.demo.annotation.ScavengerEnabled +import com.example.demo.service.MyInterface +import com.example.demo.service.MyParentService +import org.springframework.stereotype.Service + +@ScavengerEnabled +@Service +class TestService : MyParentService(), MyInterface { + fun call(): String { + return "test" + } +} diff --git a/scavenger-frontend/src/components/snapshot/SnapshotDetail.vue b/scavenger-frontend/src/components/snapshot/SnapshotDetail.vue index d9cb3782..daa91c31 100644 --- a/scavenger-frontend/src/components/snapshot/SnapshotDetail.vue +++ b/scavenger-frontend/src/components/snapshot/SnapshotDetail.vue @@ -182,7 +182,7 @@ export default { signature = candidate.signature; } else { signature = this.snapshotData.children - .find(child => querySignature.startsWith(child.signature)).signature; + .find(child => this.isStartsWithSignature(querySignature, child.signature)).signature; } await this.updateSnapshotData(signature); } @@ -328,6 +328,17 @@ export default { resizeHorizontal(size) { localStorage.setItem("scavenger.snapshot.horizontal-size", size); }, + isStartsWithSignature(querySignature, signature) { + if (!querySignature.startsWith(signature)) { + return false; + } + + if (querySignature === signature) { + return true; + } + + return querySignature.substring(signature.length).startsWith("."); + }, }, };