01: /*
02: *******************************************************************************
03: * Copyright (C) 1996-2005, International Business Machines Corporation and *
04: * others. All Rights Reserved. *
05: *******************************************************************************
06: *
07: */
08:
09: package com.ibm.icu.dev.test.serializable;
10:
11: import com.ibm.icu.util.VersionInfo;
12:
13: import java.net.URL;
14:
15: /**
16: * This class writes the test objects for each class to a file. The work is
17: * actually done by the superclass, CoverageTest. This class just constructs
18: * a CoverageTest w/ a non-null path, which tells it to write the data.
19: *
20: */
21: public class SerializableWriter extends CoverageTest {
22: public SerializableWriter(String path) {
23: super (path);
24: }
25:
26: private static String folderName() {
27: int major = VersionInfo.ICU_VERSION.getMajor();
28: int minor = VersionInfo.ICU_VERSION.getMinor();
29: int milli = VersionInfo.ICU_VERSION.getMilli();
30: int micro = VersionInfo.ICU_VERSION.getMicro();
31: StringBuffer result = new StringBuffer("ICU_");
32:
33: result.append(major);
34: result.append(".");
35: result.append(minor);
36:
37: if (milli != 0 || micro != 0) {
38: result.append(".");
39: result.append(milli);
40:
41: if (micro != 0) {
42: result.append(".");
43: result.append(micro);
44: }
45: }
46:
47: return result.toString();
48: }
49:
50: public static void main(String[] args) {
51: URL dataURL = SerializableWriter.class.getResource("data");
52: CoverageTest test = new SerializableWriter(dataURL.getPath()
53: + "/" + folderName());
54:
55: test.run(args);
56:
57: }
58: }
|