Search in sources :

Example 1 with Quota

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

the class LocalQuotaFeatureTest method get.

@Test
public void get() throws Exception {
    final LocalSession session = new LocalSession(new Host(new LocalProtocol(), new LocalProtocol().getDefaultHostname()));
    session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
    session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
    final Path home = new LocalHomeFinderFeature().find();
    final Quota.Space quota = new LocalQuotaFeature(session).get();
    assertNotNull(quota.used);
    assertNotNull(quota.available);
}
Also used : Path(ch.cyberduck.core.Path) DisabledCancelCallback(ch.cyberduck.core.DisabledCancelCallback) Quota(ch.cyberduck.core.features.Quota) DisabledHostKeyCallback(ch.cyberduck.core.DisabledHostKeyCallback) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) Host(ch.cyberduck.core.Host) Test(org.junit.Test)

Example 2 with Quota

use of ch.cyberduck.core.features.Quota 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)

Example 3 with Quota

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

the class SDSQuotaFeatureTest method testRoom.

@Test
public void testRoom() throws Exception {
    final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
    final Path room = new SDSDirectoryFeature(session, nodeid).mkdir(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
    final Quota.Space quota = new SDSQuotaFeature(session, nodeid).get();
    assertNotNull(quota.available);
    assertNotNull(quota.used);
    new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) Quota(ch.cyberduck.core.features.Quota) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Aggregations

Quota (ch.cyberduck.core.features.Quota)3 Test (org.junit.Test)3 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)2 Path (ch.cyberduck.core.Path)2 IntegrationTest (ch.cyberduck.test.IntegrationTest)2 AlphanumericRandomStringService (ch.cyberduck.core.AlphanumericRandomStringService)1 DisabledCancelCallback (ch.cyberduck.core.DisabledCancelCallback)1 DisabledHostKeyCallback (ch.cyberduck.core.DisabledHostKeyCallback)1 Host (ch.cyberduck.core.Host)1 Delete (ch.cyberduck.core.features.Delete)1 Home (ch.cyberduck.core.features.Home)1 GraphQuotaFeature (ch.cyberduck.core.onedrive.features.GraphQuotaFeature)1 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)1