Skip to content

Commit

Permalink
Removed obsolete overload for intially loading files
Browse files Browse the repository at this point in the history
  • Loading branch information
Vogel612 committed Jun 24, 2015
1 parent 8418638 commit f097965
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/main/java/de/vogel612/helper/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public static void main(final String[] args) {

OverviewPresenter p = new OverviewPresenterImpl(m, v);
p.initialize();
p.loadFiles(resxFolder);
p.loadFiles(resxFolder, OverviewPresenter.DEFAULT_ROOT_LOCALE,
OverviewPresenter.DEFAULT_TARGET_LOCALE);
p.show();
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/de/vogel612/helper/ui/OverviewPresenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

public interface OverviewPresenter {

public static final String DEFAULT_TARGET_LOCALE = "de";
public static final String DEFAULT_ROOT_LOCALE = "";

void show();

void initialize();

void loadFiles(Path resxFile);

void loadFiles(Path resxFolder, String rootLocale, String targetLocale);

void onException(Exception e, String message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

public class OverviewPresenterImpl implements OverviewPresenter {

private static final String DEFAULT_TARGET_LOCALE = "de";
private static final String DEFAULT_ROOT_LOCALE = "";
final OverviewModel model;
final OverviewView view;
private boolean initialized = false;

public OverviewPresenterImpl(OverviewModel m, OverviewView v) {
public OverviewPresenterImpl(final OverviewModel m, final OverviewView v) {
model = m;
view = v;

Expand All @@ -41,12 +39,7 @@ public void show() {
}

@Override
public void loadFiles(Path resxFile) {
loadFiles(resxFile, DEFAULT_ROOT_LOCALE, DEFAULT_TARGET_LOCALE);
}

@Override
public void onException(Exception e, String message) {
public void onException(final Exception e, final String message) {
e.printStackTrace(System.err);
view.showError(message, e.getMessage());
}
Expand All @@ -57,8 +50,8 @@ public void onParseCompletion() {
}

@Override
public void loadFiles(Path resxFolder, String rootLocale,
String targetLocale) {
public void loadFiles(final Path resxFolder, final String rootLocale,
final String targetLocale) {
model.loadFromDirectory(resxFolder, targetLocale);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package de.vogel612.helper.ui;

import static org.mockito.Mockito.*;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

import java.nio.file.Path;
import java.util.List;
Expand Down Expand Up @@ -66,7 +70,8 @@ public void show_callsShow_onView() {
public void loadFromFile_delegatesToModel() {
Path mock = mock(Path.class);

cut.loadFiles(mock);
cut.loadFiles(mock, OverviewPresenter.DEFAULT_ROOT_LOCALE,
OverviewPresenter.DEFAULT_TARGET_LOCALE);
verify(m).loadFromDirectory(mock, "de");
verifyNoMoreInteractions(m, v);
}
Expand Down

0 comments on commit f097965

Please sign in to comment.