forked from eclipse/Xpect
-
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.
Extract parts of XpectRunner singleton
This change extracts parts of the singleton XpectRunner to another class, so that other implementations can set the values of the singleton. This change is required, in order to provide alternatives of XpectRunner, such as a JUnit 5 alternative, without depending on XpectRunner. Preparation for: eclipse#262
- Loading branch information
1 parent
56f9d5d
commit e9656eb
Showing
7 changed files
with
58 additions
and
10 deletions.
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
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
38 changes: 38 additions & 0 deletions
38
org.eclipse.xpect/src/org/eclipse/xpect/runner/XpectTestGlobalState.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,38 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Simeon Andreev and others. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Simeon Andreev - Initial contribution and API | ||
*******************************************************************************/ | ||
package org.eclipse.xpect.runner; | ||
|
||
import org.eclipse.xpect.XpectJavaModel; | ||
|
||
/** | ||
* @author Simeon Andreev - Initial contribution and API | ||
*/ | ||
public class XpectTestGlobalState { | ||
|
||
public static final XpectTestGlobalState INSTANCE = new XpectTestGlobalState(); | ||
|
||
private XpectJavaModel model; | ||
private Class<?> testClass; | ||
|
||
public void set(XpectJavaModel model, Class<?> testClass) { | ||
this.model = model; | ||
this.testClass = testClass; | ||
} | ||
|
||
public XpectJavaModel model() { | ||
return model; | ||
} | ||
|
||
public Class<?> testClass() { | ||
return testClass; | ||
} | ||
} |
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
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