use of ch.cyberduck.core.Credentials in project cyberduck by iterate-ch.
the class SpectraBulkServiceTest method testSPECTRA67.
@Ignore
@Test
public void testSPECTRA67() throws Exception {
final Host host = new Host(new SpectraProtocol() {
@Override
public Scheme getScheme() {
return Scheme.http;
}
}, System.getProperties().getProperty("spectra.hostname"), Integer.valueOf(System.getProperties().getProperty("spectra.port")), new Credentials(System.getProperties().getProperty("spectra.user"), System.getProperties().getProperty("spectra.key")));
final SpectraSession session = new SpectraSession(host, new DisabledX509TrustManager(), new DefaultX509KeyManager());
session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
final Path container = new Path(new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume)), "SPECTRA-67", EnumSet.of(Path.Type.directory));
final HashMap<TransferItem, TransferStatus> files = new HashMap<>();
for (int i = 1; i < 100; i++) {
files.put(new TransferItem(new Path(container, String.format("test-%d.f", i), EnumSet.of(Path.Type.file))), new TransferStatus());
}
final SpectraBulkService bulk = new SpectraBulkService(session);
// Clear cache
bulk.clear();
final Set<UUID> uuid = bulk.pre(Transfer.Type.download, files, new DisabledConnectionCallback());
assertNotNull(uuid);
assertFalse(uuid.isEmpty());
assertEquals(1, uuid.size());
session.close();
}
use of ch.cyberduck.core.Credentials in project cyberduck by iterate-ch.
the class SpectraReadFeatureTest method testSPECTRA66.
@Ignore
@Test
public void testSPECTRA66() throws Exception {
final Host host = new Host(new SpectraProtocol() {
@Override
public Scheme getScheme() {
return Scheme.http;
}
}, System.getProperties().getProperty("spectra.hostname"), Integer.valueOf(System.getProperties().getProperty("spectra.port")), new Credentials(System.getProperties().getProperty("spectra.user"), System.getProperties().getProperty("spectra.key")));
final SpectraSession session = new SpectraSession(host, new DisabledX509TrustManager(), new DefaultX509KeyManager());
session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
final Path container = new Path(new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume)), "SPECTRA-67", EnumSet.of(Path.Type.directory));
final HashMap<TransferItem, TransferStatus> files = new HashMap<>();
for (int i = 1; i < 100; i++) {
files.put(new TransferItem(new Path(container, String.format("test-%d.f", i), EnumSet.of(Path.Type.file))), new TransferStatus());
}
final SpectraBulkService bulk = new SpectraBulkService(session);
final Set<UUID> uuid = bulk.pre(Transfer.Type.download, files, new DisabledConnectionCallback());
assertNotNull(uuid);
assertFalse(uuid.isEmpty());
assertEquals(1, uuid.size());
try {
for (Map.Entry<TransferItem, TransferStatus> entry : files.entrySet()) {
final InputStream in = new SpectraReadFeature(session).read(entry.getKey().remote, entry.getValue(), new DisabledConnectionCallback());
assertNotNull(in);
IOUtils.closeQuietly(in);
}
} catch (RetriableAccessDeniedException e) {
// ignore as the files are not in the cache - next time they might be there
}
session.close();
}
use of ch.cyberduck.core.Credentials in project cyberduck by iterate-ch.
the class SpectraReadFeatureTest method testReadNotFound.
@Test(expected = NotfoundException.class)
public void testReadNotFound() throws Exception {
final Host host = new Host(new SpectraProtocol() {
@Override
public Scheme getScheme() {
return Scheme.http;
}
}, System.getProperties().getProperty("spectra.hostname"), Integer.valueOf(System.getProperties().getProperty("spectra.port")), new Credentials(System.getProperties().getProperty("spectra.user"), System.getProperties().getProperty("spectra.key")));
final SpectraSession session = new SpectraSession(host, new DisabledX509TrustManager(), new DefaultX509KeyManager());
session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
final TransferStatus status = new TransferStatus();
final Path container = new Path("cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
final Path test = new Path(container, "nosuchname", EnumSet.of(Path.Type.file));
new SpectraBulkService(session).pre(Transfer.Type.download, Collections.singletonMap(new TransferItem(test), status), new DisabledConnectionCallback());
new SpectraReadFeature(session).read(test, status, new DisabledConnectionCallback());
}
use of ch.cyberduck.core.Credentials in project cyberduck by iterate-ch.
the class SpectraSessionTest method testLoginFailureInvalidSecret.
@Test(expected = LoginFailureException.class)
public void testLoginFailureInvalidSecret() throws Exception {
final Host host = new Host(new SpectraProtocol() {
@Override
public Scheme getScheme() {
return Scheme.http;
}
}, System.getProperties().getProperty("spectra.hostname"), Integer.valueOf(System.getProperties().getProperty("spectra.port")), new Credentials(System.getProperties().getProperty("spectra.user"), "s"));
final SpectraSession session = new SpectraSession(host, new DisabledX509TrustManager(), new DefaultX509KeyManager());
session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
}
use of ch.cyberduck.core.Credentials in project cyberduck by iterate-ch.
the class SpectraSessionTest method testLogin.
@Test
public void testLogin() throws Exception {
final Host host = new Host(new SpectraProtocol() {
@Override
public Scheme getScheme() {
return Scheme.http;
}
}, System.getProperties().getProperty("spectra.hostname"), Integer.valueOf(System.getProperties().getProperty("spectra.port")), new Credentials(System.getProperties().getProperty("spectra.user"), System.getProperties().getProperty("spectra.key")));
final SpectraSession session = new SpectraSession(host, new DisabledX509TrustManager(), new DefaultX509KeyManager());
session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
new S3ListService(session).list(new Path("/", EnumSet.of(Path.Type.directory)), new DisabledListProgressListener());
session.close();
}
Aggregations