Changeset 7082 in josm for trunk/test


Ignore:
Timestamp:
2014-05-09T05:32:37+02:00 (10 years ago)
Author:
Don-vip
Message:

see #8465 - replace Utils.UTF_8 by StandardCharsets.UTF_8, new in Java 7

Location:
trunk/test
Files:
6 edited

Legend:

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

    r7081 r7082  
    1414import java.io.OutputStreamWriter;
    1515import java.io.PrintWriter;
     16import java.nio.charset.StandardCharsets;
    1617import java.text.MessageFormat;
    1718import java.util.ArrayList;
     
    3536import org.openstreetmap.josm.gui.io.UploadStrategySpecification;
    3637import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    37 import org.openstreetmap.josm.tools.Utils;
    3838
    3939public class MultiFetchServerObjectReaderTest {
     
    167167        try (
    168168            PrintWriter pw = new PrintWriter(
    169                     new OutputStreamWriter(new FileOutputStream(dataSetCacheOutputFile), Utils.UTF_8)
     169                    new OutputStreamWriter(new FileOutputStream(dataSetCacheOutputFile), StandardCharsets.UTF_8)
    170170        )) {
    171171            logger.info(MessageFormat.format("caching test data set in ''{0}'' ...", dataSetCacheOutputFile.toString()));
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java

    r7068 r7082  
    1212import java.io.OutputStreamWriter;
    1313import java.io.PrintWriter;
     14import java.nio.charset.StandardCharsets;
    1415import java.text.MessageFormat;
    1516import java.util.ArrayList;
     
    3637import org.openstreetmap.josm.gui.io.UploadStrategySpecification;
    3738import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    38 import org.openstreetmap.josm.tools.Utils;
    3939
    4040/**
     
    173173        try (
    174174            PrintWriter pw = new PrintWriter(
    175                     new OutputStreamWriter(new FileOutputStream(dataSetCacheOutputFile), Utils.UTF_8)
     175                    new OutputStreamWriter(new FileOutputStream(dataSetCacheOutputFile), StandardCharsets.UTF_8)
    176176        )) {
    177177            logger.info(MessageFormat.format("caching test data set in ''{0}'' ...", dataSetCacheOutputFile.toString()));
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java

    r7033 r7082  
    77import java.io.IOException;
    88import java.io.InputStreamReader;
     9import java.nio.charset.StandardCharsets;
    910import java.util.Collection;
    1011import java.util.HashMap;
     
    1718import org.openstreetmap.josm.gui.preferences.projection.ProjectionChoice;
    1819import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
    19 import org.openstreetmap.josm.tools.Utils;
    2020
    2121/**
    2222 * Test projections using reference data. (Currently provided by proj.4)
    23  * 
     23 *
    2424 * The data file data_nodist/projection-reference-data.csv can be created like this:
    2525 *      Fist run this file's main method to collect epsg codes and bounds data.
     
    4646        }
    4747    }
    48  
     48
    4949    @Test
    5050    public void test() throws IOException, FileNotFoundException {
    5151        try (BufferedReader in = new BufferedReader(new InputStreamReader(
    52                 new FileInputStream("data_nodist/projection-reference-data.csv"), Utils.UTF_8))) {
     52                new FileInputStream("data_nodist/projection-reference-data.csv"), StandardCharsets.UTF_8))) {
    5353            StringBuilder fail = new StringBuilder();
    5454            String line;
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java

    r7081 r7082  
    1111import java.io.InputStreamReader;
    1212import java.io.OutputStreamWriter;
     13import java.nio.charset.StandardCharsets;
    1314import java.util.ArrayList;
    1415import java.util.Collection;
     
    3031import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
    3132import org.openstreetmap.josm.tools.Pair;
    32 import org.openstreetmap.josm.tools.Utils;
    3333
    3434/**
     
    8989
    9090        Random rand = new Random();
    91         try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(PROJECTION_DATA_FILE), Utils.UTF_8))) {
     91        try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(PROJECTION_DATA_FILE), StandardCharsets.UTF_8))) {
    9292            out.write("# Data for test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java\n");
    9393            out.write("# Format: 1. Projection code; 2. lat/lon; 3. lat/lon projected -> east/north; 4. east/north (3.) inverse projected\n");
     
    112112
    113113    private static List<TestData> readData() throws IOException, FileNotFoundException {
    114         try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(PROJECTION_DATA_FILE), Utils.UTF_8))) {
     114        try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(PROJECTION_DATA_FILE), StandardCharsets.UTF_8))) {
    115115            List<TestData> result = new ArrayList<>();
    116116            String line;
  • trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/RemoteControlTest.java

    r7081 r7082  
    1212import java.net.MalformedURLException;
    1313import java.net.URL;
     14import java.nio.charset.StandardCharsets;
    1415import java.security.GeneralSecurityException;
    1516import java.security.SecureRandom;
     
    2829import org.openstreetmap.josm.JOSMFixture;
    2930import org.openstreetmap.josm.Main;
    30 import org.openstreetmap.josm.tools.Utils;
    3131
    3232/**
     
    125125            // TODO this code should be refactored somewhere in Utils as it is used in several JOSM classes
    126126            StringBuilder responseBody = new StringBuilder();
    127             try (BufferedReader in = new BufferedReader(new InputStreamReader(is, Utils.UTF_8))) {
     127            try (BufferedReader in = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
    128128                String s;
    129129                while((s = in.readLine()) != null) {
  • trunk/test/unit/org/openstreetmap/josm/tools/BugReportExceptionHandlerTest.java

    r7081 r7082  
    77import java.io.ByteArrayInputStream;
    88import java.io.IOException;
     9import java.nio.charset.StandardCharsets;
    910import java.util.zip.GZIPInputStream;
    1011
     
    4950            StringBuilder sb = new StringBuilder();
    5051            for (int n = is.read(buff); n > 0; n = is.read(buff)) {
    51                 sb.append(new String(buff, 0, n, Utils.UTF_8));
     52                sb.append(new String(buff, 0, n, StandardCharsets.UTF_8));
    5253            }
    5354            assertEquals(report, sb.toString());
Note: See TracChangeset for help on using the changeset viewer.