ICU-10268 Serialization compatibility test related changes. Cleaned up skip cases. Reverted a previous change that seemed to exclude Currency from the compatibility test. Also fixed some compiler warnings introduced by previous commits for this ticket.

X-SVN-Rev: 34124
This commit is contained in:
Yoshito Umaoka 2013-08-29 17:45:39 +00:00
parent bd82ee99c1
commit ca03cd866d
3 changed files with 14 additions and 53 deletions

View File

@ -6,7 +6,6 @@
*/
package com.ibm.icu.util;
import java.io.IOException;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.lang.ref.SoftReference;
@ -32,7 +31,6 @@ import com.ibm.icu.text.CurrencyDisplayNames;
import com.ibm.icu.text.CurrencyMetaInfo;
import com.ibm.icu.text.CurrencyMetaInfo.CurrencyDigits;
import com.ibm.icu.text.CurrencyMetaInfo.CurrencyFilter;
import com.ibm.icu.util.MeasureUnit.MeasureUnitProxy;
import com.ibm.icu.util.ULocale.Category;
/**

View File

@ -378,7 +378,7 @@ public class MeasureUnit implements Comparable<MeasureUnit>, Serializable {
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
byte version = in.readByte(); // version
/* byte version = */ in.readByte(); // version
type = in.readUTF();
code = in.readUTF();
// allow for more data from future version

View File

@ -13,9 +13,6 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.JarURLConnection;
import java.net.URL;
import java.util.Enumeration;
@ -117,68 +114,34 @@ public class CompatibilityTest extends TestFmwk
}catch (MissingResourceException e){
warnln("Could not load the data. "+e.getMessage());
} catch (Exception e) {
if (e.getMessage() == null
|| !e.getMessage().contains("com.ibm.icu.util.Currency")) {
StringWriter b = new StringWriter();
e.printStackTrace(new PrintWriter(b));
assertNull("", b.toString());
}
e.printStackTrace();
errln("Exception: " + e.toString());
}
}
}
}
private static final String[][] SKIP_CASES = {
{"ICU_3.8.1", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_3.8.1", "com.ibm.icu.text.PluralRules.dat"},
// ICU 52 is not serialization-compatible with previous versions.
{"ICU_3.8.1", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_3.8.1", "com.ibm.icu.text.PluralRules.dat"},
{"ICU_4.0", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_4.0", "com.ibm.icu.text.PluralRules.dat"},
{"ICU_4.2.1", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_4.2.1", "com.ibm.icu.text.PluralRules.dat"},
{"ICU_4.4", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_4.4", "com.ibm.icu.text.PluralRules.dat"},
{"ICU_4.4", "com.ibm.icu.text.CurrencyPluralInfo.dat"},
{"ICU_4.6", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_4.6", "com.ibm.icu.text.PluralRules.dat"},
{"ICU_4.6", "com.ibm.icu.text.CurrencyPluralInfo.dat"},
{"ICU_4.8", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_4.8", "com.ibm.icu.text.PluralRules.dat"},
{"ICU_4.8", "com.ibm.icu.text.CurrencyPluralInfo.dat"},
{"ICU_49.1", "com.ibm.icu.text.CurrencyPluralInfo.dat"},
{"ICU_49.1", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_49.1", "com.ibm.icu.text.PluralRules.dat"},
// ICU 52 PluralRules/PluralFormat/CurrencyPluralInfo are not
// serialization-compatible with previous versions.
{"ICU_50.1", "com.ibm.icu.text.CurrencyPluralInfo.dat"},
{"ICU_50.1", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_50.1", "com.ibm.icu.text.PluralRules.dat"},
{"ICU_51.1", "com.ibm.icu.text.CurrencyPluralInfo.dat"},
{"ICU_50.1", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_51.1", "com.ibm.icu.text.PluralFormat.dat"},
{"ICU_50.1", "com.ibm.icu.text.PluralRules.dat"},
{"ICU_51.1", "com.ibm.icu.text.PluralRules.dat"},
// Currency format changed in 52, which means NumberFormat did also
// Currency format changed in 52
{"ICU_3.6", "com.ibm.icu.util.Currency.dat"},
{"ICU_3.6", "com.ibm.icu.text.NumberFormat.dat"},
{"ICU_50.1", "com.ibm.icu.util.Currency.dat"},
{"ICU_51.1", "com.ibm.icu.util.Currency.dat"},
{"ICU_51.1", "com.ibm.icu.text.NumberFormat.dat"},
{"ICU_3.6", "com.ibm.icu.text.RuleBasedNumberFormat.dat"},
{"ICU_3.8.1", "com.ibm.icu.text.RuleBasedNumberFormat.dat"},
{"ICU_4.0", "com.ibm.icu.text.RuleBasedNumberFormat.dat"},
{"ICU_4.2.1", "com.ibm.icu.text.CurrencyPluralInfo.dat"},
// ICU 4.8 MessageFormat is not serialization-compatible with previous versions.
{"ICU_3.6", "com.ibm.icu.text.MessageFormat.dat"},
{"ICU_3.8.1", "com.ibm.icu.text.MessageFormat.dat"},
{"ICU_4.0", "com.ibm.icu.text.MessageFormat.dat"},
{"ICU_4.2.1", "com.ibm.icu.text.MessageFormat.dat"},
{"ICU_4.4", "com.ibm.icu.text.MessageFormat.dat"},
{"ICU_4.6", "com.ibm.icu.text.MessageFormat.dat"},
// RelativeDateFormat apparently uses and serializes a MessageFormat.
{"ICU_4.0", "com.ibm.icu.impl.RelativeDateFormat.dat"},
{"ICU_4.2.1", "com.ibm.icu.impl.RelativeDateFormat.dat"},
{"ICU_4.4", "com.ibm.icu.impl.RelativeDateFormat.dat"},
{"ICU_4.6", "com.ibm.icu.impl.RelativeDateFormat.dat"},
};
private Target getFileTargets(URL fileURL)