File tree Expand file tree Collapse file tree 5 files changed +89
-1
lines changed Expand file tree Collapse file tree 5 files changed +89
-1
lines changed Original file line number Diff line number Diff line change 88public class KindOfKeePassXC {
99 private static final Logger LOG = LoggerFactory .getLogger (KindOfKeePassXC .class );
1010
11- static Optional <KeePassXCType > determineType () {
11+ public static Optional <KeePassXCType > determineType () {
1212 var processHandle = ProcessHandle .allProcesses ()
1313 .filter (ph -> ph .info ().command ().isPresent () && ph .info ().command ().get ().contains ("KeePassXC" ))
1414 .findFirst ();
Original file line number Diff line number Diff line change 1+ package org .purejava ;
2+
3+ import org .junit .jupiter .api .DisplayName ;
4+ import org .junit .jupiter .api .Order ;
5+ import org .junit .jupiter .api .Test ;
6+ import org .keepassxc .KeePassXCType ;
7+ import org .keepassxc .KindOfKeePassXC ;
8+
9+ import static org .junit .jupiter .api .Assertions .*;
10+
11+ /**
12+ * For this test, an KeePassXC AppImage should be started.
13+ */
14+ public class AppImageTest {
15+ @ Test
16+ @ Order (7 )
17+ @ DisplayName ("Testing KeePassXC installation type" )
18+ public void shouldHaveNoErrors () {
19+ var type = KindOfKeePassXC .determineType ();
20+ assertTrue (type .isPresent () && type .get ().equals (KeePassXCType .AppImage ));
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ package org .purejava ;
2+
3+ import org .junit .jupiter .api .DisplayName ;
4+ import org .junit .jupiter .api .Order ;
5+ import org .junit .jupiter .api .Test ;
6+ import org .keepassxc .KeePassXCType ;
7+ import org .keepassxc .KindOfKeePassXC ;
8+
9+ import static org .junit .jupiter .api .Assertions .*;
10+
11+ /**
12+ * For this test, KeePassXC - installed via Flatpak - should be started.
13+ */
14+ public class FlatpakTest {
15+ @ Test
16+ @ Order (4 )
17+ @ DisplayName ("Testing KeePassXC installation type" )
18+ public void shouldHaveNoErrors () {
19+ var type = KindOfKeePassXC .determineType ();
20+ assertTrue (type .isPresent () && type .get ().equals (KeePassXCType .Flatpak ));
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ package org .purejava ;
2+
3+ import org .junit .jupiter .api .DisplayName ;
4+ import org .junit .jupiter .api .Order ;
5+ import org .junit .jupiter .api .Test ;
6+ import org .keepassxc .KeePassXCType ;
7+ import org .keepassxc .KindOfKeePassXC ;
8+
9+ import static org .junit .jupiter .api .Assertions .*;
10+
11+ /**
12+ * For this test, KeePassXC - installed from repository - should be started.
13+ */
14+ public class RepoTest {
15+ @ Test
16+ @ Order (6 )
17+ @ DisplayName ("Testing KeePassXC installation type" )
18+ public void shouldHaveNoErrors () {
19+ var type = KindOfKeePassXC .determineType ();
20+ assertTrue (type .isPresent () && type .get ().equals (KeePassXCType .Repo ));
21+ }
22+ }
Original file line number Diff line number Diff line change 1+ package org .purejava ;
2+
3+ import org .junit .jupiter .api .DisplayName ;
4+ import org .junit .jupiter .api .Order ;
5+ import org .junit .jupiter .api .Test ;
6+ import org .keepassxc .KeePassXCType ;
7+ import org .keepassxc .KindOfKeePassXC ;
8+
9+ import static org .junit .jupiter .api .Assertions .*;
10+
11+ /**
12+ * For this test, KeePassXC - installed via Snap - should be started.
13+ */
14+ public class SnapTest {
15+ @ Test
16+ @ Order (5 )
17+ @ DisplayName ("Testing KeePassXC installation type" )
18+ public void shouldHaveNoErrors () {
19+ var type = KindOfKeePassXC .determineType ();
20+ assertTrue (type .isPresent () && type .get ().equals (KeePassXCType .Snap ));
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments