diff options
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/test/IsResource.java | 47 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/utils/TimeProfilerTest.java | 8 |
2 files changed, 4 insertions, 51 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/test/IsResource.java b/sonar-plugin-api/src/test/java/org/sonar/api/test/IsResource.java deleted file mode 100644 index d72986ecd77..00000000000 --- a/sonar-plugin-api/src/test/java/org/sonar/api/test/IsResource.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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.api.test; - -import org.apache.commons.lang.ObjectUtils; -import org.mockito.ArgumentMatcher; -import org.sonar.api.resources.Resource; - -public class IsResource extends ArgumentMatcher<Resource> { - - private String scope; - private String qualifier; - private String key; - - public IsResource(String scope, String qualifier) { - this.scope = scope; - this.qualifier = qualifier; - } - - public IsResource(String scope, String qualifier, String key) { - this(scope, qualifier); - this.key = key; - } - - @Override - public boolean matches(Object o) { - Resource r = (Resource) o; - return ObjectUtils.equals(r.getScope(), scope) && ObjectUtils.equals(r.getQualifier(), qualifier) && r.getKey().equals(key); - } -} diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/TimeProfilerTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/TimeProfilerTest.java index ddc537947f5..71f09b96066 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/TimeProfilerTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/TimeProfilerTest.java @@ -41,7 +41,7 @@ public class TimeProfilerTest { verify(logger).info(eq("{}..."), eq("Cycle analysis")); profiler.stop(); - verify(logger).info(eq("{} done: {} ms"), eq("Cycle analysis"), anyInt()); + verify(logger).info(eq("{} done: {} ms"), eq("Cycle analysis"), anyLong()); } @Test @@ -53,7 +53,7 @@ public class TimeProfilerTest { profiler.stop(); profiler.stop(); verify(logger, times(1)).info(anyString(), anyString()); // start() executes log() with 1 parameter - verify(logger, times(1)).info(anyString(), anyString(), anyInt()); // stop() executes log() with 3 parameters + verify(logger, times(1)).info(anyString(), anyString(), anyLong()); // stop() executes log() with 3 parameters } @Test @@ -64,7 +64,7 @@ public class TimeProfilerTest { profiler.start("New task"); profiler.stop(); profiler.stop(); - verify(logger, never()).info(eq("{} done: {} ms"), eq("Cycle analysis"), anyInt()); - verify(logger, times(1)).info(eq("{} done: {} ms"), eq("New task"), anyInt()); + verify(logger, never()).info(eq("{} done: {} ms"), eq("Cycle analysis"), anyLong()); + verify(logger, times(1)).info(eq("{} done: {} ms"), eq("New task"), anyLong()); } } |