Bind ViewFactory interface to GuiceViewFactory impl

This change fixes a test that was breaking in the previous commit.
This commit is contained in:
Chris Beams 2014-11-24 07:32:37 +01:00
parent e8afdf5e22
commit 87fb4390c4
No known key found for this signature in database
GPG key ID: 3D214F8F5BC5ED73
2 changed files with 7 additions and 6 deletions

View file

@ -62,24 +62,24 @@ public class ViewLoaderTests {
Thread.sleep(10);
}
private GuiceViewFactory controllerFactory;
private GuiceViewFactory viewFactory;
@Before
public void setUp() {
OptionParser parser = new OptionParser();
BitsquareEnvironment env = new BitsquareEnvironment(parser.parse(new String[]{}));
Injector injector = Guice.createInjector(new BitsquareAppModule(env, TestApp.primaryStage));
controllerFactory = injector.getInstance(GuiceViewFactory.class);
controllerFactory.setInjector(injector);
viewFactory = injector.getInstance(GuiceViewFactory.class);
viewFactory.setInjector(injector);
}
@Test(expected = BitsquareException.class)
public void loadingBogusFxmlResourceShouldThrow() throws MalformedURLException {
new ViewLoader(controllerFactory).load(Navigation.Item.BOGUS.getFxmlUrl(), false);
new ViewLoader(viewFactory).load(Navigation.Item.BOGUS.getFxmlUrl(), false);
}
@Test
public void loadingValidFxmlResourceShouldNotThrow() {
new ViewLoader(controllerFactory).load(Navigation.Item.ACCOUNT.getFxmlUrl(), false);
new ViewLoader(viewFactory).load(Navigation.Item.ACCOUNT.getFxmlUrl(), false);
}
}