Fix transcript in transfer window.
[cyberduck.git] / test / ch / cyberduck / core / irods / IRODSDirectoryFeatureTest.java
blob035337c5d8c59349d3f889a800fb73b8b74bf2e4
1 package ch.cyberduck.core.irods;
3 /*
4 * Copyright (c) 2002-2015 David Kocher. All rights reserved.
5 * http://cyberduck.ch/
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * Bug fixes, suggestions and comments should be sent to feedback@cyberduck.ch
22 import ch.cyberduck.core.AbstractTestCase;
23 import ch.cyberduck.core.Credentials;
24 import ch.cyberduck.core.DisabledCancelCallback;
25 import ch.cyberduck.core.DisabledHostKeyCallback;
26 import ch.cyberduck.core.DisabledLoginCallback;
27 import ch.cyberduck.core.DisabledPasswordStore;
28 import ch.cyberduck.core.DisabledProgressListener;
29 import ch.cyberduck.core.DisabledTranscriptListener;
30 import ch.cyberduck.core.Host;
31 import ch.cyberduck.core.Local;
32 import ch.cyberduck.core.Path;
33 import ch.cyberduck.core.Profile;
34 import ch.cyberduck.core.ProfileReaderFactory;
35 import ch.cyberduck.core.features.Delete;
36 import ch.cyberduck.core.features.Find;
38 import org.junit.Test;
40 import java.util.Arrays;
41 import java.util.EnumSet;
42 import java.util.UUID;
44 import static org.junit.Assert.assertFalse;
45 import static org.junit.Assert.assertTrue;
47 /**
48 * @version $Id$
50 public class IRODSDirectoryFeatureTest extends AbstractTestCase {
52 @Test
53 public void testMakeDirectory() throws Exception {
54 final Profile profile = ProfileReaderFactory.get().read(
55 new Local("profiles/iRODS (iPlant Collaborative).cyberduckprofile"));
56 final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials(
57 properties.getProperty("irods.key"), properties.getProperty("irods.secret")
58 ));
60 final IRODSSession session = new IRODSSession(host);
61 session.open(new DisabledHostKeyCallback(), new DisabledTranscriptListener());
62 session.login(new DisabledPasswordStore(), new DisabledLoginCallback(), new DisabledCancelCallback());
64 final Path test = new Path(session.workdir(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory));
65 new IRODSDirectoryFeature(session).mkdir(test);
66 assertTrue(session.getFeature(Find.class).find(test));
68 session.getFeature(Delete.class).delete(Arrays.asList(test), new DisabledLoginCallback(), new DisabledProgressListener());
69 assertFalse(session.getFeature(Find.class).find(test));
70 session.close();