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 8
8
public class KindOfKeePassXC {
9
9
private static final Logger LOG = LoggerFactory .getLogger (KindOfKeePassXC .class );
10
10
11
- static Optional <KeePassXCType > determineType () {
11
+ public static Optional <KeePassXCType > determineType () {
12
12
var processHandle = ProcessHandle .allProcesses ()
13
13
.filter (ph -> ph .info ().command ().isPresent () && ph .info ().command ().get ().contains ("KeePassXC" ))
14
14
.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