Changeset 6995 in josm for trunk/test


Ignore:
Timestamp:
2014-04-23T02:30:39+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #9906 - fix reliance on default encoding

Location:
trunk/test
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java

    r6920 r6995  
    1010import java.io.File;
    1111import java.io.FileInputStream;
    12 import java.io.FileWriter;
     12import java.io.FileOutputStream;
    1313import java.io.IOException;
    1414import java.io.InputStream;
     15import java.io.OutputStreamWriter;
    1516import java.io.PrintWriter;
    1617import java.text.MessageFormat;
     
    3637import org.openstreetmap.josm.gui.io.UploadStrategySpecification;
    3738import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
     39import org.openstreetmap.josm.tools.Utils;
    3840
    3941public class MultiFetchServerObjectReaderTest {
     
    211213        try {
    212214            PrintWriter pw = new PrintWriter(
    213                     new FileWriter(dataSetCacheOutputFile)
     215                    new OutputStreamWriter(new FileOutputStream(dataSetCacheOutputFile), Utils.UTF_8)
    214216            );
    215217            logger.info(MessageFormat.format("caching test data set in ''{0}'' ...", dataSetCacheOutputFile.toString()));
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java

    r6920 r6995  
    88import java.io.File;
    99import java.io.FileInputStream;
    10 import java.io.FileWriter;
     10import java.io.FileOutputStream;
    1111import java.io.IOException;
    1212import java.io.InputStream;
     13import java.io.OutputStreamWriter;
    1314import java.io.PrintWriter;
    1415import java.text.MessageFormat;
     
    3738import org.openstreetmap.josm.gui.io.UploadStrategySpecification;
    3839import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
     40import org.openstreetmap.josm.tools.Utils;
    3941
    4042public class OsmServerBackreferenceReaderTest {
     
    218220        try {
    219221            PrintWriter pw = new PrintWriter(
    220                     new FileWriter(dataSetCacheOutputFile)
     222                    new OutputStreamWriter(new FileOutputStream(dataSetCacheOutputFile), Utils.UTF_8)
    221223            );
    222224            logger.info(MessageFormat.format("caching test data set in ''{0}'' ...", dataSetCacheOutputFile.toString()));
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java

    r6334 r6995  
    33
    44import java.io.BufferedReader;
     5import java.io.FileInputStream;
    56import java.io.FileNotFoundException;
    6 import java.io.FileReader;
    77import java.io.IOException;
     8import java.io.InputStreamReader;
    89import java.util.Collection;
    910import java.util.HashMap;
     
    4849    @Test
    4950    public void test() throws IOException, FileNotFoundException {
    50         BufferedReader in = new BufferedReader(new FileReader("data_nodist/projection-reference-data.csv"));
     51        BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream("data_nodist/projection-reference-data.csv"), Utils.UTF_8));
    5152        StringBuilder fail = new StringBuilder();
    5253        String line;
     
    9293            throw new AssertionError(fail.toString());
    9394        }
    94 
    9595    }
    9696}
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java

    r6881 r6995  
    55import java.io.BufferedWriter;
    66import java.io.File;
     7import java.io.FileInputStream;
    78import java.io.FileNotFoundException;
    8 import java.io.FileReader;
    9 import java.io.FileWriter;
     9import java.io.FileOutputStream;
    1010import java.io.IOException;
     11import java.io.InputStreamReader;
     12import java.io.OutputStreamWriter;
    1113import java.util.ArrayList;
    1214import java.util.Collection;
     
    2931import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
    3032import org.openstreetmap.josm.tools.Pair;
     33import org.openstreetmap.josm.tools.Utils;
    3134
    3235/**
     
    8790
    8891        Random rand = new Random();
    89         BufferedWriter out = new BufferedWriter(new FileWriter(PROJECTION_DATA_FILE));
     92        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(PROJECTION_DATA_FILE), Utils.UTF_8));
    9093        out.write("# Data for test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java\n");
    9194        out.write("# Format: 1. Projection code; 2. lat/lon; 3. lat/lon projected -> east/north; 4. east/north (3.) inverse projected\n");
     
    112115
    113116    private static List<TestData> readData() throws IOException, FileNotFoundException {
    114         BufferedReader in = new BufferedReader(new FileReader(PROJECTION_DATA_FILE));
     117        BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(PROJECTION_DATA_FILE), Utils.UTF_8));
    115118        List<TestData> result = new ArrayList<TestData>();
    116119        String line;
Note: See TracChangeset for help on using the changeset viewer.