diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-02-04 10:42:21 +0100 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-02-04 10:42:21 +0100 |
commit | a14a0644c2a27ddec22f23925578a40aa6fa8302 (patch) | |
tree | aa5c078cc8ec7c4e2020960ad9a343fb7e79a16c /sonar-graph/src/test | |
parent | 0f44a42b85093a3dcef64b52f6e15337b119ec88 (diff) | |
download | sonarqube-a14a0644c2a27ddec22f23925578a40aa6fa8302.tar.gz sonarqube-a14a0644c2a27ddec22f23925578a40aa6fa8302.zip |
Upgrade copyright headers
Diffstat (limited to 'sonar-graph/src/test')
14 files changed, 94 insertions, 94 deletions
diff --git a/sonar-graph/src/test/java/org/sonar/graph/CycleDetectorTest.java b/sonar-graph/src/test/java/org/sonar/graph/CycleDetectorTest.java index dd010d64d4b..7ca0fd8747d 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/CycleDetectorTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/CycleDetectorTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/CycleTest.java b/sonar-graph/src/test/java/org/sonar/graph/CycleTest.java index a42366abbab..4b666acb4c2 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/CycleTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/CycleTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/DirectedGraphTest.java b/sonar-graph/src/test/java/org/sonar/graph/DirectedGraphTest.java index 0abcb4c9af2..3e7b9a117a1 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/DirectedGraphTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/DirectedGraphTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/DsmCellTest.java b/sonar-graph/src/test/java/org/sonar/graph/DsmCellTest.java index 12069d2dc88..24fd45df840 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/DsmCellTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/DsmCellTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/DsmManualSorterTest.java b/sonar-graph/src/test/java/org/sonar/graph/DsmManualSorterTest.java index 617abe383f6..8d57aacfc0e 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/DsmManualSorterTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/DsmManualSorterTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/DsmPrinterTest.java b/sonar-graph/src/test/java/org/sonar/graph/DsmPrinterTest.java index 55e8de64de6..40d2d22c18e 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/DsmPrinterTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/DsmPrinterTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/DsmScannerTest.java b/sonar-graph/src/test/java/org/sonar/graph/DsmScannerTest.java index 1d9df9239d4..9efb36566aa 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/DsmScannerTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/DsmScannerTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/DsmTest.java b/sonar-graph/src/test/java/org/sonar/graph/DsmTest.java index 06fbcba4160..c070457ee0c 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/DsmTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/DsmTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/DsmTopologicalSorterTest.java b/sonar-graph/src/test/java/org/sonar/graph/DsmTopologicalSorterTest.java index f017d32dc23..2a67b72cd9f 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/DsmTopologicalSorterTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/DsmTopologicalSorterTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/FeedbackCycleTest.java b/sonar-graph/src/test/java/org/sonar/graph/FeedbackCycleTest.java index ea3ee61fe69..6a63b04ac67 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/FeedbackCycleTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/FeedbackCycleTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/FeedbackEdgeTest.java b/sonar-graph/src/test/java/org/sonar/graph/FeedbackEdgeTest.java index 67ba883635b..f865db73c44 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/FeedbackEdgeTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/FeedbackEdgeTest.java @@ -1,81 +1,81 @@ -/*
- * 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.graph;
-
-import org.junit.Test;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThan;
-import static org.hamcrest.Matchers.is;
-
-public class FeedbackEdgeTest {
-
- @Test
- public void testWeights() {
- FeedbackEdge fEdge = mockFeedbackEdge(14, 2);
- assertThat(fEdge.getWeight(), is(14));
- assertThat(fEdge.getRelativeWeight(), is(7.0));
- assertThat(fEdge.getOccurences(), is(2));
- }
-
- @Test
- public void testCompareTo() {
- FeedbackEdge feedbackEdge1;
- FeedbackEdge feedbackEdge2;
- FeedbackEdge feedbackEdge3;
-
- feedbackEdge1 = mockFeedbackEdge(14, 2);
- feedbackEdge2 = mockFeedbackEdge(10, 2);
- assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(1));
-
- feedbackEdge1 = mockFeedbackEdge(10, 2);
- feedbackEdge2 = mockFeedbackEdge(14, 2);
- assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(-1));
-
- feedbackEdge1 = mockFeedbackEdge(14, 2);
- feedbackEdge2 = mockFeedbackEdge(14, 2);
- assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(0));
-
- feedbackEdge1 = mockFeedbackEdge(14, 2);
- feedbackEdge2 = mockFeedbackEdge(13, 2);
- assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(1));
-
- feedbackEdge1 = mockFeedbackEdge(13, 2);
- feedbackEdge2 = mockFeedbackEdge(14, 2);
- assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(-1));
-
- feedbackEdge1 = mockFeedbackEdge("A", "B", 14, 2);
- feedbackEdge2 = mockFeedbackEdge("B", "C", 14, 2);
- feedbackEdge3 = mockFeedbackEdge("C", "A", 14, 2);
- assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(-1));
- assertThat(feedbackEdge2.compareTo(feedbackEdge3), is(-1));
- assertThat(feedbackEdge3.compareTo(feedbackEdge1), greaterThan(1));
- }
-
- private FeedbackEdge mockFeedbackEdge(int weight, int occurrences) {
- return mockFeedbackEdge("from", "to", weight, occurrences);
- }
-
- private FeedbackEdge mockFeedbackEdge(String from, String to, int weight, int occurrences) {
- Edge edge = new StringEdge(from, to, weight);
- return new FeedbackEdge(edge, occurrences);
- }
-
-}
+/* + * 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.graph; + +import org.junit.Test; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.is; + +public class FeedbackEdgeTest { + + @Test + public void testWeights() { + FeedbackEdge fEdge = mockFeedbackEdge(14, 2); + assertThat(fEdge.getWeight(), is(14)); + assertThat(fEdge.getRelativeWeight(), is(7.0)); + assertThat(fEdge.getOccurences(), is(2)); + } + + @Test + public void testCompareTo() { + FeedbackEdge feedbackEdge1; + FeedbackEdge feedbackEdge2; + FeedbackEdge feedbackEdge3; + + feedbackEdge1 = mockFeedbackEdge(14, 2); + feedbackEdge2 = mockFeedbackEdge(10, 2); + assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(1)); + + feedbackEdge1 = mockFeedbackEdge(10, 2); + feedbackEdge2 = mockFeedbackEdge(14, 2); + assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(-1)); + + feedbackEdge1 = mockFeedbackEdge(14, 2); + feedbackEdge2 = mockFeedbackEdge(14, 2); + assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(0)); + + feedbackEdge1 = mockFeedbackEdge(14, 2); + feedbackEdge2 = mockFeedbackEdge(13, 2); + assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(1)); + + feedbackEdge1 = mockFeedbackEdge(13, 2); + feedbackEdge2 = mockFeedbackEdge(14, 2); + assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(-1)); + + feedbackEdge1 = mockFeedbackEdge("A", "B", 14, 2); + feedbackEdge2 = mockFeedbackEdge("B", "C", 14, 2); + feedbackEdge3 = mockFeedbackEdge("C", "A", 14, 2); + assertThat(feedbackEdge1.compareTo(feedbackEdge2), is(-1)); + assertThat(feedbackEdge2.compareTo(feedbackEdge3), is(-1)); + assertThat(feedbackEdge3.compareTo(feedbackEdge1), greaterThan(1)); + } + + private FeedbackEdge mockFeedbackEdge(int weight, int occurrences) { + return mockFeedbackEdge("from", "to", weight, occurrences); + } + + private FeedbackEdge mockFeedbackEdge(String from, String to, int weight, int occurrences) { + Edge edge = new StringEdge(from, to, weight); + return new FeedbackEdge(edge, occurrences); + } + +} diff --git a/sonar-graph/src/test/java/org/sonar/graph/IncrementalCyclesAndFESSolverTest.java b/sonar-graph/src/test/java/org/sonar/graph/IncrementalCyclesAndFESSolverTest.java index 3b11829819c..d9a9e4b58f3 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/IncrementalCyclesAndFESSolverTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/IncrementalCyclesAndFESSolverTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/MinimumFeedbackEdgeSetSolverTest.java b/sonar-graph/src/test/java/org/sonar/graph/MinimumFeedbackEdgeSetSolverTest.java index 704b8f83402..b20683d45c0 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/MinimumFeedbackEdgeSetSolverTest.java +++ b/sonar-graph/src/test/java/org/sonar/graph/MinimumFeedbackEdgeSetSolverTest.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or diff --git a/sonar-graph/src/test/java/org/sonar/graph/StringPrintWriter.java b/sonar-graph/src/test/java/org/sonar/graph/StringPrintWriter.java index 3beddf48215..e76a21403b2 100644 --- a/sonar-graph/src/test/java/org/sonar/graph/StringPrintWriter.java +++ b/sonar-graph/src/test/java/org/sonar/graph/StringPrintWriter.java @@ -1,6 +1,6 @@ /* * Sonar, open source software quality management tool. - * Copyright (C) 2009 SonarSource SA + * Copyright (C) 2008-2011 SonarSource * mailto:contact AT sonarsource DOT com * * Sonar is free software; you can redistribute it and/or |