-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #601 from renekrie/issue600
Avoid InvalidPathException in RelationalOperator, fixes #600
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
json-path/src/test/java/com/jayway/jsonpath/internal/filter/RelationalOperatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.jayway.jsonpath.internal.filter; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import java.util.Locale; | ||
|
||
public class RelationalOperatorTest { | ||
|
||
Locale locale; | ||
|
||
@Before | ||
public void saveDefaultLocale() { | ||
locale = Locale.getDefault(); | ||
} | ||
|
||
@After | ||
public void restoreDefaultLocale() { | ||
Locale.setDefault(locale); | ||
} | ||
|
||
@Test | ||
public void testFromStringWithEnglishLocale() { | ||
Locale.setDefault(Locale.ENGLISH); | ||
assertEquals(RelationalOperator.IN, RelationalOperator.fromString("in")); | ||
assertEquals(RelationalOperator.IN, RelationalOperator.fromString("IN")); | ||
} | ||
|
||
@Test | ||
public void testFromStringWithTurkishLocale() { | ||
Locale.setDefault(new Locale("tr", "TR")); | ||
assertEquals(RelationalOperator.IN, RelationalOperator.fromString("in")); | ||
assertEquals(RelationalOperator.IN, RelationalOperator.fromString("IN")); | ||
} | ||
|
||
} |