1 package ch
.cyberduck
.core
.irods
;
4 * Copyright (c) 2002-2015 David Kocher. All rights reserved.
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
20 import ch
.cyberduck
.core
.AbstractTestCase
;
21 import ch
.cyberduck
.core
.Credentials
;
22 import ch
.cyberduck
.core
.DisabledCancelCallback
;
23 import ch
.cyberduck
.core
.DisabledHostKeyCallback
;
24 import ch
.cyberduck
.core
.DisabledLoginCallback
;
25 import ch
.cyberduck
.core
.DisabledPasswordStore
;
26 import ch
.cyberduck
.core
.DisabledProgressListener
;
27 import ch
.cyberduck
.core
.DisabledTranscriptListener
;
28 import ch
.cyberduck
.core
.Host
;
29 import ch
.cyberduck
.core
.Local
;
30 import ch
.cyberduck
.core
.Path
;
31 import ch
.cyberduck
.core
.Profile
;
32 import ch
.cyberduck
.core
.ProfileReaderFactory
;
33 import ch
.cyberduck
.core
.features
.Delete
;
34 import ch
.cyberduck
.core
.features
.Directory
;
36 import org
.junit
.Test
;
38 import java
.util
.Arrays
;
39 import java
.util
.EnumSet
;
40 import java
.util
.UUID
;
42 import static org
.junit
.Assert
.assertFalse
;
43 import static org
.junit
.Assert
.assertTrue
;
48 public class IRODSFindFeatureTest
extends AbstractTestCase
{
51 public void testFind() throws Exception
{
52 final Profile profile
= ProfileReaderFactory
.get().read(
53 new Local("profiles/iRODS (iPlant Collaborative).cyberduckprofile"));
54 final Host host
= new Host(profile
, profile
.getDefaultHostname(), new Credentials(
55 properties
.getProperty("irods.key"), properties
.getProperty("irods.secret")
58 final IRODSSession session
= new IRODSSession(host
);
59 session
.open(new DisabledHostKeyCallback(), new DisabledTranscriptListener());
60 session
.login(new DisabledPasswordStore(), new DisabledLoginCallback(), new DisabledCancelCallback());
62 final Path test
= new Path(session
.workdir(), UUID
.randomUUID().toString(), EnumSet
.of(Path
.Type
.directory
));
63 session
.getFeature(Directory
.class).mkdir(test
);
64 assertTrue(new IRODSFindFeature(session
).find(test
));
66 session
.getFeature(Delete
.class).delete(Arrays
.asList(test
), new DisabledLoginCallback(), new DisabledProgressListener());
67 assertFalse(new IRODSFindFeature(session
).find(test
));