You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2006/01/31 02:02:17 UTC
svn commit: r373659 - in /maven/maven-1/plugins/trunk/dashboard/src:
main/org/apache/maven/dashboard/aggregator/clover/ test/ test/org/
test/org/apache/ test/org/apache/maven/ test/org/apache/maven/dashboard/
test/org/apache/maven/dashboard/aggregator/...
Author: ltheussl
Date: Mon Jan 30 17:02:14 2006
New Revision: 373659
URL: http://svn.apache.org/viewcvs?rev=373659&view=rev
Log:
Add a simple test case. Source code formatting.
Added:
maven/maven-1/plugins/trunk/dashboard/src/test/
maven/maven-1/plugins/trunk/dashboard/src/test/org/
maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/
maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/
maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/
maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/aggregator/
maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/aggregator/clover/
maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/aggregator/clover/CloverTPCTest.java (with props)
Modified:
maven/maven-1/plugins/trunk/dashboard/src/main/org/apache/maven/dashboard/aggregator/clover/CloverTPC.java
Modified: maven/maven-1/plugins/trunk/dashboard/src/main/org/apache/maven/dashboard/aggregator/clover/CloverTPC.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/dashboard/src/main/org/apache/maven/dashboard/aggregator/clover/CloverTPC.java?rev=373659&r1=373658&r2=373659&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/dashboard/src/main/org/apache/maven/dashboard/aggregator/clover/CloverTPC.java (original)
+++ maven/maven-1/plugins/trunk/dashboard/src/main/org/apache/maven/dashboard/aggregator/clover/CloverTPC.java Mon Jan 30 17:02:14 2006
@@ -17,6 +17,7 @@
* ====================================================================
*/
+
import java.text.DecimalFormat;
/**
@@ -26,11 +27,12 @@
*/
public class CloverTPC
{
- public static String computeTPC(String elements, String coveredElements)
+ public static String computeTPC( String elements, String coveredElements )
{
- double e = Double.valueOf(elements).doubleValue();
- double ce = Double.valueOf(coveredElements).doubleValue();
- DecimalFormat formatter = new DecimalFormat("##%");
- return formatter.format(ce/e);
- }
-}
\ No newline at end of file
+ double e = Double.valueOf( elements ).doubleValue();
+ double ce = Double.valueOf( coveredElements ).doubleValue();
+ DecimalFormat formatter = new DecimalFormat( "##%" );
+
+ return formatter.format( ce / e );
+ }
+}
Added: maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/aggregator/clover/CloverTPCTest.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/aggregator/clover/CloverTPCTest.java?rev=373659&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/aggregator/clover/CloverTPCTest.java (added)
+++ maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/aggregator/clover/CloverTPCTest.java Mon Jan 30 17:02:14 2006
@@ -0,0 +1,48 @@
+package org.apache.maven.dashboard.aggregator.clover;
+
+/* ====================================================================
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+
+import junit.framework.TestCase;
+
+
+/**
+ */
+public class CloverTPCTest extends TestCase
+{
+ /**
+ * Constructor.
+ * @param name Name of the test.
+ */
+ public CloverTPCTest( String name )
+ {
+ super( name );
+ }
+
+ /**
+ */
+ public void testcomputeTPC() throws Exception
+ {
+ String elements = "100";
+ String coveredElements = "53";
+ assertEquals( "Clover TPC is '53%'",
+ "53%", CloverTPC.computeTPC( elements, coveredElements) );
+ }
+
+}
+
Propchange: maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/aggregator/clover/CloverTPCTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/maven-1/plugins/trunk/dashboard/src/test/org/apache/maven/dashboard/aggregator/clover/CloverTPCTest.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"