Skip to content

Commit 9f7b21a

Browse files
committed
fixed test under java 6
1 parent 78ab50f commit 9f7b21a

File tree

4 files changed

+39
-23
lines changed

4 files changed

+39
-23
lines changed

pom.xml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
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>
@@ -201,25 +201,6 @@
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>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}

src/test/java/com/igormaznitsa/jbbp/it/ConvertToJSONTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
import java.io.InputStream;
2626

27+
import static org.junit.Assert.assertTrue;
28+
2729
public 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
}

src/test/resources/com/igormaznitsa/jbbp/it/pnginjson.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)