aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src/test
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-01-31 01:11:24 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-01-31 01:13:14 +0100
commit4daa310730284a784548d8b7857a530ff24cc702 (patch)
tree58f28a4a67f76fdba537d7facf4dc19a33ff5104 /sonar-batch/src/test
parentcffdb0bdd4c32f5eec12d44a551b73c8fabb6b37 (diff)
downloadsonarqube-4daa310730284a784548d8b7857a530ff24cc702.tar.gz
sonarqube-4daa310730284a784548d8b7857a530ff24cc702.zip
Add profile to check copyright headers + fix some badly formatted headers
Diffstat (limited to 'sonar-batch/src/test')
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/AbstractMavenPluginExecutorTest.java19
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/BatchTest.java19
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/DefaultTimeMachineTest.java113
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/components/PastViolationsLoaderTest.java19
4 files changed, 57 insertions, 113 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/AbstractMavenPluginExecutorTest.java b/sonar-batch/src/test/java/org/sonar/batch/AbstractMavenPluginExecutorTest.java
index e86516f0284..b105143ed97 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/AbstractMavenPluginExecutorTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/AbstractMavenPluginExecutorTest.java
@@ -1,3 +1,22 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * 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.batch;
import org.junit.Test;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/BatchTest.java b/sonar-batch/src/test/java/org/sonar/batch/BatchTest.java
index 9f5fbb7a7b0..2bf84aa767c 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/BatchTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/BatchTest.java
@@ -1,3 +1,22 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * 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.batch;
import org.junit.Test;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/DefaultTimeMachineTest.java b/sonar-batch/src/test/java/org/sonar/batch/DefaultTimeMachineTest.java
deleted file mode 100644
index 4c7cf4b78b6..00000000000
--- a/sonar-batch/src/test/java/org/sonar/batch/DefaultTimeMachineTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-///*
-// * Sonar, open source software quality management tool.
-// * Copyright (C) 2009 SonarSource SA
-// * 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.batch;
-//
-//import org.junit.Test;
-//import org.sonar.api.batch.TimeMachineQuery;
-//import org.sonar.jpa.dao.MeasuresDao;
-//import org.sonar.jpa.test.AbstractDbUnitTestCase;
-//import org.sonar.api.measures.CoreMetrics;
-//import org.sonar.api.measures.Measure;
-//import org.sonar.api.resources.Project;
-//import org.sonar.api.resources.Resource;
-//import org.sonar.batch.indexer.DefaultSonarIndex;
-//
-//import java.text.ParseException;
-//import java.text.SimpleDateFormat;
-//import java.util.Arrays;
-//import java.util.Date;
-//import java.util.List;
-//
-//import static org.hamcrest.CoreMatchers.is;
-//import static org.hamcrest.number.OrderingComparisons.greaterThan;
-//import static org.junit.Assert.assertThat;
-//import static org.mockito.Matchers.anyObject;
-//import static org.mockito.Mockito.mock;
-//import static org.mockito.Mockito.when;
-//
-//public class DefaultTimeMachineTest extends AbstractDbUnitTestCase {
-//
-// @Test(timeout = 3000)
-// public void loadMeasureFieldsFromDate() throws ParseException {
-// setupData("loadMeasuresFromDate");
-// DefaultTimeMachine timeMachine = initTimeMachine();
-//
-// TimeMachineQuery query = new TimeMachineQuery(newProject()).setFrom(date("2008-02-01")).setMetrics(Arrays.asList(CoreMetrics.NCLOC));
-// List<Object[]> measures = timeMachine.getMeasuresFields(query);
-//
-// assertThat(measures.size(), is(3));
-// for (Object[] measure : measures) {
-// assertThat(measure.length, is(3)); // 3 fields
-// assertThat(measure[1], is((Object) CoreMetrics.NCLOC));
-// }
-// assertThat(measures.get(0)[2], is((Object) 200d));
-// assertThat(measures.get(1)[2], is((Object) 230d));
-// assertThat(measures.get(2)[2], is((Object) 180d));
-// }
-//
-// private DefaultTimeMachine initTimeMachine() {
-// DefaultSonarIndex index = mock(DefaultSonarIndex.class);
-// DefaultTimeMachine timeMachine = new DefaultTimeMachine(getSession(), index, new MeasuresDao(getSession()));
-// return timeMachine;
-// }
-//
-// private Project newProject() {
-// Project project = new Project("group:artifact");
-// project.setId(1);
-// return project;
-// }
-//
-// @Test(timeout = 3000)
-// public void loadMeasuresFromDate() throws ParseException {
-// setupData("loadMeasuresFromDate");
-// DefaultTimeMachine timeMachine = initTimeMachine();
-//
-//
-// TimeMachineQuery query = new TimeMachineQuery(newProject()).setFrom(date("2008-02-01")).setMetrics(Arrays.asList(CoreMetrics.NCLOC));
-// List<Measure> measures = timeMachine.getMeasures(query);
-//
-// assertThat(measures.size(), is(3));
-// long previous = 0;
-// for (Measure measure : measures) {
-// assertThat(measure.getMetric(), is(CoreMetrics.NCLOC));
-// assertThat(measure.getDate().getTime(), greaterThan(previous));
-// previous = measure.getDate().getTime();
-// }
-// assertThat(measures.get(0).getValue(), is(200d));
-// assertThat(measures.get(1).getValue(), is(230d));
-// assertThat(measures.get(2).getValue(), is(180d));
-// }
-//
-// @Test(timeout = 3000)
-// public void loadMeasuresFromDateInterval() throws ParseException {
-// setupData("loadMeasuresFromDate");
-// DefaultTimeMachine timeMachine = initTimeMachine();
-//
-//
-// TimeMachineQuery query = new TimeMachineQuery(newProject()).setFrom(date("2008-01-01")).setTo(date("2008-12-25")).setMetrics(Arrays.asList(CoreMetrics.NCLOC));
-// List<Measure> measures = timeMachine.getMeasures(query);
-// assertThat(measures.size(), is(1));
-// assertThat(measures.get(0).getValue(), is(200d));
-// }
-//
-// private Date date(String date) throws ParseException {
-// return new SimpleDateFormat("yyyy-MM-dd").parse(date);
-// }
-//}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/components/PastViolationsLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/components/PastViolationsLoaderTest.java
index bbc35b4b878..e37fc09523e 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/components/PastViolationsLoaderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/components/PastViolationsLoaderTest.java
@@ -1,3 +1,22 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * 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.batch.components;
import org.junit.Before;