Author: mattmann
Date: Sat Jan 22 05:57:25 2011
New Revision: 1062100
URL: http://svn.apache.org/viewvc?rev=1062100&view=rev
Log:
- fix for OODT-117 Final File Location Extractor fails in actual use despite
unit test passing
Modified:
oodt/trunk/CHANGES.txt
oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/metadata/extractors/examples/FinalFileLocationExtractor.java
oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/metadata/extractors/examples/TestFinalFileLocationExtractor.java
Modified: oodt/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/oodt/trunk/CHANGES.txt?rev=1062100&r1=1062099&r2=1062100&view=diff
==============================================================================
--- oodt/trunk/CHANGES.txt (original)
+++ oodt/trunk/CHANGES.txt Sat Jan 22 05:57:25 2011
@@ -5,6 +5,9 @@ Release 0.2
--------------------------------------------
Release Date: January 17th, 2011
+* OODT-117 Final File Location Extractor fails in actual use despite unit test
+ passing (mattmann)
+
* OODT-115 TestCatalogServiceLocal fails (mattmann, pramirez)
* OODT-65 Release process now includes publishing to PyPi (pramirez, kelly,
mattmann)
Modified:
oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/metadata/extractors/examples/FinalFileLocationExtractor.java
URL:
http://svn.apache.org/viewvc/oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/metadata/extractors/examples/FinalFileLocationExtractor.java?rev=1062100&r1=1062099&r2=1062100&view=diff
==============================================================================
---
oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/metadata/extractors/examples/FinalFileLocationExtractor.java
(original)
+++
oodt/trunk/filemgr/src/main/java/org/apache/oodt/cas/filemgr/metadata/extractors/examples/FinalFileLocationExtractor.java
Sat Jan 22 05:57:25 2011
@@ -99,9 +99,19 @@ public class FinalFileLocationExtractor
throw new MetExtractionException(
"Unable to extract final file location from "
+ Product.STRUCTURE_HIERARCHICAL + " products!");
-
+
+ this.scrubRefs(product);
+
return extractMet;
}
+
+ private void scrubRefs(Product p){
+ if(p.getProductReferences() == null) return;
+
+ for(Reference r: p.getProductReferences()){
+ r.setDataStoreReference("");
+ }
+ }
}
Modified:
oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/metadata/extractors/examples/TestFinalFileLocationExtractor.java
URL:
http://svn.apache.org/viewvc/oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/metadata/extractors/examples/TestFinalFileLocationExtractor.java?rev=1062100&r1=1062099&r2=1062100&view=diff
==============================================================================
---
oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/metadata/extractors/examples/TestFinalFileLocationExtractor.java
(original)
+++
oodt/trunk/filemgr/src/test/org/apache/oodt/cas/filemgr/metadata/extractors/examples/TestFinalFileLocationExtractor.java
Sat Jan 22 05:57:25 2011
@@ -72,6 +72,9 @@ public class TestFinalFileLocationExtrac
expectedFinalLocation, extractMet.getAllMetadata(
CoreMetKeys.FILE_LOCATION).get(1));
+ // ensure that the data store ref is blank
+ assertEquals("", p.getProductReferences().get(0).getDataStoreReference());
+
// reconfigure to replace
config.setProperty("replace", "true");
extractor.configure(config);
@@ -88,6 +91,9 @@ public class TestFinalFileLocationExtrac
assertEquals(expectedFinalLocation, extractMet
.getMetadata(CoreMetKeys.FILE_LOCATION));
+ // ensure that the data store ref is blank
+ assertEquals("", p.getProductReferences().get(0).getDataStoreReference());
+
}
}