{"action":"created","comment":{"url":"https://api.github.com/repos/spekframework/spek/pulls/comments/178457604","pull_request_review_id":108517982,"id":178457604,"diff_hunk":"@@ -0,0 +1,113 @@\n+package org.spekframework.ide\r\n+\r\n+import org.spekframework.spek2.runtime.execution.ExecutionListener\r\n+import org.spekframework.spek2.runtime.execution.ExecutionResult\r\n+import org.spekframework.spek2.runtime.scope.ActionScopeImpl\r\n+import org.spekframework.spek2.runtime.scope.GroupScopeImpl\r\n+import org.spekframework.spek2.runtime.scope.TestScopeImpl\r\n+import java.io.CharArrayWriter\r\n+import java.io.PrintWriter\r\n+\r\n+class ServiceMessageAdapter: ExecutionListener {\r\n+    override fun executionStart() { }\r\n+\r\n+    override fun executionFinish() { }\r\n+\r\n+    override fun testExecutionStart(test: TestScopeImpl) {\r\n+        out(\"testStarted name='${test.path.name.toServiceMessageSafeString()}'\")\r\n+    }\r\n+\r\n+    override fun testExecutionFinish(test: TestScopeImpl, result: ExecutionResult) {\r\n+        val name = test.path.name.toServiceMessageSafeString()\r\n+        if (result is ExecutionResult.Failure) {\r\n+            val exceptionDetails = getExceptionDetails(result)\r\n+            out(\"testFailed name='$name' message='${exceptionDetails.first}' details='${exceptionDetails.second}'\")\r\n+\r\n+        }\r\n+        out(\"testFinished name='$name'\")\r\n+    }\r\n+\r\n+    override fun testIgnored(test: TestScopeImpl, reason: String?) {\r\n+        val name = test.path.name.toServiceMessageSafeString()\r\n+        out(\"testIgnored name='$name' ignoreComment='${reason ?: \"no reason provided\"}'\")\r\n+        out(\"testFinished name='$name'\")\r\n+    }\r\n+\r\n+    override fun groupExecutionStart(group: GroupScopeImpl) {\r\n+        out(\"testSuiteStarted name='${group.path.name.toServiceMessageSafeString()}'\")\r\n+    }\r\n+\r\n+    override fun groupExecutionFinish(group: GroupScopeImpl, result: ExecutionResult) {\r\n+        val name = group.path.name.toServiceMessageSafeString()\r\n+        if (result is ExecutionResult.Failure) {\r\n+            val exceptionDetails = getExceptionDetails(result)\r\n+\r\n+            // fake a child test\r\n+            out(\"testStarted name='$name'\")\r\n+            out(\"testFailed name='$name' message='${exceptionDetails.first}' details='${exceptionDetails.second}'\")\r\n+            out(\"testFinished name='$name'\")\r\n+        }\r\n+        out(\"testSuiteFinished name='$name'\")\r\n+    }\r\n+\r\n+    override fun groupIgnored(group: GroupScopeImpl, reason: String?) {\r\n+        val name = group.path.name.toServiceMessageSafeString()\r\n+        out(\"testIgnored name='$name' ignoreComment='${reason ?: \"no reason provided\"}'\")\r\n+        out(\"testFinished name='$name'\")\r\n+    }\r\n+\r\n+    override fun actionExecutionStart(action: ActionScopeImpl) {\r\n+        out(\"testSuiteStarted name='${action.path.name.toServiceMessageSafeString()}'\")\r\n+    }\r\n+\r\n+    override fun actionExecutionFinish(action: ActionScopeImpl, result: ExecutionResult) {\r\n+        val name = action.path.name.toServiceMessageSafeString()\r\n+        if (result is ExecutionResult.Failure) {\r\n+            val exceptionDetails = getExceptionDetails(result)\r\n+\r\n+            // fake a child test\r\n+            out(\"testStarted name='$name'\")\r\n+            out(\"testFailed name='$name' message='${exceptionDetails.first}' details='${exceptionDetails.second}'\")\r\n+            out(\"testFinished name='$name'\")\r\n+        }\r\n+        out(\"testSuiteFinished name='$name'\")\r\n+    }\r\n+\r\n+    override fun actionIgnored(action: ActionScopeImpl, reason: String?) {\r\n+        val name = action.path.name.toServiceMessageSafeString()\r\n+        out(\"testIgnored name='$name' ignoreComment='${reason ?: \"no reason provided\"}'\")\r\n+        out(\"testFinished name='$name'\")\r\n+    }\r\n+\r\n+    private fun getExceptionDetails(result: ExecutionResult.Failure): Pair<String?, String> {\r\n+        val throwable = result.cause\r\n+        val writer = CharArrayWriter()\r\n+        throwable.printStackTrace(PrintWriter(writer))\r\n+        val details = writer.toString()\r\n+            .toServiceMessageSafeString()\r\n+\r\n+        val message = throwable.message?.toServiceMessageSafeString()\r\n+\r\n+        return message to details\r\n+    }\r\n+\r\n+    private fun String.toServiceMessageSafeString(): String {\r\n+        return this.replace(\"|\", \"||\")\r\n+            .replace(\"\\n\", \"|n\")\r\n+            .replace(\"\\r\", \"|r\")\r\n+            .replace(\"'\", \"|'\")\r\n+            .replace(\"[\", \"|[\")\r\n+            .replace(\"]\", \"|]\")\r\n+            .replace(Regex(\"\"\"\\\\u(\\d\\d\\d\\d)\"\"\")) {\r\n+                \"|0x${it.groupValues[1]}\"\r\n+            }\r\n+    }\r\n+\r\n+    private fun out(event: String) {\r","path":"spek-ide-plugin/interop-jvm/src/main/kotlin/org/spekframework/ide/ServiceMessageAdapter.kt","position":106,"original_position":106,"commit_id":"c08b4bea7db73688e40288c49bf71a9c8d26a8a4","original_commit_id":"c08b4bea7db73688e40288c49bf71a9c8d26a8a4","user":{"login":"ming13","id":200401,"avatar_url":"https://avatars1.githubusercontent.com/u/200401?v=4","gravatar_id":"","url":"https://api.github.com/users/ming13","html_url":"https://github.com/ming13","followers_url":"https://api.github.com/users/ming13/followers","following_url":"https://api.github.com/users/ming13/following{/other_user}","gists_url":"https://api.github.com/users/ming13/gists{/gist_id}","starred_url":"https://api.github.com/users/ming13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ming13/subscriptions","organizations_url":"https://api.github.com/users/ming13/orgs","repos_url":"https://api.github.com/users/ming13/repos","events_url":"https://api.github.com/users/ming13/events{/privacy}","received_events_url":"https://api.github.com/users/ming13/received_events","type":"User","site_admin":false},"body":"Naming doesn’t say much and seems confusing in relation to generic variance.","created_at":"2018-04-01T13:09:00Z","updated_at":"2018-04-01T13:14:47Z","html_url":"https://github.com/spekframework/spek/pull/385#discussion_r178457604","pull_request_url":"https://api.github.com/repos/spekframework/spek/pulls/385","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/spekframework/spek/pulls/comments/178457604"},"html":{"href":"https://github.com/spekframework/spek/pull/385#discussion_r178457604"},"pull_request":{"href":"https://api.github.com/repos/spekframework/spek/pulls/385"}}},"pull_request":{"url":"https://api.github.com/repos/spekframework/spek/pulls/385","id":178474034,"html_url":"https://github.com/spekframework/spek/pull/385","diff_url":"https://github.com/spekframework/spek/pull/385.diff","patch_url":"https://github.com/spekframework/spek/pull/385.patch","issue_url":"https://api.github.com/repos/spekframework/spek/issues/385","number":385,"state":"open","locked":false,"title":"Implement console runner for IJ plugin","user":{"login":"raniejade","id":1041919,"avatar_url":"https://avatars2.githubusercontent.com/u/1041919?v=4","gravatar_id":"","url":"https://api.github.com/users/raniejade","html_url":"https://github.com/raniejade","followers_url":"https://api.github.com/users/raniejade/followers","following_url":"https://api.github.com/users/raniejade/following{/other_user}","gists_url":"https://api.github.com/users/raniejade/gists{/gist_id}","starred_url":"https://api.github.com/users/raniejade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raniejade/subscriptions","organizations_url":"https://api.github.com/users/raniejade/orgs","repos_url":"https://api.github.com/users/raniejade/repos","events_url":"https://api.github.com/users/raniejade/events{/privacy}","received_events_url":"https://api.github.com/users/raniejade/received_events","type":"User","site_admin":false},"body":"This will be responsible for running specs from IntelliJ IDEA. This will bring us closer to have 1:1 plugin parity with `1.x`.","created_at":"2018-03-30T00:54:30Z","updated_at":"2018-04-01T13:14:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2dd8d0f30af0bcf5a21b7518a515c7ebd9548b5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/spekframework/spek/milestones/3","html_url":"https://github.com/spekframework/spek/milestone/3","labels_url":"https://api.github.com/repos/spekframework/spek/milestones/3/labels","id":2782851,"number":3,"title":"2.0.0","description":"Next major release for Spek.\r\n\r\nMain goals:\r\n\r\n- Prepare project for multiplatform runtime support (JVM, JS, Native)\r\n- Restructure API and modules\r\n- Rebuild test engine and abstract it from JUnit5\r\n- Add new `Path` abstraction for better test-subtree execution (related to IntelliJ Plugin)\r\n- Provide official Gradle and Android Gradle Plugin integrations","creator":{"login":"raniejade","id":1041919,"avatar_url":"https://avatars2.githubusercontent.com/u/1041919?v=4","gravatar_id":"","url":"https://api.github.com/users/raniejade","html_url":"https://github.com/raniejade","followers_url":"https://api.github.com/users/raniejade/followers","following_url":"https://api.github.com/users/raniejade/following{/other_user}","gists_url":"https://api.github.com/users/raniejade/gists{/gist_id}","starred_url":"https://api.github.com/users/raniejade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raniejade/subscriptions","organizations_url":"https://api.github.com/users/raniejade/orgs","repos_url":"https://api.github.com/users/raniejade/repos","events_url":"https://api.github.com/users/raniejade/events{/privacy}","received_events_url":"https://api.github.com/users/raniejade/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":29,"state":"open","created_at":"2017-09-21T12:55:22Z","updated_at":"2018-03-30T00:54:30Z","due_on":"2017-11-30T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/spekframework/spek/pulls/385/commits","review_comments_url":"https://api.github.com/repos/spekframework/spek/pulls/385/comments","review_comment_url":"https://api.github.com/repos/spekframework/spek/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spekframework/spek/issues/385/comments","statuses_url":"https://api.github.com/repos/spekframework/spek/statuses/c08b4bea7db73688e40288c49bf71a9c8d26a8a4","head":{"label":"spekframework:ranie-interop-jvm","ref":"ranie-interop-jvm","sha":"c08b4bea7db73688e40288c49bf71a9c8d26a8a4","user":{"login":"spekframework","id":24952163,"avatar_url":"https://avatars0.githubusercontent.com/u/24952163?v=4","gravatar_id":"","url":"https://api.github.com/users/spekframework","html_url":"https://github.com/spekframework","followers_url":"https://api.github.com/users/spekframework/followers","following_url":"https://api.github.com/users/spekframework/following{/other_user}","gists_url":"https://api.github.com/users/spekframework/gists{/gist_id}","starred_url":"https://api.github.com/users/spekframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spekframework/subscriptions","organizations_url":"https://api.github.com/users/spekframework/orgs","repos_url":"https://api.github.com/users/spekframework/repos","events_url":"https://api.github.com/users/spekframework/events{/privacy}","received_events_url":"https://api.github.com/users/spekframework/received_events","type":"Organization","site_admin":false},"repo":{"id":6551658,"name":"spek","full_name":"spekframework/spek","owner":{"login":"spekframework","id":24952163,"avatar_url":"https://avatars0.githubusercontent.com/u/24952163?v=4","gravatar_id":"","url":"https://api.github.com/users/spekframework","html_url":"https://github.com/spekframework","followers_url":"https://api.github.com/users/spekframework/followers","following_url":"https://api.github.com/users/spekframework/following{/other_user}","gists_url":"https://api.github.com/users/spekframework/gists{/gist_id}","starred_url":"https://api.github.com/users/spekframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spekframework/subscriptions","organizations_url":"https://api.github.com/users/spekframework/orgs","repos_url":"https://api.github.com/users/spekframework/repos","events_url":"https://api.github.com/users/spekframework/events{/privacy}","received_events_url":"https://api.github.com/users/spekframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spekframework/spek","description":"A specification framework for Kotlin","fork":false,"url":"https://api.github.com/repos/spekframework/spek","forks_url":"https://api.github.com/repos/spekframework/spek/forks","keys_url":"https://api.github.com/repos/spekframework/spek/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spekframework/spek/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spekframework/spek/teams","hooks_url":"https://api.github.com/repos/spekframework/spek/hooks","issue_events_url":"https://api.github.com/repos/spekframework/spek/issues/events{/number}","events_url":"https://api.github.com/repos/spekframework/spek/events","assignees_url":"https://api.github.com/repos/spekframework/spek/assignees{/user}","branches_url":"https://api.github.com/repos/spekframework/spek/branches{/branch}","tags_url":"https://api.github.com/repos/spekframework/spek/tags","blobs_url":"https://api.github.com/repos/spekframework/spek/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spekframework/spek/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spekframework/spek/git/refs{/sha}","trees_url":"https://api.github.com/repos/spekframework/spek/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spekframework/spek/statuses/{sha}","languages_url":"https://api.github.com/repos/spekframework/spek/languages","stargazers_url":"https://api.github.com/repos/spekframework/spek/stargazers","contributors_url":"https://api.github.com/repos/spekframework/spek/contributors","subscribers_url":"https://api.github.com/repos/spekframework/spek/subscribers","subscription_url":"https://api.github.com/repos/spekframework/spek/subscription","commits_url":"https://api.github.com/repos/spekframework/spek/commits{/sha}","git_commits_url":"https://api.github.com/repos/spekframework/spek/git/commits{/sha}","comments_url":"https://api.github.com/repos/spekframework/spek/comments{/number}","issue_comment_url":"https://api.github.com/repos/spekframework/spek/issues/comments{/number}","contents_url":"https://api.github.com/repos/spekframework/spek/contents/{+path}","compare_url":"https://api.github.com/repos/spekframework/spek/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spekframework/spek/merges","archive_url":"https://api.github.com/repos/spekframework/spek/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spekframework/spek/downloads","issues_url":"https://api.github.com/repos/spekframework/spek/issues{/number}","pulls_url":"https://api.github.com/repos/spekframework/spek/pulls{/number}","milestones_url":"https://api.github.com/repos/spekframework/spek/milestones{/number}","notifications_url":"https://api.github.com/repos/spekframework/spek/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spekframework/spek/labels{/name}","releases_url":"https://api.github.com/repos/spekframework/spek/releases{/id}","deployments_url":"https://api.github.com/repos/spekframework/spek/deployments","created_at":"2012-11-05T20:59:59Z","updated_at":"2018-03-31T07:36:13Z","pushed_at":"2018-04-01T04:43:25Z","git_url":"git://github.com/spekframework/spek.git","ssh_url":"git@github.com:spekframework/spek.git","clone_url":"https://github.com/spekframework/spek.git","svn_url":"https://github.com/spekframework/spek","homepage":null,"size":15045,"stargazers_count":1172,"watchers_count":1172,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":124,"mirror_url":null,"archived":false,"open_issues_count":77,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":124,"open_issues":77,"watchers":1172,"default_branch":"2.x"}},"base":{"label":"spekframework:2.x","ref":"2.x","sha":"6a6ef4023f1baa964b46ede66c7f5a89f47a3431","user":{"login":"spekframework","id":24952163,"avatar_url":"https://avatars0.githubusercontent.com/u/24952163?v=4","gravatar_id":"","url":"https://api.github.com/users/spekframework","html_url":"https://github.com/spekframework","followers_url":"https://api.github.com/users/spekframework/followers","following_url":"https://api.github.com/users/spekframework/following{/other_user}","gists_url":"https://api.github.com/users/spekframework/gists{/gist_id}","starred_url":"https://api.github.com/users/spekframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spekframework/subscriptions","organizations_url":"https://api.github.com/users/spekframework/orgs","repos_url":"https://api.github.com/users/spekframework/repos","events_url":"https://api.github.com/users/spekframework/events{/privacy}","received_events_url":"https://api.github.com/users/spekframework/received_events","type":"Organization","site_admin":false},"repo":{"id":6551658,"name":"spek","full_name":"spekframework/spek","owner":{"login":"spekframework","id":24952163,"avatar_url":"https://avatars0.githubusercontent.com/u/24952163?v=4","gravatar_id":"","url":"https://api.github.com/users/spekframework","html_url":"https://github.com/spekframework","followers_url":"https://api.github.com/users/spekframework/followers","following_url":"https://api.github.com/users/spekframework/following{/other_user}","gists_url":"https://api.github.com/users/spekframework/gists{/gist_id}","starred_url":"https://api.github.com/users/spekframework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spekframework/subscriptions","organizations_url":"https://api.github.com/users/spekframework/orgs","repos_url":"https://api.github.com/users/spekframework/repos","events_url":"https://api.github.com/users/spekframework/events{/privacy}","received_events_url":"https://api.github.com/users/spekframework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spekframework/spek","description":"A specification framework for Kotlin","fork":false,"url":"https://api.github.com/repos/spekframework/spek","forks_url":"https://api.github.com/repos/spekframework/spek/forks","keys_url":"https://api.github.com/repos/spekframework/spek/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spekframework/spek/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spekframework/spek/teams","hooks_url":"https://api.github.com/repos/spekframework/spek/hooks","issue_events_url":"https://api.github.com/repos/spekframework/spek/issues/events{/number}","events_url":"https://api.github.com/repos/spekframework/spek/events","assignees_url":"https://api.github.com/repos/spekframework/spek/assignees{/user}","branches_url":"https://api.github.com/repos/spekframework/spek/branches{/branch}","tags_url":"https://api.github.com/repos/spekframework/spek/tags","blobs_url":"https://api.github.com/repos/spekframework/spek/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spekframework/spek/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spekframework/spek/git/refs{/sha}","trees_url":"https://api.github.com/repos/spekframework/spek/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spekframework/spek/statuses/{sha}","languages_url":"https://api.github.com/repos/spekframework/spek/languages","stargazers_url":"https://api.github.com/repos/spekframework/spek/stargazers","contributors_url":"https://api.github.com/repos/spekframework/spek/contributors","subscribers_url":"https://api.github.com/repos/spekframework/spek/subscribers","subscription_url":"https://api.github.com/repos/spekframework/spek/subscription","commits_url":"https://api.github.com/repos/spekframework/spek/commits{/sha}","git_commits_url":"https://api.github.com/repos/spekframework/spek/git/commits{/sha}","comments_url":"https://api.github.com/repos/spekframework/spek/comments{/number}","issue_comment_url":"https://api.github.com/repos/spekframework/spek/issues/comments{/number}","contents_url":"https://api.github.com/repos/spekframework/spek/contents/{+path}","compare_url":"https://api.github.com/repos/spekframework/spek/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spekframework/spek/merges","archive_url":"https://api.github.com/repos/spekframework/spek/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spekframework/spek/downloads","issues_url":"https://api.github.com/repos/spekframework/spek/issues{/number}","pulls_url":"https://api.github.com/repos/spekframework/spek/pulls{/number}","milestones_url":"https://api.github.com/repos/spekframework/spek/milestones{/number}","notifications_url":"https://api.github.com/repos/spekframework/spek/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spekframework/spek/labels{/name}","releases_url":"https://api.github.com/repos/spekframework/spek/releases{/id}","deployments_url":"https://api.github.com/repos/spekframework/spek/deployments","created_at":"2012-11-05T20:59:59Z","updated_at":"2018-03-31T07:36:13Z","pushed_at":"2018-04-01T04:43:25Z","git_url":"git://github.com/spekframework/spek.git","ssh_url":"git@github.com:spekframework/spek.git","clone_url":"https://github.com/spekframework/spek.git","svn_url":"https://github.com/spekframework/spek","homepage":null,"size":15045,"stargazers_count":1172,"watchers_count":1172,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":124,"mirror_url":null,"archived":false,"open_issues_count":77,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":124,"open_issues":77,"watchers":1172,"default_branch":"2.x"}},"_links":{"self":{"href":"https://api.github.com/repos/spekframework/spek/pulls/385"},"html":{"href":"https://github.com/spekframework/spek/pull/385"},"issue":{"href":"https://api.github.com/repos/spekframework/spek/issues/385"},"comments":{"href":"https://api.github.com/repos/spekframework/spek/issues/385/comments"},"review_comments":{"href":"https://api.github.com/repos/spekframework/spek/pulls/385/comments"},"review_comment":{"href":"https://api.github.com/repos/spekframework/spek/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spekframework/spek/pulls/385/commits"},"statuses":{"href":"https://api.github.com/repos/spekframework/spek/statuses/c08b4bea7db73688e40288c49bf71a9c8d26a8a4"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ming13"}}