{
public DescriptorImpl() {
diff --git a/src/test/java/hudson/plugins/emma/CoverageObjectTest.java b/src/test/java/hudson/plugins/emma/CoverageObjectTest.java
index e808b1f..64324a7 100644
--- a/src/test/java/hudson/plugins/emma/CoverageObjectTest.java
+++ b/src/test/java/hudson/plugins/emma/CoverageObjectTest.java
@@ -14,15 +14,16 @@ public void testPrintRatioTable() throws Exception {
r = new Ratio(0,100);
b = new StringBuilder();
CoverageObject.printRatioTable(r, b, no_tests_required);
- assertEquals("", b.toString());
-//[KB-] assertEquals("", b.toString());
+ double value = 0;
+ String expected = String.format("", value);
+ assertEquals(expected, b.toString());
r = new Ratio(51,200);
b = new StringBuilder();
CoverageObject.printRatioTable(r, b, no_tests_required);
- assertEquals("", b.toString());
-//[KB-] assertEquals("", b.toString());
-
+ value = 25.5;
+ expected = String.format("", value);
+ assertEquals(expected, b.toString());
}
@@ -48,11 +49,10 @@ public void testPrintColumnt() throws Exception {
r = new Ratio(51,200);
b = new StringBuilder();
CoverageObject.printRatioCell(false, r, b, no_tests_required);
- assertEquals("\n" +
- " | \n", b.toString());
-//[KB-] assertEquals("\n" +
-//[KB-] " | \n", b.toString());
-
+ double value = 25.5;
+ String expected = String.format("\n" +
+ " | \n", value, value);
+ assertEquals(expected, b.toString());
r = new Ratio(0,0);
b = new StringBuilder();
diff --git a/src/test/java/hudson/plugins/emma/EmmaConfigSubmitTest.java b/src/test/java/hudson/plugins/emma/EmmaConfigSubmitTest.java
index dd7301d..d8dddba 100644
--- a/src/test/java/hudson/plugins/emma/EmmaConfigSubmitTest.java
+++ b/src/test/java/hudson/plugins/emma/EmmaConfigSubmitTest.java
@@ -16,10 +16,12 @@ public void testIncludeIsEmpty() throws Exception {
client.setThrowExceptionOnFailingStatusCode(false);
FreeStyleProject fp = createFreeStyleProject();
+ EmmaPublisher emma = new EmmaPublisher();
+ fp.getPublishersList().add(emma);
+
HtmlPage p = client.goTo(fp.getUrl() + "/configure");
HtmlForm f = p.getFormByName("config");
- f.getInputByName("hudson-plugins-emma-EmmaPublisher").setChecked(true);
// includes is empty
submit(f);
@@ -33,10 +35,12 @@ public void testIncludeIsSet() throws Exception {
client.setThrowExceptionOnFailingStatusCode(false);
FreeStyleProject fp = createFreeStyleProject();
+ EmmaPublisher emma = new EmmaPublisher();
+ fp.getPublishersList().add(emma);
+
HtmlPage p = client.goTo(fp.getUrl() + "/configure");
HtmlForm f = p.getFormByName("config");
- f.getInputByName("hudson-plugins-emma-EmmaPublisher").setChecked(true);
f.getInputByName("emma.includes").setValueAttribute("**/*");
submit(f);
@@ -50,10 +54,12 @@ public void testHealthReportDefaultMaxValue() throws Exception {
client.setThrowExceptionOnFailingStatusCode(false);
FreeStyleProject fp = createFreeStyleProject();
+ EmmaPublisher emma = new EmmaPublisher();
+ fp.getPublishersList().add(emma);
+
HtmlPage p = client.goTo(fp.getUrl() + "/configure");
HtmlForm f = p.getFormByName("config");
- f.getInputByName("hudson-plugins-emma-EmmaPublisher").setChecked(true);
f.getInputByName("emmaHealthReports.maxClass").setValueAttribute("");
f.getInputByName("emmaHealthReports.maxMethod").setValueAttribute("");
f.getInputByName("emmaHealthReports.maxBlock").setValueAttribute("");
@@ -76,10 +82,12 @@ public void testHealthReportDefaultMinValue() throws Exception {
client.setThrowExceptionOnFailingStatusCode(false);
FreeStyleProject fp = createFreeStyleProject();
+ EmmaPublisher emma = new EmmaPublisher();
+ fp.getPublishersList().add(emma);
+
HtmlPage p = client.goTo(fp.getUrl() + "/configure");
HtmlForm f = p.getFormByName("config");
- f.getInputByName("hudson-plugins-emma-EmmaPublisher").setChecked(true);
f.getInputByName("emmaHealthReports.minClass").setValueAttribute("");
f.getInputByName("emmaHealthReports.minMethod").setValueAttribute("");
f.getInputByName("emmaHealthReports.minBlock").setValueAttribute("");
@@ -102,10 +110,12 @@ public void testHealthReportMaxValue() throws Exception {
client.setThrowExceptionOnFailingStatusCode(false);
FreeStyleProject fp = createFreeStyleProject();
+ EmmaPublisher emma = new EmmaPublisher();
+ fp.getPublishersList().add(emma);
+
HtmlPage p = client.goTo(fp.getUrl() + "/configure");
HtmlForm f = p.getFormByName("config");
- f.getInputByName("hudson-plugins-emma-EmmaPublisher").setChecked(true);
f.getInputByName("emmaHealthReports.maxClass").setValueAttribute("10");
f.getInputByName("emmaHealthReports.maxMethod").setValueAttribute("10");
f.getInputByName("emmaHealthReports.maxBlock").setValueAttribute("10");
@@ -128,10 +138,12 @@ public void testHealthReportMinValue() throws Exception {
client.setThrowExceptionOnFailingStatusCode(false);
FreeStyleProject fp = createFreeStyleProject();
+ EmmaPublisher emma = new EmmaPublisher();
+ fp.getPublishersList().add(emma);
+
HtmlPage p = client.goTo(fp.getUrl() + "/configure");
HtmlForm f = p.getFormByName("config");
- f.getInputByName("hudson-plugins-emma-EmmaPublisher").setChecked(true);
f.getInputByName("emmaHealthReports.minClass").setValueAttribute("10");
f.getInputByName("emmaHealthReports.minMethod").setValueAttribute("10");
f.getInputByName("emmaHealthReports.minBlock").setValueAttribute("10");
@@ -154,11 +166,12 @@ public void test_new_no_tests_required_flag() throws Exception {
client.setThrowExceptionOnFailingStatusCode(false);
FreeStyleProject fp = createFreeStyleProject();
+ EmmaPublisher emma = new EmmaPublisher();
+ fp.getPublishersList().add(emma);
+
HtmlPage p = client.goTo(fp.getUrl() + "/configure");
HtmlForm f = p.getFormByName("config");
- f.getInputByName("hudson-plugins-emma-EmmaPublisher").setChecked(true);
-
f.getInputByName("emmaAdvancedSettings.testNotMandatory").setChecked(true);
submit(f);
EmmaPublisher publisher = (EmmaPublisher) fp.getPublisher(EmmaPublisher.DESCRIPTOR);
@@ -179,10 +192,12 @@ public void testDataColumnMapping() throws Exception {
client.setThrowExceptionOnFailingStatusCode(false);
FreeStyleProject fp = createFreeStyleProject();
+ EmmaPublisher emma = new EmmaPublisher();
+ fp.getPublishersList().add(emma);
+
HtmlPage p = client.goTo(fp.getUrl() + "/configure");
HtmlForm f = p.getFormByName("config");
- f.getInputByName("hudson-plugins-emma-EmmaPublisher").setChecked(true);
f.getInputByName("emmaAdvancedSettings.firstDataColumnDescriptor").setValueAttribute("test_class");
f.getInputByName("emmaAdvancedSettings.secondDataColumnDescriptor").setValueAttribute("test_method");
f.getInputByName("emmaAdvancedSettings.thirdDataColumnDescriptor").setValueAttribute("test_block");