(String[] args)
| 18 | |
| 19 | public class ShowCase { |
| 20 | public static void main(String[] args) { |
| 21 | List<Pair<String, String>> caseList = getCaseList(); |
| 22 | for (int index = 0; index < caseList.size(); index++) { |
| 23 | List<String> noiseList = Lists.newArrayList(); |
| 24 | List<String> noiseList1 = Lists.newArrayList("msg", "cost"); |
| 25 | List<String> noiseList2 = Lists.newArrayList("msg", "cost", "a.b"); |
| 26 | noiseList.addAll(noiseList1); |
| 27 | noiseList.addAll(noiseList2); |
| 28 | System.out.println("*************************"); |
| 29 | System.out.println("case[" + index + "] result is "); |
| 30 | LinkedList<String> specialPath = new LinkedList<>(); |
| 31 | //第一种diff方法 详细使用方法见README.md文件 |
| 32 | List<Result> diff1 = new Diff().diff(caseList.get(index).getLeft(), caseList.get(index).getRight()); |
| 33 | //第二种diff方法 详细使用方法见README.md文件 |
| 34 | List<Result> diff2 = new Diff().withNoisePahList(noiseList).withSpecialPath(specialPath).withAlgorithmEnum(AlgorithmEnum.DEFAULT).diff(caseList.get(index).getLeft(), caseList.get(index).getRight()); |
| 35 | System.out.println("left is : " + caseList.get(index).getLeft()); |
| 36 | System.out.println("right is : " + caseList.get(index).getRight()); |
| 37 | System.out.println("result is : " + new Gson().toJson(diff1)); |
| 38 | System.out.println("result is : " + new Gson().toJson(diff2)); |
| 39 | |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | |
| 44 | private static List<Pair<String, String>> getCaseList() { |
nothing calls this directly
no test coverage detected