diff options
author | Jenkins CI <ci@sonarsource.com> | 2015-10-15 08:01:21 +0200 |
---|---|---|
committer | Jenkins CI <ci@sonarsource.com> | 2015-10-15 08:01:21 +0200 |
commit | 6715e390eaf99945c22cf716083631f0f41078e7 (patch) | |
tree | a02afe673e0c3b82a31f0ae1017d30f755537ad7 /sonar-core | |
parent | fce2babd2602ee29558194096ceea3bdbfe8f590 (diff) | |
parent | a11430d1a90edb78e72785d827eb9ed884b44eff (diff) | |
download | sonarqube-6715e390eaf99945c22cf716083631f0f41078e7.tar.gz sonarqube-6715e390eaf99945c22cf716083631f0f41078e7.zip |
Automatic merge from branch-5.2
* origin/branch-5.2:
Add missing tests
Add ES circuit breaker stats to System Info page
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/platform/PluginClassLoaderDefTest.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/platform/PluginClassLoaderDefTest.java b/sonar-core/src/test/java/org/sonar/core/platform/PluginClassLoaderDefTest.java new file mode 100644 index 00000000000..3063f048624 --- /dev/null +++ b/sonar-core/src/test/java/org/sonar/core/platform/PluginClassLoaderDefTest.java @@ -0,0 +1,43 @@ +/* + * 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.core.platform; + +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class PluginClassLoaderDefTest { + + @Test + public void test_equals_and_hashCode() { + PluginClassLoaderDef one = new PluginClassLoaderDef("one"); + PluginClassLoaderDef oneBis = new PluginClassLoaderDef("one"); + PluginClassLoaderDef two = new PluginClassLoaderDef("two"); + + assertThat(one.equals(one)).isTrue(); + assertThat(one.equals(oneBis)).isTrue(); + assertThat(one.hashCode()).isEqualTo(one.hashCode()); + assertThat(one.hashCode()).isEqualTo(oneBis.hashCode()); + + assertThat(one.equals(two)).isFalse(); + assertThat(one.equals("one")).isFalse(); + assertThat(one.equals(null)).isFalse(); + } +} |