use of org.syncany.operations.daemon.DaemonOperationResult in project syncany by syncany.
the class DaemonOperationTest method testExecuteList.
@Test
public void testExecuteList() throws Exception {
when(options.getAction()).thenReturn(DaemonAction.LIST);
DaemonOperationResult res = deamonOp.execute();
assertNotNull(res);
assertEquals(DaemonResultCode.OK, res.getResultCode());
assertNotNull(res.getWatchList());
}
use of org.syncany.operations.daemon.DaemonOperationResult in project syncany by syncany.
the class DaemonOperationTest method testExecuteAdd.
@Test
public void testExecuteAdd() throws Exception {
when(options.getAction()).thenReturn(DaemonAction.ADD);
List<String> watchRoots = new ArrayList<String>();
watchRoots.add(tempWatchRootAppFolder.getParent());
when(options.getWatchRoots()).thenReturn(watchRoots);
DaemonOperationResult res = deamonOp.execute();
assertNotNull(res);
assertEquals(DaemonResultCode.OK, res.getResultCode());
assertNotNull(res.getWatchList());
assertEquals(1, res.getWatchList().size());
assertEquals(tempWatchRootAppFolder.getParentFile().getAbsolutePath(), res.getWatchList().get(0).getPath());
}
use of org.syncany.operations.daemon.DaemonOperationResult in project syncany by syncany.
the class DaemonCommand method execute.
@Override
public int execute(String[] operationArgs) throws Exception {
DaemonOperationOptions operationOptions = parseOptions(operationArgs);
DaemonOperationResult operationResult = new DaemonOperation(operationOptions).execute();
printResults(operationResult);
return 0;
}
use of org.syncany.operations.daemon.DaemonOperationResult in project syncany by syncany.
the class DaemonOperationResultTest method setUp.
@Before
public void setUp() {
folder = new FolderTO("test");
watchList = new ArrayList<FolderTO>();
watchList.add(folder);
result = new DaemonOperationResult(DaemonResultCode.OK, watchList);
}
use of org.syncany.operations.daemon.DaemonOperationResult in project syncany by syncany.
the class DaemonOperationTest method testExecuteRemove.
@Test
public void testExecuteRemove() throws Exception {
when(options.getAction()).thenReturn(DaemonAction.REMOVE);
List<String> watchRoots = new ArrayList<String>();
watchRoots.add(tempWatchRootAppFolder.getParent());
when(options.getWatchRoots()).thenReturn(watchRoots);
DaemonOperationResult res = deamonOp.execute();
assertNotNull(res);
assertEquals(DaemonResultCode.OK, res.getResultCode());
assertNotNull(res.getWatchList());
assertTrue(res.getWatchList().isEmpty());
}
Aggregations