19
19
import static org .junit .jupiter .api .Assertions .assertNull ;
20
20
21
21
import java .util .Map ;
22
- import org .junit .jupiter .api .Test ;
23
22
24
23
/**
25
24
* Tests {@link JmxRuntimeInputArgumentsLookup} from the command line, not a JUnit test.
@@ -34,42 +33,13 @@ public static void main(final String[] args) {
34
33
new MainInputArgumentsJmxLookupTest ().callFromMain ();
35
34
}
36
35
37
- @ Test
38
- public void testMap () {
39
- final JmxRuntimeInputArgumentsLookup lookup = JmxRuntimeInputArgumentsLookup .JMX_SINGLETON ;
40
- String result2 = null ;
41
- if (null != null ) {
42
- final Map <String , String > map2 = lookup .getMap ();
43
- result2 = map2 == null ? null : map2 .get (null );
44
- }
45
- assertNull (result2 );
46
- String result1 = null ;
47
- if ("X" != null ) {
48
- final Map <String , String > map1 = lookup .getMap ();
49
- result1 = map1 == null ? null : map1 .get ("X" );
50
- }
51
- assertNull (result1 );
52
- String result = null ;
53
- if ("foo.txt" != null ) {
54
- final Map <String , String > map = lookup .getMap ();
55
- result = map == null ? null : map .get ("foo.txt" );
56
- }
57
- assertNull (result );
58
- }
59
-
60
36
public void callFromMain () {
61
37
final JmxRuntimeInputArgumentsLookup lookup = JmxRuntimeInputArgumentsLookup .JMX_SINGLETON ;
62
38
String result1 = null ;
63
- if (null != null ) {
64
- final Map <String , String > map1 = lookup .getMap ();
65
- result1 = map1 == null ? null : map1 .get (null );
66
- }
67
39
assertNull (result1 );
68
40
String result = null ;
69
- if ("X" != null ) {
70
- final Map <String , String > map = lookup .getMap ();
71
- result = map == null ? null : map .get ("X" );
72
- }
41
+ final Map <String , String > map = lookup .getMap ();
42
+ result = map == null ? null : map .get ("X" );
73
43
assertNull (result );
74
44
// Eclipse adds -Dfile.encoding=Cp1252
75
45
// assertEquals("--file", lookup.lookup("0"));
0 commit comments