Skip to content

Package: EMock

EMock

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2019 Christian W. Damus and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Christian W. Damus - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.test.common.spi;
15:
16: import static java.lang.annotation.ElementType.FIELD;
17: import static java.lang.annotation.RetentionPolicy.RUNTIME;
18:
19: import java.lang.annotation.Documented;
20: import java.lang.annotation.Retention;
21: import java.lang.annotation.Target;
22:
23: import org.eclipse.emf.ecore.EObject;
24: import org.mockito.Answers;
25: import org.mockito.Mock;
26:
27: /**
28: * Analogue of the {@link Mock} annotation that indicates a mock of {@link EObject} type
29: * to be injected. It ensures that all of the interfaces expected by the EMF run-time are
30: * provided, so therefore it does not have the {@link Mock#extraInterfaces()} attribute as
31: * it would be unusual to mix in any other interfaces to an EMF model object.
32: *
33: * @since 1.22
34: */
35: @Documented
36: @Retention(RUNTIME)
37: @Target(FIELD)
38: public @interface EMock {
39:
40:         String name() default "";
41:
42:         Answers answer() default Answers.RETURNS_DEFAULTS;
43:
44: }