Skip to content
Browse files

Change source and target version from 1.6 to 1.7.

Change maven-compiler-plugin source and target from 1.6 to 1.7. Make changes to
the source code according to this:
 - BsonDocumentsTest: remove HashMap<K,V> declarations as Java 7 doesn't
   requires it.
 - DefaultRegularExpressionReaderWriterTest: uncomment a test block which
   referenced the UNICODE_CHARACTER_CLASS static int (from Pattern). The code
   that was previously commented out stayed in the code base in case the source
   and target changes to 1.7. The referencing test case is ignored, because
   this regular expression options isn't supported.
  • Loading branch information...
1 parent 3f60102 commit a55cb544cc2364d14571a8631e40c3810fcae0ee @kohanyirobert committed
View
4 pom.xml
@@ -97,8 +97,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
</plugin>
<plugin>
View
20 src/test/java/com/github/kohanyirobert/ebson/BsonDocumentsTest.java
@@ -8,7 +8,6 @@
import org.junit.Test;
-import java.util.HashMap;
import java.util.Map;
@SuppressWarnings("static-method")
@@ -42,10 +41,11 @@ public void copyOf_document_withNullDocument() {
@Test
public void copyOf_map_withLegalKeys() {
- Map<String, Object> map = new HashMap<String, Object>();
- map.put(KEY1, null);
- map.put(KEY2, null);
- map.put(KEY3, null);
+ Map<String, Object> map = BsonDocuments.builder()
+ .put(KEY1, null)
+ .put(KEY2, null)
+ .put(KEY3, null)
+ .build();
BsonDocument document = BsonDocuments.copyOf(map);
assertArrayEquals(map.keySet().toArray(), document.keySet().toArray());
assertArrayEquals(map.values().toArray(), document.values().toArray());
@@ -58,11 +58,11 @@ public void copyOf_map_withNullMap() {
@Test(expected = NullPointerException.class)
public void copyOf_map_withNullKey() {
- Map<String, Object> map = new HashMap<String, Object>();
- map.put(KEY1, null);
- map.put(KEY2, null);
- map.put(null, null);
- BsonDocuments.copyOf(map);
+ BsonDocuments.copyOf(BsonDocuments.builder()
+ .put(KEY1, null)
+ .put(KEY2, null)
+ .put(null, null)
+ .build());
}
@Test
View
13 src/test/java/com/github/kohanyirobert/ebson/DefaultRegularExpressionReaderWriterTest.java
@@ -12,6 +12,7 @@
import static java.util.regex.Pattern.LITERAL;
import static java.util.regex.Pattern.MULTILINE;
import static java.util.regex.Pattern.UNICODE_CASE;
+import static java.util.regex.Pattern.UNICODE_CHARACTER_CLASS;
import static java.util.regex.Pattern.UNIX_LINES;
import static java.util.regex.Pattern.compile;
@@ -71,13 +72,11 @@ public void unicodeCaseFlag() {
assertPatternEquals(writeTo(compile("", UNICODE_CASE)), readFrom());
}
- // @formatter:off
- // @Ignore("the 'UNICODE_CHARACTER_CLASS' flag isn't supported")
- // @Test
- // public void unicodeCharacterClassFlag() {
- // assertPatternEquals(writeTo(compile("", UNICODE_CHARACTER_CLASS)), readFrom());
- // }
- // @formatter:on
+ @Ignore("the 'UNICODE_CHARACTER_CLASS' flag isn't supported")
+ @Test
+ public void unicodeCharacterClassFlag() {
+ assertPatternEquals(writeTo(compile("", UNICODE_CHARACTER_CLASS)), readFrom());
+ }
@Ignore("the 'UNIX_LINES' flag isn't supported")
@Test

0 comments on commit a55cb54

Please sign in to comment.
Something went wrong with that request. Please try again.