Changeset 13358 in josm for trunk/test/functional


Ignore:
Timestamp:
2018-01-26T23:21:57+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #15830 - Support (and autodetect) WMS 1.3.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java

    r12807 r13358  
    55import static org.hamcrest.CoreMatchers.is;
    66import static org.hamcrest.CoreMatchers.nullValue;
     7import static org.junit.Assert.assertEquals;
    78import static org.junit.Assert.assertThat;
     9import static org.junit.Assert.assertTrue;
    810
    911import java.io.BufferedReader;
     
    1517import java.util.logging.Handler;
    1618import java.util.logging.LogRecord;
     19import java.util.regex.Matcher;
    1720
    1821import javax.json.JsonObject;
     
    298301        }
    299302    }
     303
     304    /**
     305     * Test that error message sent by Tomcat can be parsed.
     306     */
     307    @Test
     308    public void testTomcatErrorMessage() {
     309        Matcher m = HttpClient.getTomcatErrorMatcher(
     310            "<html><head><title>Apache Tomcat/DGFiP - Rapport d''erreur</title><style><!--"+
     311                "H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} "+
     312                "H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} "+
     313                "H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} "+
     314                "BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} "+
     315                "B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} "+
     316                "P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}"+
     317                "A {color : black;}A.name {color : black;}HR {color : #525D76;}"+
     318            "--></style> </head><body><h1>Etat HTTP 400 - La commune demandée n'existe pas ou n'est pas accessible.</h1>"+
     319            "<HR size=\"1\" noshade=\"noshade\">"+
     320            "<p><b>type</b> Rapport d''état</p><p><b>message</b> <u>La commune demandée n'existe pas ou n'est pas accessible.</u></p>"+
     321            "<p><b>description</b> <u>La requête envoyée par le client était syntaxiquement incorrecte.</u></p>"+
     322            "<HR size=\"1\" noshade=\"noshade\"><h3>Apache Tomcat/DGFiP</h3></body></html>");
     323        assertTrue(m.matches());
     324        assertEquals("La commune demandée n'existe pas ou n'est pas accessible.", m.group(1));
     325    }
    300326}
Note: See TracChangeset for help on using the changeset viewer.