|
Lines 53-58
Link Here
|
| 53 |
assertTrue( autoPortIndex > manualPortIndex ); |
53 |
assertTrue( autoPortIndex > manualPortIndex ); |
| 54 |
} |
54 |
} |
| 55 |
|
55 |
|
|
|
56 |
public void testDefaultJettyLogLevel() throws Exception { |
| 57 |
ILaunchConfigurationWorkingCopy config = Fixture.createRAPLaunchConfig(); |
| 58 |
RAPLaunchDelegate launchDelegate = new RAPLaunchDelegate(); |
| 59 |
// setup launch configuration |
| 60 |
try { |
| 61 |
launchDelegate.launch( config, null, null, null ); |
| 62 |
} catch( Throwable thr ) { |
| 63 |
// ignore any exceptions, the only purpose of the above call is to |
| 64 |
// set the 'config' field of the RAPLaunchDelegate |
| 65 |
} |
| 66 |
String[] arguments = launchDelegate.getVMArguments( config ); |
| 67 |
int logLevelIndex |
| 68 |
= indexOf( arguments, |
| 69 |
"-Dorg.eclipse.equinox.http.jetty.log.stderr.threshold=info" ); |
| 70 |
assertTrue( logLevelIndex > -1 ); |
| 71 |
} |
| 72 |
|
| 73 |
public void testJettyLogLevelOverride() throws Exception { |
| 74 |
ILaunchConfigurationWorkingCopy config = Fixture.createRAPLaunchConfig(); |
| 75 |
RAPLaunchDelegate launchDelegate = new RAPLaunchDelegate(); |
| 76 |
// prepare launch configuration |
| 77 |
config.setAttribute( IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, |
| 78 |
"-Dorg.eclipse.equinox.http.jetty.log.stderr.threshold=debug" ); |
| 79 |
// setup launch configuration |
| 80 |
try { |
| 81 |
launchDelegate.launch( config, null, null, null ); |
| 82 |
} catch( Throwable thr ) { |
| 83 |
// ignore any exceptions, the only purpose of the above call is to |
| 84 |
// set the 'config' field of the RAPLaunchDelegate |
| 85 |
} |
| 86 |
String[] arguments = launchDelegate.getVMArguments( config ); |
| 87 |
int defaultLogLevelIndex |
| 88 |
= indexOf( arguments, |
| 89 |
"-Dorg.eclipse.equinox.http.jetty.log.stderr.threshold=info" ); |
| 90 |
int customLogLevelIndex |
| 91 |
= indexOf( arguments, |
| 92 |
"-Dorg.eclipse.equinox.http.jetty.log.stderr.threshold=debug" ); |
| 93 |
assertTrue( customLogLevelIndex > defaultLogLevelIndex ); |
| 94 |
} |
| 95 |
|
| 56 |
private static int indexOf( String[] strings, final String string ) { |
96 |
private static int indexOf( String[] strings, final String string ) { |
| 57 |
int result = -1; |
97 |
int result = -1; |
| 58 |
for( int i = 0; result == -1 && i < strings.length; i++ ) { |
98 |
for( int i = 0; result == -1 && i < strings.length; i++ ) { |