Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 371722 | Differences between
and this patch

Collapse All | Expand All

(-).settings/org.eclipse.jdt.ui.prefs (-2 / +1 lines)
Lines 1-4 Link Here
1
#Tue Feb 01 17:40:25 CET 2011
2
cleanup.add_default_serial_version_id=true
1
cleanup.add_default_serial_version_id=true
3
cleanup.add_generated_serial_version_id=false
2
cleanup.add_generated_serial_version_id=false
4
cleanup.add_missing_annotations=false
3
cleanup.add_missing_annotations=false
Lines 55-58 Link Here
55
org.eclipse.jdt.ui.javadoc=false
54
org.eclipse.jdt.ui.javadoc=false
56
org.eclipse.jdt.ui.ondemandthreshold=3
55
org.eclipse.jdt.ui.ondemandthreshold=3
57
org.eclipse.jdt.ui.staticondemandthreshold=99
56
org.eclipse.jdt.ui.staticondemandthreshold=99
58
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user} */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\r\n * Copyright (c) ${year} R\u00FCdiger Herrmann and others. All rights reserved.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n *     R\u00FCdiger Herrmann - initial API and implementation\r\n ******************************************************************************/\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
57
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user} */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\r\n * Copyright (c) ${year} EclipseSource and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n *    EclipseSource - initial API and implementation\r\n ******************************************************************************/\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
(-)META-INF/MANIFEST.MF (-1 / +3 lines)
Lines 21-27 Link Here
21
 org.eclipse.jetty.security;bundle-version="[8.1.0,9.0.0)",
21
 org.eclipse.jetty.security;bundle-version="[8.1.0,9.0.0)",
22
 org.eclipse.jetty.server;bundle-version="[8.1.0,9.0.0)",
22
 org.eclipse.jetty.server;bundle-version="[8.1.0,9.0.0)",
23
 org.eclipse.jetty.servlet;bundle-version="[8.1.0,9.0.0)",
23
 org.eclipse.jetty.servlet;bundle-version="[8.1.0,9.0.0)",
24
 org.eclipse.jetty.util;bundle-version="[8.1.0,9.0.0)"
24
 org.eclipse.jetty.util;bundle-version="[8.1.0,9.0.0)",
25
 org.eclipse.jetty.webapp;bundle-version="[8.1.0,9.0.0)",
26
 org.eclipse.jetty.xml;bundle-version="[8.1.0,9.0.0)"
25
Bundle-ActivationPolicy: lazy
27
Bundle-ActivationPolicy: lazy
26
Bundle-RequiredExecutionEnvironment: J2SE-1.5
28
Bundle-RequiredExecutionEnvironment: J2SE-1.5
27
Bundle-Localization: OSGI-INF/l10n/bundle
29
Bundle-Localization: OSGI-INF/l10n/bundle
(-)src/org/eclipse/rap/ui/internal/launch/rwt/delegate/RWTLaunchDelegate.java (-11 / +20 lines)
Lines 1-12 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2011 Rüdiger Herrmann and others. All rights reserved.
2
 * Copyright (c) 2011, 2012 Rüdiger Herrmann and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Rüdiger Herrmann - initial API and implementation
9
 *    Rüdiger Herrmann - initial API and implementation
10
 *    EclipseSource - ongoing development
10
 ******************************************************************************/
11
 ******************************************************************************/
11
package org.eclipse.rap.ui.internal.launch.rwt.delegate;
12
package org.eclipse.rap.ui.internal.launch.rwt.delegate;
12
13
Lines 23-29 Link Here
23
24
24
25
25
public class RWTLaunchDelegate extends JavaLaunchDelegate {
26
public class RWTLaunchDelegate extends JavaLaunchDelegate {
26
  
27
27
  private RWTLaunch launch;
28
  private RWTLaunch launch;
28
29
29
  public void launch( ILaunchConfiguration configuration,
30
  public void launch( ILaunchConfiguration configuration,
Lines 54-77 Link Here
54
  }
55
  }
55
56
56
  public String getMainTypeName( ILaunchConfiguration configuration ) {
57
  public String getMainTypeName( ILaunchConfiguration configuration ) {
57
    return "org.mortbay.jetty.Main"; //$NON-NLS-1$
58
    return "org.eclipse.rap.ui.internal.launch.rwt.jetty.JettyLauncher"; //$NON-NLS-1$
58
  }
59
  }
59
  
60
60
  public String[] getClasspath( ILaunchConfiguration configuration ) throws CoreException {
61
  public String[] getClasspath( ILaunchConfiguration configuration ) throws CoreException {
61
    String[] result = super.getClasspath( configuration );
62
    String[] result = super.getClasspath( configuration );
62
    result = StringArrays.append( result, BundleFileLocator.locate( "org.mortbay.jetty.server" ) ); //$NON-NLS-1$
63
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.rap.ui.launch.rwt" ) ); //$NON-NLS-1$
63
    result = StringArrays.append( result, BundleFileLocator.locate( "org.mortbay.jetty.util" ) ); //$NON-NLS-1$
64
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.jetty.continuation" ) ); //$NON-NLS-1$
65
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.jetty.http" ) ); //$NON-NLS-1$
66
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.jetty.io" ) ); //$NON-NLS-1$
67
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.jetty.security" ) ); //$NON-NLS-1$
68
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.jetty.server" ) ); //$NON-NLS-1$
69
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.jetty.servlet" ) ); //$NON-NLS-1$
70
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.jetty.util" ) ); //$NON-NLS-1$
71
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.jetty.webapp" ) ); //$NON-NLS-1$
72
    result = StringArrays.append( result, BundleFileLocator.locate( "org.eclipse.jetty.xml" ) ); //$NON-NLS-1$
64
    result = StringArrays.append( result, BundleFileLocator.locate( "javax.servlet" ) ); //$NON-NLS-1$
73
    result = StringArrays.append( result, BundleFileLocator.locate( "javax.servlet" ) ); //$NON-NLS-1$
65
    return result;
74
    return result;
66
  }
75
  }
67
  
76
68
  public String getProgramArguments( ILaunchConfiguration configuration ) {
77
  public String getProgramArguments( ILaunchConfiguration configuration ) {
69
    // don't call super, program arguments are not configurable via the UI
78
    // don't call super, program arguments are not configurable via the UI
70
    String port = String.valueOf( launch.getPort() );
79
    String port = String.valueOf( launch.getPort() );
71
    String webAppDirectory = launch.getWebAppPath().getAbsolutePath();
80
    String webAppDirectory = launch.getWebAppPath().getAbsolutePath();
72
    return MessageFormat.format( "{0} -webapp \"{1}\"", new Object[] { port, webAppDirectory } ); //$NON-NLS-1$
81
    return MessageFormat.format( "{0} \"{1}\"", new Object[] { port, webAppDirectory } ); //$NON-NLS-1$
73
  }
82
  }
74
  
83
75
  public String getVMArguments( ILaunchConfiguration configuration ) throws CoreException {
84
  public String getVMArguments( ILaunchConfiguration configuration ) throws CoreException {
76
    String result = super.getVMArguments( configuration );
85
    String result = super.getVMArguments( configuration );
77
    result += " -Djetty.home="; //$NON-NLS-1$
86
    result += " -Djetty.home="; //$NON-NLS-1$
Lines 80-86 Link Here
80
    result += "\""; //$NON-NLS-1$
89
    result += "\""; //$NON-NLS-1$
81
    return result;
90
    return result;
82
  }
91
  }
83
  
92
84
  void initializeLaunch( ILaunch genericLaunch ) {
93
  void initializeLaunch( ILaunch genericLaunch ) {
85
    launch = new RWTLaunch( genericLaunch );
94
    launch = new RWTLaunch( genericLaunch );
86
    launch.setPort( determinePort() );
95
    launch.setPort( determinePort() );
(-)src/org/eclipse/rap/ui/internal/launch/rwt/jetty/JettyLauncher.java (+44 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2012 EclipseSource and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    EclipseSource - initial API and implementation
10
 ******************************************************************************/
11
package org.eclipse.rap.ui.internal.launch.rwt.jetty;
12
13
import org.eclipse.jetty.server.Connector;
14
import org.eclipse.jetty.server.Server;
15
import org.eclipse.jetty.server.bio.SocketConnector;
16
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
17
import org.eclipse.jetty.util.URIUtil;
18
import org.eclipse.jetty.util.log.Log;
19
import org.eclipse.jetty.webapp.WebAppContext;
20
21
22
public class JettyLauncher {
23
24
  public static void main( String[] args ) {
25
    try {
26
      Server server = new Server();
27
      ContextHandlerCollection contexts = new ContextHandlerCollection();
28
      server.setHandler( contexts );
29
      SocketConnector connector = new SocketConnector();
30
      connector.setPort( Integer.parseInt( args[ 0 ] ) );
31
      server.setConnectors( new Connector[]{ connector } );
32
33
      WebAppContext webapp = new WebAppContext();
34
      webapp.setWar( args[ 1 ] );
35
      webapp.setContextPath( URIUtil.SLASH );
36
      contexts.addHandler(webapp);
37
38
      server.start();
39
      server.join();
40
    } catch( Exception exception ) {
41
      Log.getLogger( JettyLauncher.class.getName() ).warn( Log.EXCEPTION, exception );
42
    }
43
  }
44
}
(-)src/org/eclipse/rap/ui/internal/launch/rwt/delegate/RWTLaunchDelegate_Test.java (-23 / +34 lines)
Lines 1-12 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2011 Rüdiger Herrmann and others. All rights reserved.
2
 * Copyright (c) 2011, 2012 Rüdiger Herrmann and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Rüdiger Herrmann - initial API and implementation
9
 *    Rüdiger Herrmann - initial API and implementation
10
 *    EclipseSource - ongoing development
10
 ******************************************************************************/
11
 ******************************************************************************/
11
package org.eclipse.rap.ui.internal.launch.rwt.delegate;
12
package org.eclipse.rap.ui.internal.launch.rwt.delegate;
12
13
Lines 27-33 Link Here
27
28
28
29
29
public class RWTLaunchDelegate_Test extends TestCase {
30
public class RWTLaunchDelegate_Test extends TestCase {
30
  
31
31
  private ILaunchConfigurationWorkingCopy launchConfig;
32
  private ILaunchConfigurationWorkingCopy launchConfig;
32
  private RWTLaunchConfig rwtLaunchConfig;
33
  private RWTLaunchConfig rwtLaunchConfig;
33
  private RWTLaunchDelegate launchDelegate;
34
  private RWTLaunchDelegate launchDelegate;
Lines 35-51 Link Here
35
  public void testGetProgramArguments() {
36
  public void testGetProgramArguments() {
36
    String programArgs = "programArgument";
37
    String programArgs = "programArgument";
37
    setProgramArguments( programArgs );
38
    setProgramArguments( programArgs );
38
    
39
39
    String returnedProgramArgs = launchDelegate.getProgramArguments( launchConfig );
40
    String returnedProgramArgs = launchDelegate.getProgramArguments( launchConfig );
40
    
41
41
    assertTrue( returnedProgramArgs.indexOf( "programArgument" ) == -1 );
42
    assertTrue( returnedProgramArgs.indexOf( "programArgument" ) == -1 );
42
  }
43
  }
43
  
44
45
  @SuppressWarnings("unchecked")
44
  public void testGetMainTypeName() {
46
  public void testGetMainTypeName() {
45
    String mainTypeName = launchDelegate.getMainTypeName( launchConfig );
47
    String mainTypeName = launchDelegate.getMainTypeName( launchConfig );
46
    assertEquals( "org.mortbay.jetty.Main", mainTypeName );
48
    ClassLoader loader = RWTLaunchDelegate.class.getClassLoader();
49
    try {
50
      Class jettyLauncher = loader.loadClass( mainTypeName );
51
      jettyLauncher.getDeclaredMethod( "main", String[].class );
52
    } catch( ClassNotFoundException exception ) {
53
      fail( "Unable to load Jetty launcher class: " + mainTypeName );
54
    } catch( NoSuchMethodException exception ) {
55
      fail( "Unable to find main method in Jetty launcher class: " + mainTypeName );
56
    } catch( SecurityException shouldNotHappen ) {
57
    }
47
  }
58
  }
48
  
59
49
  public void testGetVMArguments() throws CoreException {
60
  public void testGetVMArguments() throws CoreException {
50
    String vmArguments = launchDelegate.getVMArguments( launchConfig );
61
    String vmArguments = launchDelegate.getVMArguments( launchConfig );
51
    assertTrue( vmArguments.indexOf( "-Djetty.home=" ) >= 0 );
62
    assertTrue( vmArguments.indexOf( "-Djetty.home=" ) >= 0 );
Lines 54-98 Link Here
54
  public void testGetVMArgumentsWithUserDefinedArgument() throws CoreException {
65
  public void testGetVMArgumentsWithUserDefinedArgument() throws CoreException {
55
    String vmArgument = "-Dfoo=bar";
66
    String vmArgument = "-Dfoo=bar";
56
    setVMArgument( vmArgument );
67
    setVMArgument( vmArgument );
57
    
68
58
    String vmArguments = launchDelegate.getVMArguments( launchConfig );
69
    String vmArguments = launchDelegate.getVMArguments( launchConfig );
59
    
70
60
    assertTrue( vmArguments.indexOf( vmArgument ) >= 0 );
71
    assertTrue( vmArguments.indexOf( vmArgument ) >= 0 );
61
  }
72
  }
62
  
73
63
  public void testGetJavaProject() throws CoreException {
74
  public void testGetJavaProject() throws CoreException {
64
    TestProject testProject = new TestProject();
75
    TestProject testProject = new TestProject();
65
    IJavaProject javaProject = testProject.getJavaProject();
76
    IJavaProject javaProject = testProject.getJavaProject();
66
    rwtLaunchConfig.setProjectName( javaProject.getElementName() );
77
    rwtLaunchConfig.setProjectName( javaProject.getElementName() );
67
    
78
68
    IJavaProject returnedJavaProject = launchDelegate.getJavaProject( launchConfig );
79
    IJavaProject returnedJavaProject = launchDelegate.getJavaProject( launchConfig );
69
    
80
70
    assertEquals( javaProject, returnedJavaProject );
81
    assertEquals( javaProject, returnedJavaProject );
71
  }
82
  }
72
  
83
73
  public void testGetClasspath() throws CoreException {
84
  public void testGetClasspath() throws CoreException {
74
    String[] classpath = launchDelegate.getClasspath( launchConfig );
85
    String[] classpath = launchDelegate.getClasspath( launchConfig );
75
    assertEquals( 3, classpath.length );
86
    assertEquals( 11, classpath.length );
76
  }
87
  }
77
  
88
78
  public void testDeterminePortWhenManualPortConfigured() {
89
  public void testDeterminePortWhenManualPortConfigured() {
79
    int configuredPort = 1234;
90
    int configuredPort = 1234;
80
    rwtLaunchConfig.setUseManualPort( true );
91
    rwtLaunchConfig.setUseManualPort( true );
81
    rwtLaunchConfig.setPort( configuredPort );
92
    rwtLaunchConfig.setPort( configuredPort );
82
    
93
83
    int port = launchDelegate.determinePort();
94
    int port = launchDelegate.determinePort();
84
    
95
85
    assertEquals( configuredPort, port ); 
96
    assertEquals( configuredPort, port );
86
  }
97
  }
87
98
88
  public void testDeterminePortWhenAutomaticPortConfigured() throws IOException {
99
  public void testDeterminePortWhenAutomaticPortConfigured() throws IOException {
89
    rwtLaunchConfig.setUseManualPort( false );
100
    rwtLaunchConfig.setUseManualPort( false );
90
    
101
91
    int port = launchDelegate.determinePort();
102
    int port = launchDelegate.determinePort();
92
    
103
93
    assertTrue( isPortFree( port ) );
104
    assertTrue( isPortFree( port ) );
94
  }
105
  }
95
  
106
96
  protected void setUp() throws Exception {
107
  protected void setUp() throws Exception {
97
    launchConfig = Fixture.createRWTLaunchConfig();
108
    launchConfig = Fixture.createRWTLaunchConfig();
98
    rwtLaunchConfig = new RWTLaunchConfig( launchConfig );
109
    rwtLaunchConfig = new RWTLaunchConfig( launchConfig );
Lines 109-115 Link Here
109
    String attrVmArgs = IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS;
120
    String attrVmArgs = IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS;
110
    launchConfig.setAttribute( attrVmArgs, vmArgument );
121
    launchConfig.setAttribute( attrVmArgs, vmArgument );
111
  }
122
  }
112
  
123
113
  private void setProgramArguments( String value ) {
124
  private void setProgramArguments( String value ) {
114
    String attrProgramArgs = IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS;
125
    String attrProgramArgs = IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS;
115
    launchConfig.setAttribute( attrProgramArgs, value );
126
    launchConfig.setAttribute( attrProgramArgs, value );
(-)src/org/eclipse/rap/ui/internal/launch/rwt/util/BundleFileLocator_Test.java (-6 / +7 lines)
Lines 1-12 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2011 Rüdiger Herrmann and others. All rights reserved.
2
 * Copyright (c) 2011, 2012 Rüdiger Herrmann and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Rüdiger Herrmann - initial API and implementation
9
 *    Rüdiger Herrmann - initial API and implementation
10
 *    EclipseSource - ongoing development
10
 ******************************************************************************/
11
 ******************************************************************************/
11
package org.eclipse.rap.ui.internal.launch.rwt.util;
12
package org.eclipse.rap.ui.internal.launch.rwt.util;
12
13
Lines 18-28 Link Here
18
19
19
20
20
public class BundleFileLocator_Test extends TestCase {
21
public class BundleFileLocator_Test extends TestCase {
21
  
22
22
  public void testLocateWithExistingBundle() {
23
  public void testLocateWithExistingBundle() {
23
    String bundleName = "org.mortbay.jetty.server";
24
    String bundleName = "org.eclipse.jetty.server";
24
    String location = BundleFileLocator.locate( bundleName );
25
    String location = BundleFileLocator.locate( bundleName );
25
    
26
26
    assertNotNull( location );
27
    assertNotNull( location );
27
    File file = new File( location );
28
    File file = new File( location );
28
    assertTrue( file.exists() );
29
    assertTrue( file.exists() );
Lines 31-37 Link Here
31
32
32
  public void testLocateWithNonExistingBundle() {
33
  public void testLocateWithNonExistingBundle() {
33
    String location = BundleFileLocator.locate( "does.not.exist" );
34
    String location = BundleFileLocator.locate( "does.not.exist" );
34
    
35
35
    assertNull( location );
36
    assertNull( location );
36
  }
37
  }
37
}
38
}

Return to bug 371722