mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-24 15:35:34 -04:00
Fix broken tests and app exceptions due to ViewLoader changes
This commit is contained in:
parent
87fb4390c4
commit
2705e80ef1
3 changed files with 32 additions and 10 deletions
|
@ -20,12 +20,15 @@ package io.bitsquare.app.gui;
|
|||
import io.bitsquare.BitsquareException;
|
||||
import io.bitsquare.app.BitsquareEnvironment;
|
||||
import io.bitsquare.gui.Navigation;
|
||||
import io.bitsquare.locale.BSResources;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import viewfx.view.support.ViewLoader;
|
||||
import viewfx.view.support.guice.GuiceViewFactory;
|
||||
|
||||
|
@ -63,6 +66,7 @@ public class ViewLoaderTests {
|
|||
}
|
||||
|
||||
private GuiceViewFactory viewFactory;
|
||||
private ResourceBundle resourceBundle;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
@ -71,15 +75,17 @@ public class ViewLoaderTests {
|
|||
Injector injector = Guice.createInjector(new BitsquareAppModule(env, TestApp.primaryStage));
|
||||
viewFactory = injector.getInstance(GuiceViewFactory.class);
|
||||
viewFactory.setInjector(injector);
|
||||
|
||||
resourceBundle = BSResources.getResourceBundle();
|
||||
}
|
||||
|
||||
@Test(expected = BitsquareException.class)
|
||||
public void loadingBogusFxmlResourceShouldThrow() throws MalformedURLException {
|
||||
new ViewLoader(viewFactory).load(Navigation.Item.BOGUS.getFxmlUrl(), false);
|
||||
new ViewLoader(viewFactory, resourceBundle).load(Navigation.Item.BOGUS.getFxmlUrl(), false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loadingValidFxmlResourceShouldNotThrow() {
|
||||
new ViewLoader(viewFactory).load(Navigation.Item.ACCOUNT.getFxmlUrl(), false);
|
||||
new ViewLoader(viewFactory, resourceBundle).load(Navigation.Item.ACCOUNT.getFxmlUrl(), false);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue