diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-06-20 00:47:19 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-06-20 00:47:48 +0200 |
commit | 867d184f3f44f87a1f2941621d0fd4cd891b3bb5 (patch) | |
tree | b1edc954ad51c16ae4bf473653885a152c055607 /sonar-core | |
parent | 95eabd8a0a1b89c319f3e05cc163b88cc561f00d (diff) | |
download | sonarqube-867d184f3f44f87a1f2941621d0fd4cd891b3bb5.tar.gz sonarqube-867d184f3f44f87a1f2941621d0fd4cd891b3bb5.zip |
SONAR-5007 automatic test of beans (through reflection)
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ChangeLogTest.java | 37 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ProfileMeasureTest.java | 10 |
2 files changed, 42 insertions, 5 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ChangeLogTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ChangeLogTest.java new file mode 100644 index 00000000000..092c4ccf9a5 --- /dev/null +++ b/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ChangeLogTest.java @@ -0,0 +1,37 @@ +/* + * 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.persistence.migration.v44; + +import org.junit.Test; + +import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor; +import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.allOf; + +public class ChangeLogTest { + + @Test + public void test_bean() throws Exception { + assertThat(ChangeLog.class, allOf( + hasValidBeanConstructor(), + hasValidGettersAndSetters())); + } +} diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ProfileMeasureTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ProfileMeasureTest.java index 9e315051569..b2fc695bc9f 100644 --- a/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ProfileMeasureTest.java +++ b/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ProfileMeasureTest.java @@ -21,17 +21,17 @@ package org.sonar.core.persistence.migration.v44; import org.junit.Test; -import static com.google.code.beanmatchers.BeanMatchers.*; -import static org.hamcrest.Matchers.allOf; +import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanConstructor; +import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.allOf; public class ProfileMeasureTest { @Test - public void getId() throws Exception { + public void test_bean() throws Exception { assertThat(ProfileMeasure.class, allOf( hasValidBeanConstructor(), - hasValidGettersAndSetters() - )); + hasValidGettersAndSetters())); } } |