Skip to content

Commit

Permalink
#61 fix misc variance in exceptions for 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-conway committed May 18, 2015
1 parent 531a3a8 commit f96047b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 43 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ Resource groups are no longer a concept, so some operations using resource group
#### estTrimReplicasForDataObjectByResourceNameInvalid fails with uncaught -78000 #109

Added a ResourceNotFoundException in the hierarchy. For prior to 4.1, will maintain current behavior of silently ignoring, which in retrospect might be a bit odd. But no surprises! From 4.1+ will throw a DataNotFoundException. It's a little messy, may rethink that later.

#### Read length set to 0 on phymove, likely protocol change #111

Fixed phymove api numbers, maintains backwards compatability
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.irods.jargon.core.connection.IRODSServerProperties;
import org.irods.jargon.core.exception.DataNotFoundException;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.exception.ResourceHierarchyException;
import org.irods.jargon.core.pub.io.IRODSFile;
import org.irods.jargon.testutils.AssertionHelper;
import org.irods.jargon.testutils.IRODSTestSetupUtilities;
Expand All @@ -35,11 +36,11 @@ public static void setUpBeforeClass() throws Exception {
testingProperties = testingPropertiesLoader.getTestProperties();
scratchFileUtils = new ScratchFileUtils(testingProperties);
scratchFileUtils
.clearAndReinitializeScratchDirectory(IRODS_TEST_SUBDIR_PATH);
.clearAndReinitializeScratchDirectory(IRODS_TEST_SUBDIR_PATH);
irodsTestSetupUtilities = new IRODSTestSetupUtilities();
irodsTestSetupUtilities.initializeIrodsScratchDirectory();
irodsTestSetupUtilities
.initializeDirectoryForTest(IRODS_TEST_SUBDIR_PATH);
.initializeDirectoryForTest(IRODS_TEST_SUBDIR_PATH);
assertionHelper = new AssertionHelper();
irodsFileSystem = IRODSFileSystem.instance();
}
Expand Down Expand Up @@ -336,8 +337,8 @@ public void testCreateBundleWhenTarFileAlreadyExistsForceSpecified()
irodsAccount);

bulkFileOperationsAO
.createABundleFromIrodsFilesAndStoreInIrodsWithForceOption(
targetBunFileAbsPath, targetIrodsCollection, "");
.createABundleFromIrodsFilesAndStoreInIrodsWithForceOption(
targetBunFileAbsPath, targetIrodsCollection, "");
assertionHelper.assertIrodsFileOrCollectionExists(targetBunFileAbsPath,
irodsFileSystem.getIRODSAccessObjectFactory(), irodsAccount);

Expand Down Expand Up @@ -572,8 +573,8 @@ public void testExtractBundleWithOverwriteNoBulkWhenTargetCollectionAlreadyExist
// repeat the same operation, causing an overwrite situation, should get
// an error
bulkFileOperationsAO
.extractABundleIntoAnIrodsCollectionWithForceOption(
targetBunFileAbsPath, targetIrodsCollection, "");
.extractABundleIntoAnIrodsCollectionWithForceOption(
targetBunFileAbsPath, targetIrodsCollection, "");

File targetColl = (File) irodsFileSystem.getIRODSFileFactory(
irodsAccount).instanceIRODSFile(targetIrodsCollection);
Expand Down Expand Up @@ -658,8 +659,8 @@ public void testExtractBundleNoOverwriteWithBulk() throws Exception {
+ testExtractTargetSubdir);

bulkFileOperationsAO
.extractABundleIntoAnIrodsCollectionWithBulkOperationOptimization(
targetBunFileAbsPath, targetIrodsCollection, "");
.extractABundleIntoAnIrodsCollectionWithBulkOperationOptimization(
targetBunFileAbsPath, targetIrodsCollection, "");

File targetColl = (File) irodsFileSystem.getIRODSFileFactory(
irodsAccount).instanceIRODSFile(targetIrodsCollection);
Expand Down Expand Up @@ -743,9 +744,9 @@ public void testExtractBundleNoOverwriteWithBulkSpecifyResource()
extractSubdir.close();

bulkFileOperationsAO
.extractABundleIntoAnIrodsCollectionWithBulkOperationOptimization(
targetBunFileAbsPath, targetIrodsCollection,
testResource);
.extractABundleIntoAnIrodsCollectionWithBulkOperationOptimization(
targetBunFileAbsPath, targetIrodsCollection,
testResource);

File targetColl = (File) irodsFileSystem.getIRODSFileFactory(
irodsAccount).instanceIRODSFile(targetIrodsCollection);
Expand Down Expand Up @@ -828,12 +829,17 @@ public void testExtractBundleNoOverwriteWithBulkSpecifyWrongResource()
extractSubdir.mkdirs();
extractSubdir.close();

bulkFileOperationsAO
.extractABundleIntoAnIrodsCollectionWithBulkOperationOptimization(
targetBunFileAbsPath,
targetIrodsCollection,
testingProperties
.getProperty(TestingPropertiesHelper.IRODS_SECONDARY_RESOURCE_KEY));
try {
bulkFileOperationsAO
.extractABundleIntoAnIrodsCollectionWithBulkOperationOptimization(
targetBunFileAbsPath,
targetIrodsCollection,
testingProperties
.getProperty(TestingPropertiesHelper.IRODS_SECONDARY_RESOURCE_KEY));
} catch (ResourceHierarchyException e) {
// expected when 4.1+
throw new DataNotFoundException(e);
}

File targetColl = (File) irodsFileSystem.getIRODSFileFactory(
irodsAccount).instanceIRODSFile(targetIrodsCollection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public static void setUpBeforeClass() throws Exception {
scratchFileUtils = new org.irods.jargon.testutils.filemanip.ScratchFileUtils(
testingProperties);
scratchFileUtils
.clearAndReinitializeScratchDirectory(IRODS_TEST_SUBDIR_PATH);
.clearAndReinitializeScratchDirectory(IRODS_TEST_SUBDIR_PATH);
irodsTestSetupUtilities = new org.irods.jargon.testutils.IRODSTestSetupUtilities();
irodsTestSetupUtilities.initializeIrodsScratchDirectory();
irodsTestSetupUtilities
.initializeDirectoryForTest(IRODS_TEST_SUBDIR_PATH);
.initializeDirectoryForTest(IRODS_TEST_SUBDIR_PATH);
assertionHelper = new org.irods.jargon.testutils.AssertionHelper();
irodsFileSystem = IRODSFileSystem.instance();
}
Expand Down Expand Up @@ -124,7 +124,7 @@ public void testExecuteRuleNewSyntax() throws Exception {

/**
* [#768] -1202000 error executing rule via jargon
*
*
* @throws Exception
*/
@Test
Expand Down Expand Up @@ -163,7 +163,7 @@ public void testExecuteRuleNewSyntaxWithWriteLine() throws Exception {

/**
* [#768] -1202000 error executing rule via jargon
*
*
* @throws Exception
*/
@Test
Expand Down Expand Up @@ -264,7 +264,7 @@ public void testExecuteRuleFromResourceWithOverrides() throws Exception {
String targetIrodsFile = testingPropertiesHelper
.buildIRODSCollectionAbsolutePathFromTestProperties(
testingProperties, IRODS_TEST_SUBDIR_PATH + '/'
+ testFileName);
+ testFileName);
File localFile = new File(localFileName);

IRODSFileFactory irodsFileFactory = irodsFileSystem
Expand Down Expand Up @@ -355,7 +355,7 @@ public void testExecuteRuleFromIrodsFileNullParmOverrides()

/**
* [#547] error running old style rule via irods file
*
*
* @throws Exception
*/
@Test
Expand Down Expand Up @@ -452,7 +452,9 @@ public void testExecuteRuleWithDelay() throws Exception {

}

@Test
@Ignore
// FIXME: overheaded until resolved
// https://github.com/DICE-UNC/jargon/issues/110
public void testRuleContainsConditionWithEqualsInAttrib() throws Exception {

// put a collection out to do a checksum on
Expand Down Expand Up @@ -488,7 +490,7 @@ public void testRuleContainsConditionWithEqualsInAttrib() throws Exception {

StringBuilder ruleBuilder = new StringBuilder();
ruleBuilder
.append("myTestRule||acGetIcatResults(*Action,*Condition,*B)##forEachExec(*B,msiGetValByKey(*B,RESC_LOC,*R)##remoteExec(*R,null,msiDataObjChksum(*B,*Operation,*C),nop)##msiGetValByKey(*B,DATA_NAME,*D)##msiGetValByKey(*B,COLL_NAME,*E)##writeLine(stdout,CheckSum of *E/*D at *R is *C),nop)|nop##nop\n");
.append("myTestRule||acGetIcatResults(*Action,*Condition,*B)##forEachExec(*B,msiGetValByKey(*B,RESC_LOC,*R)##remoteExec(*R,null,msiDataObjChksum(*B,*Operation,*C),nop)##msiGetValByKey(*B,DATA_NAME,*D)##msiGetValByKey(*B,COLL_NAME,*E)##writeLine(stdout,CheckSum of *E/*D at *R is *C),nop)|nop##nop\n");
ruleBuilder.append("*Action=chksumRescLoc%*Condition=COLL_NAME = '");

ruleBuilder.append(targetIrodsCollection);
Expand Down Expand Up @@ -531,7 +533,7 @@ public void testExecuteRequestClientActionPut() throws Exception {
String targetIrodsFileName = testingPropertiesHelper
.buildIRODSCollectionAbsolutePathFromTestProperties(
testingProperties, IRODS_TEST_SUBDIR_PATH)
+ "/" + testResultFileName;
+ "/" + testResultFileName;

IRODSAccount irodsAccount = testingPropertiesHelper
.buildIRODSAccountFromTestProperties(testingProperties);
Expand Down Expand Up @@ -581,7 +583,7 @@ public void testExecuteRequestClientActionParallelPut() throws Exception {
String targetIrodsFileName = testingPropertiesHelper
.buildIRODSCollectionAbsolutePathFromTestProperties(
testingProperties, IRODS_TEST_SUBDIR_PATH)
+ "/" + testResultFileName;
+ "/" + testResultFileName;

IRODSAccount irodsAccount = testingPropertiesHelper
.buildIRODSAccountFromTestProperties(testingProperties);
Expand Down Expand Up @@ -622,7 +624,7 @@ public void testExecuteRequestClientActionParallelPut() throws Exception {
/**
* File put by client action in rule, should be parallel, rule says no
* parallel [#630] execute msiDataObjGet via Jargon
*
*
* @throws Exception
*/
@Test
Expand All @@ -640,7 +642,7 @@ public void testExecuteRequestClientActionParallelPutNoThreading()
String targetIrodsFileName = testingPropertiesHelper
.buildIRODSCollectionAbsolutePathFromTestProperties(
testingProperties, IRODS_TEST_SUBDIR_PATH)
+ "/" + testFileName;
+ "/" + testFileName;

IRODSAccount irodsAccount = testingPropertiesHelper
.buildIRODSAccountFromTestProperties(testingProperties);
Expand Down Expand Up @@ -706,7 +708,7 @@ public void testExecuteRequestClientActionPutWithOverwriteFileExists()
String targetIrodsFileName = testingPropertiesHelper
.buildIRODSCollectionAbsolutePathFromTestProperties(
testingProperties, IRODS_TEST_SUBDIR_PATH)
+ "/" + testFileName;
+ "/" + testFileName;

IRODSAccount irodsAccount = testingPropertiesHelper
.buildIRODSAccountFromTestProperties(testingProperties);
Expand Down Expand Up @@ -767,7 +769,7 @@ public void testExecuteRequestClientActionPutWithNoOverwriteFileExists()
String targetIrodsFileName = testingPropertiesHelper
.buildIRODSCollectionAbsolutePathFromTestProperties(
testingProperties, IRODS_TEST_SUBDIR_PATH)
+ "/" + testFileName;
+ "/" + testFileName;

IRODSAccount irodsAccount = testingPropertiesHelper
.buildIRODSAccountFromTestProperties(testingProperties);
Expand Down Expand Up @@ -808,7 +810,7 @@ public void testExecuteRequestClientActionPutLocalFileNotExists()
// put a collection out to do a checksum on
String testFileName = "testClientAction.txt";
scratchFileUtils
.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH);
.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH);
String putFileName = "/a/bogus/dir/" + testFileName;

IRODSAccount irodsAccount = testingPropertiesHelper
Expand Down Expand Up @@ -894,7 +896,7 @@ public void testExecuteRequestClientActionGetFile() throws Exception {

/**
* Bug [#1641] [iROD-Chat:10574] Fwd: Porting rules to Jargon
*
*
* @throws Exception
*/
@Test
Expand Down Expand Up @@ -953,7 +955,7 @@ public void testExecuteRequestMultipleClientActionGetFileBug1641()
File sourceFile = new File(scratchFileAbsolutePath);
IRODSFile targetFile = accessObjectFactory.getIRODSFileFactory(
irodsAccount).instanceIRODSFile(targetIrodsCollection,
testFileName);
testFileName);

DataTransferOperations dto = accessObjectFactory
.getDataTransferOperations(irodsAccount);
Expand All @@ -962,7 +964,7 @@ public void testExecuteRequestMultipleClientActionGetFileBug1641()
File sourceFile1 = new File(scratchFileAbsolutePath1);
IRODSFile targetFile1 = accessObjectFactory.getIRODSFileFactory(
irodsAccount).instanceIRODSFile(targetIrodsCollection,
testFileName1);
testFileName1);

dto.putOperation(sourceFile1, targetFile1, null, tcb);

Expand Down Expand Up @@ -996,7 +998,7 @@ public void testExecuteRequestMultipleClientActionGetFileBug1641()

/**
* Bug [#1641] [iROD-Chat:10574] Fwd: Porting rules to Jargon
*
*
* @throws Exception
*/
@Test
Expand Down Expand Up @@ -1057,7 +1059,7 @@ public void testPutGetInterleavedBug1641() throws Exception {
String putTargetFile = testingPropertiesHelper
.buildIRODSCollectionAbsolutePathFromTestProperties(
testingProperties, IRODS_TEST_SUBDIR_PATH)
+ "/" + testPutFileName;
+ "/" + testPutFileName;

TransferControlBlock tcb = irodsFileSystem
.getIRODSAccessObjectFactory()
Expand All @@ -1067,7 +1069,7 @@ public void testPutGetInterleavedBug1641() throws Exception {
File sourceFile = new File(scratchFileAbsolutePath);
IRODSFile targetFile = accessObjectFactory.getIRODSFileFactory(
irodsAccount).instanceIRODSFile(targetIrodsCollection,
testFileName);
testFileName);

DataTransferOperations dto = accessObjectFactory
.getDataTransferOperations(irodsAccount);
Expand All @@ -1076,7 +1078,7 @@ public void testPutGetInterleavedBug1641() throws Exception {
File sourceFile1 = new File(scratchFileAbsolutePath1);
IRODSFile targetFile1 = accessObjectFactory.getIRODSFileFactory(
irodsAccount).instanceIRODSFile(targetIrodsCollection,
testFileName1);
testFileName1);

dto.putOperation(sourceFile1, targetFile1, null, tcb);

Expand Down Expand Up @@ -1264,7 +1266,7 @@ public void testExecuteRequestClientActionGetFileParallelBug1641AddMessages()
/**
* [#630] execute msiDataObjGet via Jargon Test a get operation with a file
* above the parallel txfr max with -1 in num threads
*
*
* @throws Exception
*/
@Test
Expand Down Expand Up @@ -1405,7 +1407,7 @@ public void testExecuteRequestClientActionPutBug181() throws Exception {
String targetIrodsFileName = testingPropertiesHelper
.buildIRODSCollectionAbsolutePathFromTestProperties(
testingProperties, IRODS_TEST_SUBDIR_PATH)
+ "/" + irodsFileName;
+ "/" + irodsFileName;

IRODSAccount irodsAccount = testingPropertiesHelper
.buildIRODSAccountFromTestProperties(testingProperties);
Expand Down Expand Up @@ -1466,7 +1468,7 @@ public void testExecuteRuleBug182() throws Exception {
String targetIrodsFileName = testingPropertiesHelper
.buildIRODSCollectionAbsolutePathFromTestProperties(
testingProperties, IRODS_TEST_SUBDIR_PATH)
+ "/" + testFileName;
+ "/" + testFileName;

IRODSAccount irodsAccount = testingPropertiesHelper
.buildIRODSAccountFromTestProperties(testingProperties);
Expand Down Expand Up @@ -1571,7 +1573,7 @@ public void testPurgeAllDelayedRuleExecutions() throws Exception {
/**
* Bug [#914] rule error : could not find name and val separated by an '='
* sign in input attribute
*
*
* @throws Exception
*/
@Test
Expand Down

0 comments on commit f96047b

Please sign in to comment.