diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2014-03-14 22:13:57 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2014-03-14 22:13:57 +0100 |
commit | beaaed4bc33977b4c61013a553563758eeff35c4 (patch) | |
tree | c59a8b972c34bde84a69895acde9d34fda73949a /sonar-testing-harness | |
parent | 9509868d743145761211e1ce74c26f01057cc67f (diff) | |
download | sonarqube-beaaed4bc33977b4c61013a553563758eeff35c4.tar.gz sonarqube-beaaed4bc33977b4c61013a553563758eeff35c4.zip |
SONAR-5128 Package a release version of sonar-channel
Diffstat (limited to 'sonar-testing-harness')
-rw-r--r-- | sonar-testing-harness/pom.xml | 1 | ||||
-rw-r--r-- | sonar-testing-harness/src/test/java/org/sonar/test/channel/ChannelMatchersTest.java | 63 |
2 files changed, 0 insertions, 64 deletions
diff --git a/sonar-testing-harness/pom.xml b/sonar-testing-harness/pom.xml index 5dccfccba8d..61daf832f03 100644 --- a/sonar-testing-harness/pom.xml +++ b/sonar-testing-harness/pom.xml @@ -36,7 +36,6 @@ <!-- used only for org.sonar.test.channel classes --> <groupId>org.codehaus.sonar</groupId> <artifactId>sonar-channel</artifactId> - <version>${project.version}</version> <optional>true</optional> </dependency> <dependency> diff --git a/sonar-testing-harness/src/test/java/org/sonar/test/channel/ChannelMatchersTest.java b/sonar-testing-harness/src/test/java/org/sonar/test/channel/ChannelMatchersTest.java deleted file mode 100644 index d7a0a374952..00000000000 --- a/sonar-testing-harness/src/test/java/org/sonar/test/channel/ChannelMatchersTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.test.channel; - -import static org.hamcrest.Matchers.not; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; -import static org.sonar.test.channel.ChannelMatchers.consume; -import static org.sonar.test.channel.ChannelMatchers.hasNextChar; - -import org.junit.Test; -import org.sonar.channel.Channel; -import org.sonar.channel.CodeReader; - -public class ChannelMatchersTest { - - @Test - public void testConsumeMatcher() { - Channel<StringBuilder> numberChannel = new Channel<StringBuilder>() { - - @Override - public boolean consume(CodeReader code, StringBuilder output) { - if (Character.isDigit(code.peek())) { - output.append((char) code.pop()); - return true; - } - return false; - } - }; - StringBuilder output = new StringBuilder(); - assertThat(numberChannel, consume("3", output)); - assertThat(output.toString(), is("3")); - assertThat(numberChannel, consume(new CodeReader("333333"), output)); - - output = new StringBuilder(); - assertThat(numberChannel, not(consume("n", output))); - assertThat(output.toString(), is("")); - assertThat(numberChannel, not(consume(new CodeReader("n"), output))); - } - - @Test - public void testHasNextChar() { - assertThat(new CodeReader("123"), hasNextChar('1')); - assertThat(new CodeReader("123"), not(hasNextChar('n'))); - } -} |