Search in sources :

Example 1 with Home

use of ch.cyberduck.core.features.Home in project cyberduck by iterate-ch.

the class FTPMoveFeatureTest method testMoveOverride.

@Test(expected = AccessDeniedException.class)
public void testMoveOverride() throws Exception {
    final Home workdir = new FTPWorkdirService(session);
    final Path test = new Path(workdir.find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
    new FTPTouchFeature(session).touch(test, new TransferStatus());
    final Path target = new Path(workdir.find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
    new FTPTouchFeature(session).touch(target, new TransferStatus());
    new FTPMoveFeature(session).move(test, target, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
    assertFalse(session.getFeature(Find.class).find(test));
    assertTrue(session.getFeature(Find.class).find(target));
    new FTPDeleteFeature(session).delete(Collections.singletonList(target), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) Home(ch.cyberduck.core.features.Home) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 2 with Home

use of ch.cyberduck.core.features.Home in project cyberduck by iterate-ch.

the class FTPMoveFeatureTest method testMoveNotFound.

@Test
public void testMoveNotFound() throws Exception {
    final Home workdir = new FTPWorkdirService(session);
    final Path test = new Path(workdir.find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
    try {
        new FTPMoveFeature(session).move(test, new Path(workdir.find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
        fail();
    } catch (NotfoundException | AccessDeniedException e) {
    // 
    }
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) NotfoundException(ch.cyberduck.core.exception.NotfoundException) AccessDeniedException(ch.cyberduck.core.exception.AccessDeniedException) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) Home(ch.cyberduck.core.features.Home) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 3 with Home

use of ch.cyberduck.core.features.Home in project cyberduck by iterate-ch.

the class GraphQuotaFeatureTest method testQuotaSimple.

@Test
public void testQuotaSimple() throws BackgroundException {
    final Home home = new OneDriveHomeFinderService();
    final Quota quota = new GraphQuotaFeature(session, fileid);
    Quota.Space space = quota.get();
    assertTrue(space.available > 0);
    assertTrue(space.used >= 0);
}
Also used : Quota(ch.cyberduck.core.features.Quota) GraphQuotaFeature(ch.cyberduck.core.onedrive.features.GraphQuotaFeature) Home(ch.cyberduck.core.features.Home) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Aggregations

Home (ch.cyberduck.core.features.Home)3 IntegrationTest (ch.cyberduck.test.IntegrationTest)3 Test (org.junit.Test)3 DisabledConnectionCallback (ch.cyberduck.core.DisabledConnectionCallback)2 Path (ch.cyberduck.core.Path)2 Delete (ch.cyberduck.core.features.Delete)2 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)2 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)1 AccessDeniedException (ch.cyberduck.core.exception.AccessDeniedException)1 NotfoundException (ch.cyberduck.core.exception.NotfoundException)1 Quota (ch.cyberduck.core.features.Quota)1 GraphQuotaFeature (ch.cyberduck.core.onedrive.features.GraphQuotaFeature)1