/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class PropertiesTest {
for (int i = 0; i < s.length; i ++) {
if ("-d".equals(s[i])) {
i++;
if (i == s.length) {
throw new RuntimeException("-d needs output file name");
} else {
dump(s[i]);
}
} else if ("-c".equals(s[i])) {
if (i+2 == s.length) {
throw new RuntimeException("-d needs two file name arguments, before and after respectively");
} else {
compare(s[++i], s[++i]);
}
}
}
}
try {
f.createNewFile();
pw = new PrintWriter(f);
throw new RuntimeException(fnfe);
}
try {
if (c != null) {
ctry,
c.getCurrencyCode(),
c.getNumericCode(),
c.getDefaultFractionDigits());
}
} catch (IllegalArgumentException iae) {
// invalid country code
continue;
}
}
}
}
// load file contents
try {
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
// remove the same contents from the 'after' properties
} else {
}
}
// now look at the currency.properties
Properties p = new Properties();
try {
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
// test each replacements
keys = p.stringPropertyNames();
if (!m.find()) {
// format is not recognized.
throw new RuntimeException("Currency data replacement for "+key+" failed: It was incorrectly altered to "+afterVal);
}
// ignore this
continue;
}
(numeric == numericAfter)&&
(fraction == fractionAfter)) {
} else {
throw new RuntimeException("Currency data replacement for "+key+" failed: actual: (alphacode: "+codeAfter+", numcode: "+numericAfter+", fraction: "+fractionAfter+"), expected: (alphacode: "+code+", numcode: "+numeric+", fraction: "+fraction+")");
}
}
.append("Currency data replacement failed. Unnecessary modification was(were) made for the following currencies:\n");
.append(" currency: ")
.append("\n");
}
}
}
}