Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: java

script:
- mvn checkstyle:check test
- mvn checkstyle:check cobertura:cobertura test

after_success:
- mvn clean cobertura:cobertura coveralls:report
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<encoding>UTF-8</encoding>
<linkXRef>false</linkXRef>
<excludes>**/name/fraser/neil/**/*</excludes>
<failOnViolation>true</failOnViolation>
</configuration>
<version>2.16</version>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/fi/helsinki/cs/tmc/cli/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public Application() {
}

private void preinit() {
this.commands = new CommandMap(this);
this.commands = new CommandMap();
this.commands.createCommands(this);
this.initialized = true;
}

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/fi/helsinki/cs/tmc/cli/command/CommandMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ public class CommandMap {
/**
* Constructor.
*/
public CommandMap(Application app) {
public CommandMap() {
this.commands = new HashMap<>();
}

public void createCommands(Application app) {
createCommand(new TestCommand(app));
createCommand(new HelpCommand(app));
}
Expand Down
7 changes: 3 additions & 4 deletions src/test/java/fi/helsinki/cs/tmc/cli/ApplicationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@


public class ApplicationTest {
Application app = new Application();

@Test
public void testingTest() {
assertTrue(true);
public void testThatProgramWontCrashWithEmptyArguments() {
Application app = new Application();
app.run(new String[]{});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public static void tearDownClass() {

@Before
public void setUp() {
cm = new CommandMap(new Application());
cm = new CommandMap();
cm.createCommands(new Application());
}

@After
Expand Down