|
25 | 25 | import static org.junit.Assert.assertThat;
|
26 | 26 | import static org.junit.Assert.fail;
|
27 | 27 |
|
28 |
| -import java.io.UnsupportedEncodingException; |
29 | 28 | import java.math.BigInteger;
|
30 |
| -import java.nio.charset.Charset; |
31 | 29 | import java.util.Date;
|
32 | 30 |
|
33 | 31 | import org.junit.Test;
|
34 | 32 |
|
| 33 | +import com.arangodb.ArangoDB; |
35 | 34 | import com.arangodb.velocypack.exception.VPackBuilderNeedOpenCompoundException;
|
36 | 35 | import com.arangodb.velocypack.exception.VPackBuilderNumberOutOfRangeException;
|
37 | 36 | import com.arangodb.velocypack.exception.VPackBuilderUnexpectedValueException;
|
@@ -955,4 +954,25 @@ public void objectWithByteSizeOver65536() {
|
955 | 954 | assertThat(vpack.get(foo).get(bar2).getLength(), is(0));
|
956 | 955 | }
|
957 | 956 |
|
| 957 | + @Test |
| 958 | + public void bytelength() { |
| 959 | + final String name1 = "{\"name1\":\"job_04_detail_1\",\"seven__\":\"123456789\",\"_key\":\"191d936d-1eb9-4094-9c1c-9e0ba1d01867\",\"lang\":\"it\",\"value\":\"[CTO]\\n Ha supervisionato e gestito il reparto di R&D per il software, 1234567 formulando una visione di lungo periodo con la Direzione dell'Azienda.\"}"; |
| 960 | + final String name = "{\"name\":\"job_04_detail_1\",\"seven__\":\"123456789\",\"_key\":\"191d936d-1eb9-4094-9c1c-9e0ba1d01867\",\"lang\":\"it\",\"value\":\"[CTO]\\n Ha supervisionato e gestito il reparto di R&D per il software, 1234567 formulando una visione di lungo periodo con la Direzione dell'Azienda.\"}"; |
| 961 | + |
| 962 | + final ArangoDB arangoDB = new ArangoDB.Builder().build(); |
| 963 | + { |
| 964 | + final VPackSlice vpack = arangoDB.util().serialize(name1); |
| 965 | + assertThat(vpack.isObject(), is(true)); |
| 966 | + assertThat(vpack.get("name1").isString(), is(true)); |
| 967 | + assertThat(vpack.get("name1").getAsString(), is("job_04_detail_1")); |
| 968 | + |
| 969 | + } |
| 970 | + { |
| 971 | + final VPackSlice vpack = arangoDB.util().serialize(name); |
| 972 | + assertThat(vpack.isObject(), is(true)); |
| 973 | + assertThat(vpack.get("name").isString(), is(true)); |
| 974 | + assertThat(vpack.get("name").getAsString(), is("job_04_detail_1")); |
| 975 | + } |
| 976 | + } |
| 977 | + |
958 | 978 | }
|
0 commit comments