From df62fc28559228713caf3382183556d4c41e5647 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Fri, 21 Oct 2011 14:22:52 +0400 Subject: SONAR-2632 Remove sonar-channel buffer restriction * Add test for backward compatibility with a COBOL plugin * Fix violations * Simplify code --- .../org/sonar/duplications/token/TokenChunker.java | 2 +- .../sonar/duplications/token/TokenChunkerTest.java | 46 ---------------------- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 sonar-duplications/src/test/java/org/sonar/duplications/token/TokenChunkerTest.java (limited to 'sonar-duplications') diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/token/TokenChunker.java b/sonar-duplications/src/main/java/org/sonar/duplications/token/TokenChunker.java index ef5c0522dbb..d946811dacc 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/token/TokenChunker.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/token/TokenChunker.java @@ -21,9 +21,9 @@ package org.sonar.duplications.token; import java.io.Reader; import java.io.StringReader; + import org.sonar.channel.ChannelDispatcher; import org.sonar.channel.CodeReader; -import org.sonar.channel.CodeReaderConfiguration; import org.sonar.duplications.DuplicationsException; public final class TokenChunker { diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/token/TokenChunkerTest.java b/sonar-duplications/src/test/java/org/sonar/duplications/token/TokenChunkerTest.java deleted file mode 100644 index d9a421ac4d0..00000000000 --- a/sonar-duplications/src/test/java/org/sonar/duplications/token/TokenChunkerTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2011 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar 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. - * - * Sonar 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 Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.duplications.token; - -import org.junit.Test; - -public class TokenChunkerTest { - - /** - * In fact this test does not guarantee that we will be able to consume even more great comments, - * because {@link org.sonar.channel.CodeBuffer} does not expand dynamically - see issue SONAR-2632. - * But at least guarantees that we able to consume source files from JDK 1.6, - * because buffer capacity has been increased in comparison with default value, - * which is {@link org.sonar.channel.CodeReaderConfiguration#DEFAULT_BUFFER_CAPACITY}. - */ - @Test(timeout = 5000) - public void shouldConsumeBigComments() { - int capacity = 80000; - StringBuilder sb = new StringBuilder(capacity); - sb.append("/"); - for (int i = 3; i < capacity; i++) { - sb.append('*'); - } - sb.append("/"); - TokenChunker chunker = TokenChunker.builder().token("/.*/", "LITERAL").build(); - chunker.chunk(sb.toString()); - } - -} -- cgit v1.2.3