forked from eclipse-platform/eclipse.platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid session test customization instantiation in remote execution ec…
…lipse-platform#903 Currently, the SessionTestExtension with all its customizations is not only instantiated in the test-executing host application but also in every remote Eclipse application that is started to run a test case in an isolated session. Even though the current implementation already considers this during execution of the extensions and accesses to the customizations, it would be preferable to even only instantiate them if required. This change introduces dummy implementations for the session test customizations that are used during remote execution to avoid unnecessary overhead. Contributes to eclipse-platform#903
- Loading branch information
1 parent
c7b3002
commit 29d6edf
Showing
5 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...org/eclipse/core/tests/harness/session/customization/CustomSessionConfigurationDummy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Vector Informatik GmbH and others. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package org.eclipse.core.tests.harness.session.customization; | ||
|
||
import java.nio.file.Path; | ||
import org.eclipse.core.tests.harness.session.CustomSessionConfiguration; | ||
import org.eclipse.core.tests.session.Setup; | ||
import org.osgi.framework.Bundle; | ||
|
||
public class CustomSessionConfigurationDummy implements CustomSessionConfiguration { | ||
|
||
private Path configurationDirectory; | ||
|
||
public CustomSessionConfigurationDummy() { | ||
} | ||
|
||
@Override | ||
public CustomSessionConfiguration setCascaded() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public CustomSessionConfiguration setReadOnly() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public Path getConfigurationDirectory() { | ||
return configurationDirectory; | ||
} | ||
|
||
@Override | ||
public CustomSessionConfiguration setConfigurationDirectory(Path configurationDirectory) { | ||
this.configurationDirectory = configurationDirectory; | ||
return this; | ||
} | ||
|
||
@Override | ||
public void prepareSession(Setup setup) { | ||
// Do nothing | ||
} | ||
|
||
@Override | ||
public void cleanupSession(Setup setup) { | ||
// Do nothing | ||
} | ||
|
||
@Override | ||
public CustomSessionConfiguration addBundle(Class<?> classFromBundle) { | ||
return this; | ||
} | ||
|
||
@Override | ||
public CustomSessionConfiguration addBundle(Bundle bundle) { | ||
return this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...src/org/eclipse/core/tests/harness/session/customization/CustomSessionWorkspaceDummy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Vector Informatik GmbH and others. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package org.eclipse.core.tests.harness.session.customization; | ||
|
||
import java.nio.file.Path; | ||
import org.eclipse.core.tests.harness.session.CustomSessionWorkspace; | ||
import org.eclipse.core.tests.session.Setup; | ||
|
||
/** | ||
* A session customization to use a custom workspace directory. | ||
*/ | ||
public class CustomSessionWorkspaceDummy implements CustomSessionWorkspace { | ||
private Path workspaceDirectory; | ||
|
||
public CustomSessionWorkspaceDummy() { | ||
// nothing to initialize | ||
} | ||
|
||
@Override | ||
public CustomSessionWorkspace setWorkspaceDirectory(Path workspaceDirectory) { | ||
this.workspaceDirectory = workspaceDirectory; | ||
return this; | ||
} | ||
|
||
@Override | ||
public Path getWorkspaceDirectory() { | ||
return workspaceDirectory; | ||
} | ||
|
||
@Override | ||
public void prepareSession(Setup setup) throws Exception { | ||
// do nothing | ||
} | ||
|
||
@Override | ||
public void cleanupSession(Setup setup) throws Exception { | ||
// do nothing | ||
} | ||
|
||
} |