aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/POIDataSamples.java
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2011-03-03 12:41:39 +0000
committerNick Burch <nick@apache.org>2011-03-03 12:41:39 +0000
commit9ae939c6f799b058f88b8b3ca7617d1ae9fdf600 (patch)
tree12bb9071037ae202174f98be42bb2f2e14fd6201 /src/testcases/org/apache/poi/POIDataSamples.java
parentfd77fc1d74719d438e1260695605626b7bcd2daf (diff)
downloadpoi-9ae939c6f799b058f88b8b3ca7617d1ae9fdf600.tar.gz
poi-9ae939c6f799b058f88b8b3ca7617d1ae9fdf600.zip
Improve HMEF handling of typed attributes (Strings and Dates), for both TNEF and MAPI attributes, and use this to allow easier access to common file parts. Then use this in the attachment unit tests.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1076603 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/POIDataSamples.java')
-rw-r--r--src/testcases/org/apache/poi/POIDataSamples.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/testcases/org/apache/poi/POIDataSamples.java b/src/testcases/org/apache/poi/POIDataSamples.java
index 6f60a4e184..6cdf7ce8f5 100644
--- a/src/testcases/org/apache/poi/POIDataSamples.java
+++ b/src/testcases/org/apache/poi/POIDataSamples.java
@@ -154,9 +154,15 @@ public final class POIDataSamples {
+ "' not found in data dir '" + _resolvedDataDir.getAbsolutePath() + "'");
}
try {
- if(sampleFileName.length() > 0 && !sampleFileName.equals(f.getCanonicalFile().getName())){
- throw new RuntimeException("File name is case-sensitive: requested '" + sampleFileName
+ if(sampleFileName.length() > 0) {
+ String fn = sampleFileName;
+ if(fn.indexOf('/') > 0) {
+ fn = fn.substring(fn.indexOf('/')+1);
+ }
+ if(!fn.equals(f.getCanonicalFile().getName())){
+ throw new RuntimeException("File name is case-sensitive: requested '" + fn
+ "' but actual file is '" + f.getCanonicalFile().getName() + "'");
+ }
}
} catch (IOException e){
throw new RuntimeException(e);