com.alibaba.dubbo.common.io.UnsafeStringReader Java Examples
The following examples show how to use
com.alibaba.dubbo.common.io.UnsafeStringReader.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JSONReaderTest.java From dubbo-2.6.5 with Apache License 2.0 | 6 votes |
public void testMain() throws Exception { String json = "{ name: 'name', friends: [ 1, null, 3.2, ] }"; JSONReader reader = new JSONReader(new UnsafeStringReader(json)); assertEquals(reader.nextToken().type, JSONToken.LBRACE); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.STRING); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.LSQUARE); assertEquals(reader.nextToken().type, JSONToken.INT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.NULL); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.FLOAT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.RSQUARE); assertEquals(reader.nextToken().type, JSONToken.RBRACE); }
Example #2
Source File: JSONReaderTest.java From dubbox with Apache License 2.0 | 6 votes |
public void testMain() throws Exception { String json = "{ name: 'name', friends: [ 1, null, 3.2, ] }"; JSONReader reader = new JSONReader(new UnsafeStringReader(json)); assertEquals(reader.nextToken().type, JSONToken.LBRACE); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.STRING); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.LSQUARE); assertEquals(reader.nextToken().type, JSONToken.INT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.NULL); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.FLOAT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.RSQUARE); assertEquals(reader.nextToken().type, JSONToken.RBRACE); }
Example #3
Source File: JSONReaderTest.java From dubbox-hystrix with Apache License 2.0 | 6 votes |
public void testMain() throws Exception { String json = "{ name: 'name', friends: [ 1, null, 3.2, ] }"; JSONReader reader = new JSONReader(new UnsafeStringReader(json)); assertEquals(reader.nextToken().type, JSONToken.LBRACE); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.STRING); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.LSQUARE); assertEquals(reader.nextToken().type, JSONToken.INT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.NULL); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.FLOAT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.RSQUARE); assertEquals(reader.nextToken().type, JSONToken.RBRACE); }
Example #4
Source File: JSONReaderTest.java From dubbo3 with Apache License 2.0 | 6 votes |
public void testMain() throws Exception { String json = "{ name: 'name', friends: [ 1, null, 3.2, ] }"; JSONReader reader = new JSONReader(new UnsafeStringReader(json)); assertEquals(reader.nextToken().type, JSONToken.LBRACE); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.STRING); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.LSQUARE); assertEquals(reader.nextToken().type, JSONToken.INT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.NULL); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.FLOAT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.RSQUARE); assertEquals(reader.nextToken().type, JSONToken.RBRACE); }
Example #5
Source File: JSONReaderTest.java From dubbox with Apache License 2.0 | 6 votes |
public void testMain() throws Exception { String json = "{ name: 'name', friends: [ 1, null, 3.2, ] }"; JSONReader reader = new JSONReader(new UnsafeStringReader(json)); assertEquals(reader.nextToken().type, JSONToken.LBRACE); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.STRING); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.LSQUARE); assertEquals(reader.nextToken().type, JSONToken.INT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.NULL); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.FLOAT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.RSQUARE); assertEquals(reader.nextToken().type, JSONToken.RBRACE); }
Example #6
Source File: JSONReaderTest.java From dubbox with Apache License 2.0 | 6 votes |
public void testMain() throws Exception { String json = "{ name: 'name', friends: [ 1, null, 3.2, ] }"; JSONReader reader = new JSONReader(new UnsafeStringReader(json)); assertEquals(reader.nextToken().type, JSONToken.LBRACE); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.STRING); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.IDENT); assertEquals(reader.nextToken().type, JSONToken.COLON); assertEquals(reader.nextToken().type, JSONToken.LSQUARE); assertEquals(reader.nextToken().type, JSONToken.INT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.NULL); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.FLOAT); assertEquals(reader.nextToken().type, JSONToken.COMMA); assertEquals(reader.nextToken().type, JSONToken.RSQUARE); assertEquals(reader.nextToken().type, JSONToken.RBRACE); }