-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test dependencies to be able to execute with Java 17
- Retrieve newer test dependencies from 2022-12 orbit and consume missing via org.eclipse.emfcloud.modelserver.tests bundle - Add hamcrest dependency libs to tests bundle, as there is otherwise a plugin clash as junit consumes the former 1.3 version - Introduce MockitoUtil that replaces Mockito's internal 'FieldSetter' class (which was removed with the newer version)
- Loading branch information
Showing
20 changed files
with
132 additions
and
46 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
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
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
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
Binary file added
BIN
+81.5 KB
tests/org.eclipse.emfcloud.modelserver.tests/lib/hamcrest-2.2-sources.jar
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+1.55 KB
tests/org.eclipse.emfcloud.modelserver.tests/lib/hamcrest-core-2.2-sources.jar
Binary file not shown.
Binary file added
BIN
+1.46 KB
tests/org.eclipse.emfcloud.modelserver.tests/lib/hamcrest-core-2.2.jar
Binary file not shown.
Binary file removed
BIN
-1.54 KB
tests/org.eclipse.emfcloud.modelserver.tests/lib/mockito-inline-3.2.4-sources.jar
Binary file not shown.
Binary file removed
BIN
-1.26 KB
tests/org.eclipse.emfcloud.modelserver.tests/lib/mockito-inline-3.2.4.jar
Binary file not shown.
Binary file added
BIN
+1.47 KB
tests/org.eclipse.emfcloud.modelserver.tests/lib/mockito-inline-4.8.1-sources.jar
Binary file not shown.
Binary file added
BIN
+1.47 KB
tests/org.eclipse.emfcloud.modelserver.tests/lib/mockito-inline-4.8.1.jar
Binary file not shown.
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
40 changes: 40 additions & 0 deletions
40
...fcloud.modelserver.tests/src/org/eclipse/emfcloud/modelserver/tests/util/MockitoUtil.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,40 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2023 EclipseSource and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0, or the MIT License which is | ||
* available at https://opensource.org/licenses/MIT. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR MIT | ||
********************************************************************************/ | ||
package org.eclipse.emfcloud.modelserver.tests.util; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
/** | ||
* Additional Mockito utils. | ||
*/ | ||
public final class MockitoUtil { | ||
|
||
/** | ||
* Not instantiable by clients. | ||
*/ | ||
private MockitoUtil() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Replaces Mockito's removed internal 'FieldSetter' class. | ||
* Was formerly imported via 'import org.mockito.internal.util.reflection.FieldSetter;' | ||
*/ | ||
public static void setField(final Object object, final Field field, final Object value) { | ||
try { | ||
field.setAccessible(true); | ||
field.set(object, value); | ||
} catch (IllegalAccessException e) { | ||
throw new RuntimeException("Failed to set value for field '" + field.getName() + "' of object", e); | ||
} | ||
} | ||
|
||
} |