You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by th...@apache.org on 2012/03/30 11:17:12 UTC
svn commit: r1307326 - in /oodt/trunk: CHANGES.txt
filemgr/src/main/java/org/apache/oodt/cas/filemgr/cli/action/RetrieveFilesCliAction.java
filemgr/src/test/org/apache/oodt/cas/filemgr/cli/TestFileManagerCli.java
Author: thomas
Date: Fri Mar 30 09:17:12 2012
New Revision: 1307326
URL: http://svn.apache.org/viewvc?rev=1307326&view=rev
Log:
OODT-433 Fix retrieveFileByName and retrieveFileById buy setting the product's references before calling retrieveProduct
Modified:
oodt/trunk/CHANGES.txt
oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/cli/action/RetrieveFilesCliAction.java
oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/cli/TestFileManagerCli.java
Modified: oodt/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/oodt/trunk/CHANGES.txt?rev=1307326&r1=1307325&r2=1307326&view=diff
==============================================================================
--- oodt/trunk/CHANGES.txt (original)
+++ oodt/trunk/CHANGES.txt Fri Mar 30 09:17:12 2012
@@ -4,6 +4,9 @@ Apache OODT Change Log
Release 0.4: Current Development
--------------------------------------------
+* OODT-433 Fix retrieveFileByName and retrieveFileById buy setting the product's references
+ before calling retrieveProduct (thomas)
+
* OODT-430 Update all boolean type bean properties in the crawler cmd-line-options.xml (thomas)
* OODT-412 Bugfix: MoveMetadataToFailureDir should read MoveMetadataFileToFailureDir (thomas)
Modified: oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/cli/action/RetrieveFilesCliAction.java
URL: http://svn.apache.org/viewvc/oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/cli/action/RetrieveFilesCliAction.java?rev=1307326&r1=1307325&r2=1307326&view=diff
==============================================================================
--- oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/cli/action/RetrieveFilesCliAction.java (original)
+++ oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/cli/action/RetrieveFilesCliAction.java Fri Mar 30 09:17:12 2012
@@ -48,16 +48,16 @@ public class RetrieveFilesCliAction exte
if (productId != null) {
product = fmClient.getProductById(productId);
} else if (productName != null) {
- product = fmClient.getProductByName(productName);
+ product = fmClient.getProductByName(productName);
} else {
- throw new Exception("Must specify either productId or productName");
+ throw new Exception("Must specify either productId or productName");
}
if (product != null) {
+ product.setProductReferences(fmClient.getProductReferences(product));
dt.retrieveProduct(product, destination);
} else {
throw new Exception("Product was not found");
}
- dt.retrieveProduct(product, destination);
} catch (Exception e) {
throw new CmdLineActionException("Failed to retrieve files for product : " + e.getMessage(), e);
}
Modified: oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/cli/TestFileManagerCli.java
URL: http://svn.apache.org/viewvc/oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/cli/TestFileManagerCli.java?rev=1307326&r1=1307325&r2=1307326&view=diff
==============================================================================
--- oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/cli/TestFileManagerCli.java (original)
+++ oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/cli/TestFileManagerCli.java Fri Mar 30 09:17:12 2012
@@ -375,8 +375,8 @@ public class TestFileManagerCli extends
+ " --productId " + productId + " --destination " + destination
+ " --transferer " + transferer).split(" "));
MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
- assertEquals("getProductById", methodCallDetails.getMethodName());
- assertEquals(productId, methodCallDetails.getArgs().get(0));
+ assertEquals("getProductReferences", methodCallDetails.getMethodName());
+ assertEquals(productId, ((Product) methodCallDetails.getArgs().get(0)).getProductId());
}
public void testRetrieveFilesByName() {
@@ -388,7 +388,7 @@ public class TestFileManagerCli extends
+ " --productName " + productName + " --destination " + destination
+ " --transferer " + transferer).split(" "));
MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
- assertEquals("getProductByName", methodCallDetails.getMethodName());
- assertEquals(productName, methodCallDetails.getArgs().get(0));
+ assertEquals("getProductReferences", methodCallDetails.getMethodName());
+ assertEquals(productName, ((Product) methodCallDetails.getArgs().get(0)).getProductName());
}
}