@Override protected void setUp() throws Exception { super.setUp(); setActivityInitialTouchMode(false); mActivity = getActivity(); File textFile = mActivity.extractAsset(TestActivity.ASSETS__TEXT_FILE_NAME); RemoteOperationResult uploadResult = mActivity.uploadFile(textFile.getAbsolutePath(), FILE_PATH, "txt/plain"); if (!uploadResult.isSuccess()) { Utils.logAndThrow(LOG_TAG, uploadResult); } }
@Override protected void tearDown() throws Exception { RemoteOperationResult removeResult = mActivity.removeFile(FILE_PATH); if (!removeResult.isSuccess()) { Utils.logAndThrow(LOG_TAG, removeResult); } super.tearDown(); }
/** Test Read File */ public void testReadFile() { RemoteOperationResult result = mActivity.readFile(FILE_PATH); assertTrue(result.getData() != null && result.getData().size() == 1); assertTrue(result.isSuccess()); // TODO check more properties of the result }