{"action":"created","issue":{"url":"https://api.github.com/repos/stefanbirkner/system-rules/issues/35","labels_url":"https://api.github.com/repos/stefanbirkner/system-rules/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/stefanbirkner/system-rules/issues/35/comments","events_url":"https://api.github.com/repos/stefanbirkner/system-rules/issues/35/events","html_url":"https://github.com/stefanbirkner/system-rules/issues/35","id":120182670,"number":35,"title":"TextFromStandardInputStream seems not to work well with JLine","user":{"login":"victornoel","id":160975,"avatar_url":"https://avatars.githubusercontent.com/u/160975?v=3","gravatar_id":"","url":"https://api.github.com/users/victornoel","html_url":"https://github.com/victornoel","followers_url":"https://api.github.com/users/victornoel/followers","following_url":"https://api.github.com/users/victornoel/following{/other_user}","gists_url":"https://api.github.com/users/victornoel/gists{/gist_id}","starred_url":"https://api.github.com/users/victornoel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victornoel/subscriptions","organizations_url":"https://api.github.com/users/victornoel/orgs","repos_url":"https://api.github.com/users/victornoel/repos","events_url":"https://api.github.com/users/victornoel/events{/privacy}","received_events_url":"https://api.github.com/users/victornoel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/stefanbirkner/system-rules/milestones/15","html_url":"https://github.com/stefanbirkner/system-rules/milestones/1.15.1","labels_url":"https://api.github.com/repos/stefanbirkner/system-rules/milestones/15/labels","id":1448771,"number":15,"title":"1.15.1","description":"","creator":{"login":"stefanbirkner","id":711349,"avatar_url":"https://avatars.githubusercontent.com/u/711349?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanbirkner","html_url":"https://github.com/stefanbirkner","followers_url":"https://api.github.com/users/stefanbirkner/followers","following_url":"https://api.github.com/users/stefanbirkner/following{/other_user}","gists_url":"https://api.github.com/users/stefanbirkner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanbirkner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanbirkner/subscriptions","organizations_url":"https://api.github.com/users/stefanbirkner/orgs","repos_url":"https://api.github.com/users/stefanbirkner/repos","events_url":"https://api.github.com/users/stefanbirkner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanbirkner/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-12-07T22:02:10Z","updated_at":"2015-12-17T14:24:21Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-12-03T14:25:40Z","updated_at":"2015-12-17T17:49:14Z","closed_at":null,"body":"Hi,\r\n\r\nI am using [JLine](http://jline.sourceforge.net/) (version 2.6) and it seems it doesn't interact well with TextFromStandardInputStream.\r\n\r\nBasically, the jline.console.ConsoleReader provides a method called readLine() that reads a line and when it returns null, it means the stream was ended (InputStreamReader.read() returns -1 if I understood well).\r\n\r\nThe thing is when using TextFromStandardInputStream, once what had to be read from System.in was read, it seems that instead of blocking, InputStreamReader.read() returns -1…\r\n\r\nI'm not totally sure the cause is not coming from JLine, but when I tried to implement my own TextFromStandardInputStream by simply replacing System.in with a PipedInputStream to which I write, it worked as desired..."},"comment":{"url":"https://api.github.com/repos/stefanbirkner/system-rules/issues/comments/165527065","html_url":"https://github.com/stefanbirkner/system-rules/issues/35#issuecomment-165527065","issue_url":"https://api.github.com/repos/stefanbirkner/system-rules/issues/35","id":165527065,"user":{"login":"stefanbirkner","id":711349,"avatar_url":"https://avatars.githubusercontent.com/u/711349?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanbirkner","html_url":"https://github.com/stefanbirkner","followers_url":"https://api.github.com/users/stefanbirkner/followers","following_url":"https://api.github.com/users/stefanbirkner/following{/other_user}","gists_url":"https://api.github.com/users/stefanbirkner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanbirkner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanbirkner/subscriptions","organizations_url":"https://api.github.com/users/stefanbirkner/orgs","repos_url":"https://api.github.com/users/stefanbirkner/repos","events_url":"https://api.github.com/users/stefanbirkner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanbirkner/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T17:49:14Z","updated_at":"2015-12-17T17:49:14Z","body":"`TextFromStandardInputStream` isn't blocking because it is designed for automated tests that run in a single thread. If `TextFromStandardInputStream` blocks then the test itself blocks.\r\n\r\nI could imagine how to implement blocking behaviour for a test where the code that reads runs in a different thread than the test code. But I never encountered such a test.\r\n\r\nCould you provide more details about the use case that still has problems with `TextFromStandardInputStream`."}}