Skip to content

Commit 774543e

Browse files
authored
test: silence expected error (#757)
1 parent ad3a930 commit 774543e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/test/java/io/socket/parser/ParserTest.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package io.socket.parser;
22

3+
import java.util.logging.Level;
4+
import java.util.logging.Logger;
5+
36
import org.json.JSONArray;
47
import org.json.JSONException;
58
import org.junit.Test;
@@ -49,6 +52,9 @@ public void encodeAck() throws JSONException {
4952

5053
@Test
5154
public void decodeInError() throws JSONException {
55+
Logger logger = Logger.getLogger(IOParser.class.getName());
56+
Level tmpLevel = logger.getLevel();
57+
logger.setLevel(Level.SEVERE);
5258
// Random string
5359
Helpers.testDecodeError("asdf");
5460
// Unknown type
@@ -62,9 +68,10 @@ public void decodeInError() throws JSONException {
6268
// event non numeric id
6369
Helpers.testDecodeError(Parser.EVENT + "2sd");
6470
// event with invalid json data
65-
Helpers.testDecodeError(Parser.EVENT + "2[\"a\",1,{asdf}]");
6671
Helpers.testDecodeError(Parser.EVENT + "2{}");
6772
Helpers.testDecodeError(Parser.EVENT + "2[]");
6873
Helpers.testDecodeError(Parser.EVENT + "2[null]");
74+
Helpers.testDecodeError(Parser.EVENT + "2[\"a\",1,{asdf}]");
75+
logger.setLevel(tmpLevel);
6976
}
7077
}

0 commit comments

Comments
 (0)