?????????????
??????????????????????????????ж?????????????????CountDownLatch???????????????????????????????????????????????
@Test(timeout=10000)
public void testSwitch_on() throws TimeoutException?? InterruptedException {
if((Boolean)mService.getCachedDp("1")){
mService.send("1"?? "false");
}
dpUpdateReply = mService.send("1"?? "true");
Log.i(TAG?? "testSwitch_on() - dpUpdate dp[1][" + dpUpdateReply.get("1") + "]");
assertEquals("testSwitch_on() - dpUpdate dp[1]"?? true?? dpUpdateReply.get("1"));
}
?????????send??????????????????????????????????????????ж??????????????????й????????з???????10????????????????????
??????????
????The test suite setup assumes:
????A TuyaSmart e-mail type account is available. If you want to use another account type?? you can add the login code for this in class srcandroidTestjavacom extapp uyatestIntegrationService.java .
????Exactly one radiator is already connected to the account.
??????????????????????????????????£???????????????????????????????????????????????????????????
?????Щ???
????CountDownLatch ???????????????????????????????????????????
????java.util.concurrent.CountDownLatch is used for awaiting listeners being triggered and return result to test call. We avoid using Thread.sleep().
???????????ó???????????? ???? ?????????????????????????????????Rules???????????
????@Rule
????public Timeout globalTimeout= new Timeout(10);
??????????????????????к?????????????????????????????????????????????
???????SDK?????????????????github????Щ??????????SDK??????key?????????????????????????XML???????????????????????????з???????????SDK??——??????????SDK???????????Щ????????????????????????readMe????????????????????
???????
??????λ?????е?????????·???????????????????????ù??????????????????????????????????????????в?????y?????????д??????è?????????????????????????????????????????????????????????????????????????????????????????????????????????SDK??????????÷????????????????????????Щ?????????????——????????????????????????????????SDK???????????????????????SDK???????????