package org.tizen.common.sdb;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import static org.tizen.common.Shell.*;
import static org.tizen.common.sdb.SdbTestUtil.*;
private void pushPullAndCheck(String pushSrc, String pushDst, String pullDst, boolean file) throws Exception {
+ String[] results = null;
+
File pushFile = new File(pushSrc);
if(pushFile.exists()) {
FileUtil.recursiveDelete(pushFile);
runAndWait( SDB_PATH + String.format(" -s %s shell rm -rf %s", serialNumber, pushDst));
assertTrue(MessageFormat.format("rm fail to remove {0}", pushDst),
checkTargetFileExist(pushDst, serialNumber, file, false));
- runAndWait( SDB_PATH + String.format(" -s %s push %s %s", serialNumber, pushSrc, pushDst));
+ results = runAndGetWholeString( SDB_PATH + String.format(" -s %s push %s %s", serialNumber, pushFile.getAbsolutePath(), pushDst), false);
+ if(results != null) {
+ for(String result: results) {
+ assertFalse(SDB_PATH + String.format(" -s %s push %s %s", serialNumber, pushFile.getAbsolutePath(), pushDst)
+ + "makes error message: " + result, result.contains("error"));
+ }
+ }
+
assertTrue(MessageFormat.format("{0} does not exist in target {1}", pushDst, serialNumber),
checkTargetFileExist(pushDst, serialNumber, file, true));
- runAndWait( SDB_PATH + String.format(" -s %s pull %s %s", serialNumber, pushDst, pullDst));
+ results = runAndGetWholeString( SDB_PATH + String.format(" -s %s pull %s %s", serialNumber, pushDst, pullFile.getAbsolutePath()), false);
+
+ if(results != null) {
+ for(String result: results) {
+ assertFalse( SDB_PATH + String.format(" -s %s pull %s %s", serialNumber, pushDst, pullFile.getAbsolutePath())
+ + "makes error message: " + result, result.contains("error"));
+ }
+ }
+
assertTrue(MessageFormat.format("{0} does not exist in host", pullFile.getAbsolutePath()), pullFile.exists());
if( file ) {