-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from sialcasa/#156_bugfix_default_package
Fix Bug #156. FxmlViews located in the default package can now be loaded...
- Loading branch information
Showing
4 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import de.saxsys.mvvmfx.FxmlView; | ||
import de.saxsys.mvvmfx.internal.viewloader.example.TestViewModel; | ||
|
||
/** | ||
* The purpose of this class is to reproduce Bug no. 154 (https://github.com/sialcasa/mvvmFX/issues/156). | ||
* | ||
* The problem is that FxmlView's that are located in the default package can't be loaded properly. Instead a | ||
* NullPointerException was thrown. | ||
*/ | ||
public class FxmlViewInDefaultPackage implements FxmlView<TestViewModel> { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import de.saxsys.javafx.test.JfxRunner; | ||
import de.saxsys.mvvmfx.FluentViewLoader; | ||
import de.saxsys.mvvmfx.ViewTuple; | ||
import de.saxsys.mvvmfx.internal.viewloader.example.TestViewModel; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
/** | ||
* This test reproduces the bug no 154 (https://github.com/sialcasa/mvvmFX/issues/156). | ||
* | ||
* A FxmlView located in the default package couldn't be loaded because a NullPointerException was thrown. | ||
*/ | ||
@RunWith(JfxRunner.class) | ||
public class FxmlViewinDefaultPackageTest { | ||
|
||
|
||
@Test | ||
public void test(){ | ||
|
||
ViewTuple<FxmlViewInDefaultPackage, TestViewModel> viewTuple = FluentViewLoader | ||
.fxmlView(FxmlViewInDefaultPackage.class).load(); | ||
|
||
assertThat(viewTuple).isNotNull(); | ||
assertThat(viewTuple.getView()).isNotNull(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.VBox?> | ||
<VBox xmlns:fx="http://javafx.com/fxml" fx:controller="FxmlViewInDefaultPackage"> | ||
|
||
</VBox> |