-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#236: fixes issue of wrongly selected/deselected filters
- Loading branch information
1 parent
bac1103
commit a72d713
Showing
30 changed files
with
219 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FINEST | ||
INFO | ||
WARNING | ||
SEVERE | ||
SEVERE | ||
not classified |
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
47 changes: 47 additions & 0 deletions
47
...rc/test/scala/app/logorrr/issues/Issue236OpenMultipleTabsAndChooseDefaultFilterTest.scala
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,47 @@ | ||
package app.logorrr.issues | ||
|
||
import app.logorrr.TestFiles | ||
import app.logorrr.model.LogFileSettings | ||
import app.logorrr.steps.CheckTabPaneActions | ||
import app.logorrr.usecases.MultipleFileApplicationTest | ||
import app.logorrr.views.search.FilterButton | ||
import javafx.scene.control.ToggleButton | ||
import org.junit.jupiter.api.Test | ||
import org.testfx.api.FxAssert | ||
|
||
import java.util.function.Predicate | ||
|
||
/** | ||
* https://github.com/rladstaetter/LogoRRR/issues/236 | ||
* | ||
* Shows that the default filters are used for a file after the first file was opened and the filter selection | ||
* was changed. | ||
* */ | ||
class Issue236OpenMultipleTabsAndChooseDefaultFilterTest | ||
extends MultipleFileApplicationTest(TestFiles.seq) | ||
with CheckTabPaneActions { | ||
|
||
@Test def testIssue236(): Unit = { | ||
// open first file | ||
openFile(TestFiles.simpleLog0) | ||
|
||
// change filters to a non default configuration | ||
val firstFilterTab1 = FilterButton.uiNode(TestFiles.simpleLog0, LogFileSettings.DefaultFilters.head) | ||
waitAndClickVisibleItem(firstFilterTab1) | ||
|
||
// check that the toggle button is deselected | ||
FxAssert.verifyThat(lookup(firstFilterTab1.ref), new Predicate[ToggleButton] { | ||
override def test(t: ToggleButton): Boolean = !t.isSelected | ||
}) | ||
|
||
// open second file | ||
openFile(TestFiles.simpleLog1) | ||
|
||
// test that second file has the default filter configuration | ||
val firstFilterTab2 = FilterButton.uiNode(TestFiles.simpleLog1, LogFileSettings.DefaultFilters.head) | ||
FxAssert.verifyThat(lookup(firstFilterTab2.ref), new Predicate[ToggleButton] { | ||
override def test(t: ToggleButton): Boolean = t.isSelected | ||
}) | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
app-tests/src/test/scala/app/logorrr/services/file/EmptyFileIdService.scala
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 @@ | ||
package app.logorrr.services.file | ||
|
||
/** | ||
* Don't provide any FileId, for tests which don't need any file operations | ||
*/ | ||
class EmptyFileIdService extends MockFileIdService(Seq()) |
3 changes: 0 additions & 3 deletions
3
app-tests/src/test/scala/app/logorrr/services/file/EmptyFileService.scala
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
15 changes: 12 additions & 3 deletions
15
app/src/main/scala/app/logorrr/services/LogoRRRServices.scala
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 |
---|---|---|
@@ -1,10 +1,19 @@ | ||
package app.logorrr.services | ||
|
||
import app.logorrr.conf.Settings | ||
import app.logorrr.services.file.FileService | ||
import app.logorrr.services.file.FileIdService | ||
import app.logorrr.services.hostservices.LogoRRRHostServices | ||
|
||
/** | ||
* Groups settings, acts as a kind of service provider interface | ||
* | ||
* @param settings application settings | ||
* @param hostServices services which need native interfaces which in turn need special capabilities which | ||
* have to be declared on packaging | ||
* @param fileIdService service to lookup file ids, also needed because of security/packaging | ||
* @param isUnderTest helper flag which tells the application it runs in test mode | ||
*/ | ||
case class LogoRRRServices(settings: Settings | ||
, hostServices: LogoRRRHostServices | ||
, fileOpenService: FileService | ||
, hostServices: LogoRRRHostServices | ||
, fileIdService: FileIdService | ||
, isUnderTest: Boolean) |
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
13 changes: 13 additions & 0 deletions
13
app/src/main/scala/app/logorrr/services/file/FileIdService.scala
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,13 @@ | ||
package app.logorrr.services.file | ||
|
||
import app.logorrr.io.FileId | ||
|
||
/** | ||
* Trait to inject either Test FileId Services or query the native dialog | ||
*/ | ||
trait FileIdService { | ||
|
||
/** returns either None or a valid FileId */ | ||
def provideFileId: Option[FileId] | ||
|
||
} |
Oops, something went wrong.