{"action":"created","issue":{"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/57","repository_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary","labels_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/57/comments","events_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/57/events","html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/57","id":146644659,"number":57,"title":"Initial commit with UT for DiscoveryManager and ConnectionManager","user":{"login":"jareksl","id":10142812,"avatar_url":"https://avatars.githubusercontent.com/u/10142812?v=3","gravatar_id":"","url":"https://api.github.com/users/jareksl","html_url":"https://github.com/jareksl","followers_url":"https://api.github.com/users/jareksl/followers","following_url":"https://api.github.com/users/jareksl/following{/other_user}","gists_url":"https://api.github.com/users/jareksl/gists{/gist_id}","starred_url":"https://api.github.com/users/jareksl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jareksl/subscriptions","organizations_url":"https://api.github.com/users/jareksl/orgs","repos_url":"https://api.github.com/users/jareksl/repos","events_url":"https://api.github.com/users/jareksl/events{/privacy}","received_events_url":"https://api.github.com/users/jareksl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/labels/3%20-%20Working","name":"3 - Working","color":"CCCCCC"},{"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"yaronyg","id":1480964,"avatar_url":"https://avatars.githubusercontent.com/u/1480964?v=3","gravatar_id":"","url":"https://api.github.com/users/yaronyg","html_url":"https://github.com/yaronyg","followers_url":"https://api.github.com/users/yaronyg/followers","following_url":"https://api.github.com/users/yaronyg/following{/other_user}","gists_url":"https://api.github.com/users/yaronyg/gists{/gist_id}","starred_url":"https://api.github.com/users/yaronyg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaronyg/subscriptions","organizations_url":"https://api.github.com/users/yaronyg/orgs","repos_url":"https://api.github.com/users/yaronyg/repos","events_url":"https://api.github.com/users/yaronyg/events{/privacy}","received_events_url":"https://api.github.com/users/yaronyg/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-04-07T14:34:18Z","updated_at":"2016-05-18T02:44:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/pulls/57","html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/57","diff_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/57.diff","patch_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/57.patch"},"body":"All changes done to the constructors should allow to inject mocked Context, BluetoothAdapter and SharedPreferences. All tests are the white box UT. There are also some changes done to the build.gradle and build.sh which are needed to allow to run tests on the CI\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/thaliproject/thali_cordovaplugin_btlibrary/57)\n<!-- Reviewable:end -->\r\n\r\n<!---\r\n@huboard:{\"order\":676.5,\"milestone_order\":57,\"custom_state\":\"\"}\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/comments/219910940","html_url":"https://github.com/thaliproject/Thali_CordovaPlugin_BtLibrary/pull/57#issuecomment-219910940","issue_url":"https://api.github.com/repos/thaliproject/Thali_CordovaPlugin_BtLibrary/issues/57","id":219910940,"user":{"login":"yaronyg","id":1480964,"avatar_url":"https://avatars.githubusercontent.com/u/1480964?v=3","gravatar_id":"","url":"https://api.github.com/users/yaronyg","html_url":"https://github.com/yaronyg","followers_url":"https://api.github.com/users/yaronyg/followers","following_url":"https://api.github.com/users/yaronyg/following{/other_user}","gists_url":"https://api.github.com/users/yaronyg/gists{/gist_id}","starred_url":"https://api.github.com/users/yaronyg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaronyg/subscriptions","organizations_url":"https://api.github.com/users/yaronyg/orgs","repos_url":"https://api.github.com/users/yaronyg/repos","events_url":"https://api.github.com/users/yaronyg/events{/privacy}","received_events_url":"https://api.github.com/users/yaronyg/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T02:44:19Z","updated_at":"2016-05-18T02:44:19Z","body":"\n\n\n\n\n\nReviewed 32 of 32 files at r3.\nReview status: all files reviewed at latest revision, 8 unresolved discussions.\n\n---\n\n*[BtConnectorLib/btconnectorlib2/src/androidTest/java/org/thaliproject/p2p/btconnectorlib/ConnectionManagerTest.java, line 405 \\[r3\\]](https://reviewable.io:443/reviews/thaliproject/thali_cordovaplugin_btlibrary/57#-KI0EEFrR3XMkZElMrlM:-KI0EEFrR3XMkZElMrlN:1622411300) ([raw file](https://github.com/thaliproject/thali_cordovaplugin_btlibrary/blob/c350a19309b971aa0151de0b2ddca10692fc29ba/BtConnectorLib/btconnectorlib2/src/androidTest/java/org/thaliproject/p2p/btconnectorlib/ConnectionManagerTest.java#L405)):*\n> ```Java\n> \n>             public void run() {\n>                 Looper.prepare();\n> ```\n\nWhy are we using a looper? Where is the message handler?\n\n---\n\n*[BtConnectorLib/btconnectorlib2/src/androidTest/java/org/thaliproject/p2p/btconnectorlib/ConnectionManagerTest.java, line 432 \\[r3\\]](https://reviewable.io:443/reviews/thaliproject/thali_cordovaplugin_btlibrary/57#-KI0FAa6Et8vFjElxPec:-KI0FAa7Ll9ftqBuMYjx:1846697315) ([raw file](https://github.com/thaliproject/thali_cordovaplugin_btlibrary/blob/c350a19309b971aa0151de0b2ddca10692fc29ba/BtConnectorLib/btconnectorlib2/src/androidTest/java/org/thaliproject/p2p/btconnectorlib/ConnectionManagerTest.java#L432)):*\n> ```Java\n> \n>         // let's wait for connection timeout (additional time to ensure no other handler is called)\n>         Thread.sleep(timeout + 20000);\n> ```\n\nDude, our tests are going to take years if we have to keep shoving in 20 second time outs!\n\n---\n\n*[BtConnectorLib/btconnectorlib2/src/androidTest/java/org/thaliproject/p2p/btconnectorlib/ConnectionManagerTest.java, line 447 \\[r3\\]](https://reviewable.io:443/reviews/thaliproject/thali_cordovaplugin_btlibrary/57#-KI0FIuvtLzkL6Nb0A_L:-KI0FIuvtLzkL6Nb0A_M:1577356333) ([raw file](https://github.com/thaliproject/thali_cordovaplugin_btlibrary/blob/c350a19309b971aa0151de0b2ddca10692fc29ba/BtConnectorLib/btconnectorlib2/src/androidTest/java/org/thaliproject/p2p/btconnectorlib/ConnectionManagerTest.java#L447)):*\n> ```Java\n> \n>         // let's wait for connection failure (additional time to ensure no other handler is called)\n>         Thread.sleep(timeout + 10000);\n> ```\n\nYou're killed me here! 70 seconds?!?!?!?\n\n---\n\n*[BtConnectorLib/btconnectorlib2/src/test/java/org/thaliproject/p2p/btconnectorlib/internal/bluetooth/BluetoothUtilsTest.java, line 187 \\[r3\\]](https://reviewable.io:443/reviews/thaliproject/thali_cordovaplugin_btlibrary/57#-KI0T3NykWd8D4iRg6tz:-KI0T3NykWd8D4iRg6u-:1046008814) ([raw file](https://github.com/thaliproject/thali_cordovaplugin_btlibrary/blob/c350a19309b971aa0151de0b2ddca10692fc29ba/BtConnectorLib/btconnectorlib2/src/test/java/org/thaliproject/p2p/btconnectorlib/internal/bluetooth/BluetoothUtilsTest.java#L187)):*\n> ```Java\n>     // The tests below does not work due to the fact that the class BluetoothSocket\n>     // is part of the android SDK. That means that is not available for unit testing by default.\n>     // It has to be tested by instrumented tests\n> ```\n\nSo then what's the plan for these tests?\n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io:443/reviews/thaliproject/thali_cordovaplugin_btlibrary/57)*\n<!-- Sent from Reviewable.io -->\n"}}