diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2017-05-03 18:33:00 +0200 |
---|---|---|
committer | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2017-05-03 20:21:52 +0200 |
commit | 94ed743f66d67ddff24ccf9b83f120d3edd1f9d2 (patch) | |
tree | 65547a70245f78e5e909e7593aa38350d0eb7cdf | |
parent | 3fe99d1bfc8b0523ed66e9c2b20dc4ec5354a115 (diff) | |
download | jacoco-94ed743f66d67ddff24ccf9b83f120d3edd1f9d2.tar.gz |
Adjust test case names to new conventions.
7 files changed, 33 insertions, 24 deletions
diff --git a/org.jacoco.cli.test/src/org/jacoco/cli/internal/MainTest.java b/org.jacoco.cli.test/src/org/jacoco/cli/internal/MainTest.java index 7a79d1e3..aa949cfb 100644 --- a/org.jacoco.cli.test/src/org/jacoco/cli/internal/MainTest.java +++ b/org.jacoco.cli.test/src/org/jacoco/cli/internal/MainTest.java @@ -19,7 +19,7 @@ import org.junit.Test; public class MainTest extends CommandTestBase { @Test - public void shouldPrintUsage_whenNoArgumentsGiven() throws Exception { + public void should_print_usage_when_no_arguments_given() throws Exception { execute(); assertFailure(); @@ -30,7 +30,7 @@ public class MainTest extends CommandTestBase { } @Test - public void shouldPrintErrorMessage_whenInvalidCommandIsGiven() + public void should_print_error_message_when_invalid_command_is_given() throws Exception { execute("foo"); @@ -41,7 +41,7 @@ public class MainTest extends CommandTestBase { } @Test - public void shouldPrintGeneralHelp_whenHelpOptionIsGiven() + public void should_print_general_usage_when_help_option_is_given() throws Exception { execute("-help"); @@ -52,7 +52,7 @@ public class MainTest extends CommandTestBase { } @Test - public void shouldPrintCommandHelp_whenHelpOptionIsGiven() + public void should_print_command_usage_when_command_and_help_option_is_given() throws Exception { execute("dump", "-help"); diff --git a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ClassInfoTest.java b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ClassInfoTest.java index 7b649cc0..802be964 100644 --- a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ClassInfoTest.java +++ b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ClassInfoTest.java @@ -15,12 +15,13 @@ import org.jacoco.cli.internal.CommandTestBase; import org.junit.Test; /** - * Unit tests for {@link ExecInfo}. + * Unit tests for {@link ClassInfo}. */ public class ClassInfoTest extends CommandTestBase { @Test - public void shouldPrintUsage_whenInvalidArgumentIsGiven() throws Exception { + public void should_print_usage_when_invalid_option_is_given() + throws Exception { execute("classinfo", "-invalid"); assertFailure(); @@ -31,7 +32,7 @@ public class ClassInfoTest extends CommandTestBase { } @Test - public void shouldProvideClassInfoInfo() throws Exception { + public void should_print_class_info() throws Exception { execute("classinfo", getClassPath()); assertOk(); diff --git a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/DumpTest.java b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/DumpTest.java index 5eed52cf..62e7dc44 100644 --- a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/DumpTest.java +++ b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/DumpTest.java @@ -47,7 +47,8 @@ public class DumpTest extends CommandTestBase { } @Test - public void shouldPrintUsage_whenNoArgumentsGiven() throws Exception { + public void should_print_usage_when_no_argument_is_given() + throws Exception { execute("dump"); assertFailure(); assertContains("Option \"-destfile\" is required", err); @@ -56,7 +57,7 @@ public class DumpTest extends CommandTestBase { } @Test - public void shouldWriteDump() throws Exception { + public void should_write_dump() throws Exception { File execfile = new File(tmp.getRoot(), "jacoco.exec"); int port = startMockServer(); @@ -72,7 +73,8 @@ public class DumpTest extends CommandTestBase { } @Test - public void shouldLogConnectionError() throws Exception { + public void should_log_connection_error_when_retry_is_specified() + throws Exception { File execfile = new File(tmp.getRoot(), "jacoco.exec"); int port = unusedPort(); diff --git a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ExecInfoTest.java b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ExecInfoTest.java index 15a1b99c..fdf1fd43 100644 --- a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ExecInfoTest.java +++ b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ExecInfoTest.java @@ -32,7 +32,8 @@ public class ExecInfoTest extends CommandTestBase { public TemporaryFolder tmp = new TemporaryFolder(); @Test - public void shouldPrintUsage_whenInvalidArgumentIsGiven() throws Exception { + public void should_print_usage_when_invalid_argument_is_given() + throws Exception { execute("execinfo", "-invalid"); assertFailure(); @@ -42,7 +43,7 @@ public class ExecInfoTest extends CommandTestBase { } @Test - public void shouldProvideExecutionDataInfo() throws Exception { + public void should_print_execution_data_info() throws Exception { File execfile = createExecFile(); execute("execinfo", execfile.getAbsolutePath()); diff --git a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java index 848a0a9e..13633549 100644 --- a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java +++ b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/InstrumentTest.java @@ -43,7 +43,8 @@ public class InstrumentTest extends CommandTestBase { public TemporaryFolder tmp = new TemporaryFolder(); @Test - public void shouldPrintUsage_whenNoArgumentsGiven() throws Exception { + public void should_print_usage_when_no_options_are_given() + throws Exception { execute("instrument"); assertFailure(); assertContains("Option \"-dest\" is required", err); @@ -53,7 +54,8 @@ public class InstrumentTest extends CommandTestBase { } @Test - public void shouldInstrumentClassFiles() throws Exception { + public void should_instrument_class_files_and_copy_resources() + throws Exception { File destdir = tmp.getRoot(); execute("instrument", "-dest", destdir.getAbsolutePath(), @@ -71,7 +73,7 @@ public class InstrumentTest extends CommandTestBase { } @Test - public void shouldNotInstrumentAnything_whenNoSourceIsGiven() + public void should_not_instrument_anything_when_no_source_is_given() throws Exception { File destdir = tmp.getRoot(); @@ -82,7 +84,7 @@ public class InstrumentTest extends CommandTestBase { } @Test - public void shouldNotCreateTargetFile_whenSourceClassFileIsBroken() + public void should_not_create_dest_file_when_source_class_is_broken() throws Exception { File srcdir = new File(tmp.getRoot(), "src"); srcdir.mkdir(); diff --git a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/MergeTest.java b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/MergeTest.java index b6d3edc6..f9132d91 100644 --- a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/MergeTest.java +++ b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/MergeTest.java @@ -37,7 +37,8 @@ public class MergeTest extends CommandTestBase { public TemporaryFolder tmp = new TemporaryFolder(); @Test - public void shouldPrintUsage_whenNoArgumentsGiven() throws Exception { + public void should_print_usage_when_no_options_are_given() + throws Exception { execute("merge"); assertFailure(); @@ -46,7 +47,7 @@ public class MergeTest extends CommandTestBase { } @Test - public void shouldMergeExecFiles() throws Exception { + public void should_merge_exec_files() throws Exception { File a = createExecFile("a"); File b = createExecFile("b"); File c = createExecFile("c"); diff --git a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ReportTest.java b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ReportTest.java index f6ac3446..89644c41 100644 --- a/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ReportTest.java +++ b/org.jacoco.cli.test/src/org/jacoco/cli/internal/commands/ReportTest.java @@ -32,7 +32,8 @@ public class ReportTest extends CommandTestBase { public TemporaryFolder tmp = new TemporaryFolder(); @Test - public void shouldPrintUsage_whenNoArgumentsGiven() throws Exception { + public void should_print_usage_when_no_options_are_given() + throws Exception { execute("report"); assertFailure(); @@ -42,7 +43,7 @@ public class ReportTest extends CommandTestBase { } @Test - public void shouldPrintNumberOfAnalyzedClasses() throws Exception { + public void should_print_number_of_analyzed_classes() throws Exception { execute("report", "-classfiles", getClassPath()); assertOk(); @@ -50,7 +51,8 @@ public class ReportTest extends CommandTestBase { } @Test - public void shouldPrintWarning_whenExecDataDoesNotMatch() throws Exception { + public void should_print_warning_when_exec_data_does_not_match() + throws Exception { File exec = new File(tmp.getRoot(), "jacoco.exec"); final FileOutputStream execout = new FileOutputStream(exec); ExecutionDataWriter writer = new ExecutionDataWriter(execout); @@ -75,7 +77,7 @@ public class ReportTest extends CommandTestBase { } @Test - public void shouldCreateXmlReport_whenXmlOptionIsProvided() + public void should_create_xml_report_when_xml_option_is_provided() throws Exception { File xml = new File(tmp.getRoot(), "coverage.xml"); @@ -87,7 +89,7 @@ public class ReportTest extends CommandTestBase { } @Test - public void shouldCreateCsvReport_whenCsvOptionIsProvided() + public void should_create_csv_report_when_csv_option_is_provided() throws Exception { File csv = new File(tmp.getRoot(), "coverage.csv"); @@ -99,7 +101,7 @@ public class ReportTest extends CommandTestBase { } @Test - public void shouldCreateHtmlReport_whenHtmlOptionIsProvided() + public void should_create_html_report_when_html_option_is_provided() throws Exception { File html = new File(tmp.getRoot(), "coverage"); |