|
| 1 | +/* |
| 2 | + * Copyright 2019 Philipp Salvisberg <philipp.salvisberg@trivadis.com> |
| 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 | + */ |
1 | 16 | package org.utplsql.sqldev.test;
|
2 | 17 |
|
3 |
| -import java.util.Collections; |
4 |
| -import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
| 18 | +import java.util.Arrays; |
| 19 | + |
5 | 20 | import org.junit.Assert;
|
6 | 21 | import org.junit.Test;
|
7 | 22 | import org.utplsql.sqldev.model.PrefixTools;
|
8 | 23 |
|
9 |
| -@SuppressWarnings("all") |
10 | 24 | public class PrefixToolsTest {
|
11 |
| - @Test |
12 |
| - public void two() { |
13 |
| - final String actual = PrefixTools.commonPrefix(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("junit.test.a", "junit.test.b"))); |
14 |
| - final String expected = "junit.test."; |
15 |
| - Assert.assertEquals(expected, actual); |
16 |
| - } |
17 |
| - |
18 |
| - @Test |
19 |
| - public void oneWithDot() { |
20 |
| - final String actual = PrefixTools.commonPrefix(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("junit.test.a"))); |
21 |
| - final String expected = "junit.test."; |
22 |
| - Assert.assertEquals(expected, actual); |
23 |
| - } |
24 |
| - |
25 |
| - @Test |
26 |
| - public void oneWithoutDot() { |
27 |
| - final String actual = PrefixTools.commonPrefix(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("junit-test-a"))); |
28 |
| - final String expected = ""; |
29 |
| - Assert.assertEquals(expected, actual); |
30 |
| - } |
31 |
| - |
32 |
| - @Test |
33 |
| - public void twoOverlapLeft() { |
34 |
| - final String actual = PrefixTools.commonPrefix(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("a.b.c", "a.b.c.d"))); |
35 |
| - final String expected = ""; |
36 |
| - Assert.assertEquals(expected, actual); |
37 |
| - } |
38 |
| - |
39 |
| - @Test |
40 |
| - public void twoOverlapRight() { |
41 |
| - final String actual = PrefixTools.commonPrefix(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("a.b.c.d", "a.b.c"))); |
42 |
| - final String expected = ""; |
43 |
| - Assert.assertEquals(expected, actual); |
44 |
| - } |
| 25 | + @Test |
| 26 | + public void two() { |
| 27 | + final String actual = PrefixTools.commonPrefix(Arrays.asList("junit.test.a", "junit.test.b")); |
| 28 | + final String expected = "junit.test."; |
| 29 | + Assert.assertEquals(expected, actual); |
| 30 | + } |
| 31 | + |
| 32 | + @Test |
| 33 | + public void oneWithDot() { |
| 34 | + final String actual = PrefixTools.commonPrefix(Arrays.asList("junit.test.a")); |
| 35 | + final String expected = "junit.test."; |
| 36 | + Assert.assertEquals(expected, actual); |
| 37 | + } |
| 38 | + |
| 39 | + @Test |
| 40 | + public void oneWithoutDot() { |
| 41 | + final String actual = PrefixTools.commonPrefix(Arrays.asList("junit-test-a")); |
| 42 | + final String expected = ""; |
| 43 | + Assert.assertEquals(expected, actual); |
| 44 | + } |
| 45 | + |
| 46 | + @Test |
| 47 | + public void twoOverlapLeft() { |
| 48 | + final String actual = PrefixTools.commonPrefix(Arrays.asList("a.b.c", "a.b.c.d")); |
| 49 | + final String expected = ""; |
| 50 | + Assert.assertEquals(expected, actual); |
| 51 | + } |
| 52 | + |
| 53 | + @Test |
| 54 | + public void twoOverlapRight() { |
| 55 | + final String actual = PrefixTools.commonPrefix(Arrays.asList("a.b.c.d", "a.b.c")); |
| 56 | + final String expected = ""; |
| 57 | + Assert.assertEquals(expected, actual); |
| 58 | + } |
45 | 59 | }
|
0 commit comments