File tree Expand file tree Collapse file tree 4 files changed +39
-23
lines changed
main/java/com/igormaznitsa/jbbp/utils
java/com/igormaznitsa/jbbp/it
resources/com/igormaznitsa/jbbp/it Expand file tree Collapse file tree 4 files changed +39
-23
lines changed Original file line number Diff line number Diff line change 7777 <dependency >
7878 <groupId >net.minidev</groupId >
7979 <artifactId >json-smart</artifactId >
80- <version >2.1.1 </version >
80+ <version >2.3 </version >
8181 <scope >test</scope >
8282 </dependency >
8383 <dependency >
201201
202202 <build >
203203 <plugins >
204- <plugin >
205- <groupId >org.codehaus.mojo</groupId >
206- <artifactId >build-helper-maven-plugin</artifactId >
207- <version >3.0.0</version >
208- <executions >
209- <execution >
210- <id >count-cpu-cores</id >
211- <phase >initialize</phase >
212- <goals >
213- <goal >cpu-count</goal >
214- </goals >
215- <configuration >
216- <sources >
217- <source >some directory</source >
218- </sources >
219- </configuration >
220- </execution >
221- </executions >
222- </plugin >
223204 <plugin >
224205 <groupId >org.apache.maven.plugins</groupId >
225206 <artifactId >maven-compiler-plugin</artifactId >
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2017 Igor Maznitsa.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com .igormaznitsa .jbbp .utils ;
18+
19+ /**
20+ * Allowed sourcws for source generation in JBBPParser
21+ * @see com.igormaznitsa.jbbp.JBBPParser#convertToSrc(TargetSources, String)
22+ * @since 1.3.0
23+ */
24+ public enum TargetSources {
25+ /**
26+ * Java 1.6 sources.
27+ */
28+ JAVA_1_6
29+ }
Original file line number Diff line number Diff line change 2424
2525import java .io .InputStream ;
2626
27+ import static org .junit .Assert .assertTrue ;
28+
2729public class ConvertToJSONTest extends AbstractParserIntegrationTest {
2830
2931 public static JSONObject convertToJSon (final JSONObject jsn , final JBBPAbstractField field ) {
@@ -126,8 +128,13 @@ public void testConvertToJSON() throws Exception {
126128
127129 final JSONObject json = convertToJSon (null , pngParser .parse (pngStream ));
128130 final String jsonText = json .toJSONString (JSONStyle .MAX_COMPRESS );
129- System .out .println (jsonText );
130- assertFile ("pnginjson.txt" , jsonText );
131+ assertTrue (jsonText .length () == 13917 );
132+ assertTrue (jsonText .contains ("header:" ));
133+ assertTrue (jsonText .contains ("chunk:{" ));
134+ assertTrue (jsonText .contains ("length:" ));
135+ assertTrue (jsonText .contains ("type:" ));
136+ assertTrue (jsonText .contains ("data:" ));
137+ assertTrue (jsonText .contains ("crc:" ));
131138 } finally {
132139 pngStream .close ();
133140 }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments