Skip to content

Commit

Permalink
Merge branch 'vircoll' of https://github.com/DICE-UNC/jargon into vir…
Browse files Browse the repository at this point in the history
…coll
  • Loading branch information
michael-conway committed Apr 1, 2015
2 parents 2877c3c + 648f095 commit 0649afb
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class DataProfileServiceImplTest {
public void testRetrieveDataProfileDataObject() throws Exception {

IRODSAccount irodsAccount = TestingPropertiesHelper
.buildDummyIrodsAccount();
.buildBogusIrodsAccount();
IRODSAccessObjectFactory irodsAccessObjectFactory = Mockito
.mock(IRODSAccessObjectFactory.class);

Expand Down Expand Up @@ -116,7 +116,7 @@ public void testRetrieveDataProfileDataObject() throws Exception {
public void testRetrieveDataProfileDataObjectWithTags() throws Exception {

IRODSAccount irodsAccount = TestingPropertiesHelper
.buildDummyIrodsAccount();
.buildBogusIrodsAccount();
IRODSAccessObjectFactory irodsAccessObjectFactory = Mockito
.mock(IRODSAccessObjectFactory.class);

Expand Down Expand Up @@ -178,7 +178,7 @@ public void testRetrieveDataProfileDataObjectWithTags() throws Exception {
public void testRetrieveDataProfileCollection() throws Exception {

IRODSAccount irodsAccount = TestingPropertiesHelper
.buildDummyIrodsAccount();
.buildBogusIrodsAccount();
IRODSAccessObjectFactory irodsAccessObjectFactory = Mockito
.mock(IRODSAccessObjectFactory.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void testresolveDataTypeWithProvidedAvuAndDataObjectValueFromAVU()
throws Exception {

IRODSAccount irodsAccount = TestingPropertiesHelper
.buildDummyIrodsAccount();
.buildBogusIrodsAccount();
IRODSAccessObjectFactory irodsAccessObjectFactory = Mockito
.mock(IRODSAccessObjectFactory.class);

Expand Down Expand Up @@ -50,7 +50,7 @@ public void testresolveDataTypeWithProvidedAvuAndDataObjectValueNoAVU()
throws Exception {

IRODSAccount irodsAccount = TestingPropertiesHelper
.buildDummyIrodsAccount();
.buildBogusIrodsAccount();
IRODSAccessObjectFactory irodsAccessObjectFactory = Mockito
.mock(IRODSAccessObjectFactory.class);

Expand All @@ -72,7 +72,7 @@ public void testresolveDataTypeWithProvidedAvuAndDataObjectValueNoAVU()
@Test
public void testGetDataTypeFromExtension() throws Exception {
IRODSAccount irodsAccount = TestingPropertiesHelper
.buildDummyIrodsAccount();
.buildBogusIrodsAccount();
IRODSAccessObjectFactory irodsAccessObjectFactory = Mockito
.mock(IRODSAccessObjectFactory.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class CollectionListingUtils {

private final IRODSAccount irodsAccount;
private final IRODSAccessObjectFactory irodsAccessObjectFactory;
private final CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO;
public static final String QUERY_EXCEPTION_FOR_QUERY = "query exception for query:";

static final Logger log = LoggerFactory
Expand All @@ -68,7 +67,7 @@ class CollectionListingUtils {
* user name, see if a public dir. For foreign zone, add a dir for
* user#homeZone and see if a public dir
*
*
*
*
* @param absolutePathToParent
* <code>String</code> with the current parent
Expand Down Expand Up @@ -110,7 +109,6 @@ List<CollectionAndDataObjectListingEntry> handleNoListingUnderRootOrHomeByLookin
return collectionAndDataObjectListingEntries;
}


/*
* Phase2 - under a zone, add a home
*/
Expand All @@ -132,8 +130,7 @@ List<CollectionAndDataObjectListingEntry> handleNoListingUnderRootOrHomeByLookin
components = MiscIRODSUtils.breakIRODSPathIntoComponents(path);
if (components.size() == 3 && components.get(2).equals("home")) {
log.info("under home, see if same zone as login");
if (irodsAccount
.getZone().equals(components.get(1))) {
if (irodsAccount.getZone().equals(components.get(1))) {
log.info("under logged in zone, add user and public dirs");
collectionAndDataObjectListingEntries
.addAll(createStandInsUnderHomeInLoggedInZone(path));
Expand All @@ -150,7 +147,6 @@ List<CollectionAndDataObjectListingEntry> handleNoListingUnderRootOrHomeByLookin
* Fall through is a legit file not found exception
*/


log.info("really is a not found for file:{}", path);
throw new FileNotFoundException("unable to find file under path");

Expand All @@ -165,6 +161,8 @@ private List<CollectionAndDataObjectListingEntry> createStandInsUnderHomeInLogge
StringBuilder sb = new StringBuilder(path);
sb.append("/public");
ObjStat statForPublic;
CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = this.irodsAccessObjectFactory
.getCollectionAndDataObjectListAndSearchAO(irodsAccount);
try {
statForPublic = collectionAndDataObjectListAndSearchAO
.retrieveObjectStatForPath(sb.toString());
Expand Down Expand Up @@ -197,11 +195,12 @@ private List<CollectionAndDataObjectListingEntry> createStandInsUnderHomeInFeder
// user dir in zone and public
log.info("under home in federated zone, look for public and home dir");


StringBuilder sb = new StringBuilder();
sb.append("/");
sb.append(zone);
sb.append("/home/public");
CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = this.irodsAccessObjectFactory
.getCollectionAndDataObjectListAndSearchAO(irodsAccount);

try {
ObjStat statForPublic = collectionAndDataObjectListAndSearchAO
Expand All @@ -218,8 +217,7 @@ private List<CollectionAndDataObjectListingEntry> createStandInsUnderHomeInFeder
ObjStat homeStat = collectionAndDataObjectListAndSearchAO
.retrieveObjectStatForPath(MiscIRODSUtils
.computeHomeDirectoryForIRODSAccountInFederatedZone(
this.collectionAndDataObjectListAndSearchAO
.getIRODSAccount(), zone));
irodsAccount, zone));
collectionAndDataObjectListingEntries
.add(createStandInForUserDir(homeStat));
} catch (FileNotFoundException fnf) {
Expand All @@ -235,10 +233,7 @@ private List<CollectionAndDataObjectListingEntry> createStandInForZoneDir()
CollectionAndDataObjectListingEntry entry;
List<CollectionAndDataObjectListingEntry> entries = new ArrayList<CollectionAndDataObjectListingEntry>();
StringBuilder sb;
ZoneAO zoneAO = this.collectionAndDataObjectListAndSearchAO
.getIRODSAccessObjectFactory().getZoneAO(
this.collectionAndDataObjectListAndSearchAO
.getIRODSAccount());
ZoneAO zoneAO = irodsAccessObjectFactory.getZoneAO(irodsAccount);
List<Zone> zones = zoneAO.listZones();

for (Zone zone : zones) {
Expand All @@ -257,7 +252,8 @@ private List<CollectionAndDataObjectListingEntry> createStandInForZoneDir()
}

/**
* @param data.getCollectionAndDataObjectListingEntries()
* @param data
* .getCollectionAndDataObjectListingEntries()
*/
private CollectionAndDataObjectListingEntry createStandInForHomeDir(
final String path) {
Expand All @@ -267,8 +263,7 @@ private CollectionAndDataObjectListingEntry createStandInForHomeDir(
entry.setLastResult(true);
entry.setObjectType(ObjectType.COLLECTION);

entry.setOwnerZone(collectionAndDataObjectListAndSearchAO
.getIRODSAccount().getZone());
entry.setOwnerZone(irodsAccount.getZone());
entry.setParentPath(path);
StringBuilder sb = new StringBuilder();
sb.append(path);
Expand Down Expand Up @@ -313,8 +308,7 @@ private CollectionAndDataObjectListingEntry createStandInForUserDir(
entry.setLastResult(true);
entry.setObjectType(ObjectType.COLLECTION);

entry.setOwnerZone(collectionAndDataObjectListAndSearchAO
.getIRODSAccount().getZone());
entry.setOwnerZone(irodsAccount.getZone());
entry.setPathOrName(objStat.getAbsolutePath());
entry.setSpecColType(objStat.getSpecColType());
entry.setCreatedAt(objStat.getCreatedAt());
Expand Down Expand Up @@ -974,7 +968,6 @@ int queryDataObjectCountsUnderPath(final String effectiveAbsolutePath)

this.irodsAccount = irodsAccount;
this.irodsAccessObjectFactory = irodsAccessObjectFactory;
this.collectionAndDataObjectListAndSearchAO = irodsAccessObjectFactory.getCollectionAndDataObjectListAndSearchAO(irodsAccount);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
package org.irods.jargon.core.query;

import java.util.ArrayList;
import java.util.List;

/**
Expand All @@ -14,9 +15,9 @@
* This object returns such a mixed listing from the multiple queries, along
* with properties that can assist in comprehending the paging status so that
* subsequent queries can be made.
*
*
* @author Mike Conway - DICE (www.irods.org)
*
*
*/
public class PagingAwareCollectionListing {

Expand All @@ -32,12 +33,12 @@ public enum PagingStyle {
*/
private List<CollectionAndDataObjectListingEntry> collectionAndDataObjectListingEntries;



/**
* Default (no-values) constructor for simple value object
*/
public PagingAwareCollectionListing() {
this.pagingAwareCollectionListingDescriptor = new PagingAwareCollectionListingDescriptor();
this.collectionAndDataObjectListingEntries = new ArrayList<CollectionAndDataObjectListingEntry>();
}

public List<CollectionAndDataObjectListingEntry> getCollectionAndDataObjectListingEntries() {
Expand Down Expand Up @@ -78,6 +79,4 @@ public String toString() {
return builder.toString();
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@
DiffTreePostProcessorTest.class,
FileTreeIteratorVisitorInvokerTest.class,
TreeSummarizingServiceImplTest.class, LocalTarFileArchiverTest.class,

LocalFileGzipCompressorTest.class, FileSamplerServiceImplTest.class })
ConnectionTesterImplTest.class })
LocalFileGzipCompressorTest.class, FileSamplerServiceImplTest.class,
ConnectionTesterImplTest.class })
public class AllTests {

}

0 comments on commit 0649afb

Please sign in to comment.