1 /* |
1 /* |
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
96 } |
96 } |
97 |
97 |
98 @Test |
98 @Test |
99 public void testDuplicates(Path base) throws Exception { |
99 public void testDuplicates(Path base) throws Exception { |
100 test(asList("java.base=a", "java.compiler=b", "java.base=c"), |
100 test(asList("java.base=a", "java.compiler=b", "java.base=c"), |
101 false, "--patch-module specified more than once for java.base"); |
101 false, "error: --patch-module specified more than once for java.base"); |
102 } |
102 } |
103 |
103 |
104 @Test |
104 @Test |
105 public void testEmpty(Path base) throws Exception { |
105 public void testEmpty(Path base) throws Exception { |
106 test(asList(""), |
106 test(asList(""), |
107 false, "no value for --patch-module option"); |
107 false, "error: no value for --patch-module option"); |
108 } |
108 } |
109 |
109 |
110 @Test |
110 @Test |
111 public void testInvalid(Path base) throws Exception { |
111 public void testInvalid(Path base) throws Exception { |
112 test(asList("java.base/java.lang=."), |
112 test(asList("java.base/java.lang=."), |
113 false, "bad value for --patch-module option: 'java.base/java.lang=.'"); |
113 false, "error: bad value for --patch-module option: 'java.base/java.lang=.'"); |
114 } |
114 } |
115 |
115 |
116 void test(List<String> patches, String expect) throws Exception { |
116 void test(List<String> patches, String expect) throws Exception { |
117 test(patches, true, expect); |
117 test(patches, true, expect); |
118 } |
118 } |