Changeset 6995 in josm for trunk/test/unit


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

fix #9906 - fix reliance on default encoding

Location:
trunk/test/unit/org/openstreetmap/josm/data/projection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.