Skip to content

Package: PlayerValidatorHeight

PlayerValidatorHeight

nameinstructionbranchcomplexitylinemethod
PlayerValidatorHeight()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getValidatedEClassifier()
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
validate(EClass, EObject, DiagnosticChain, Map)
M: 0 C: 22
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH 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: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.validation.diagnostician.test;
15:
16: import java.util.LinkedHashSet;
17: import java.util.Map;
18: import java.util.Set;
19:
20: import org.eclipse.emf.common.util.Diagnostic;
21: import org.eclipse.emf.common.util.DiagnosticChain;
22: import org.eclipse.emf.ecore.EClass;
23: import org.eclipse.emf.ecore.EClassifier;
24: import org.eclipse.emf.ecore.EObject;
25: import org.eclipse.emf.ecp.diagnostician.ECPValidator;
26: import org.eclipse.emf.emfstore.bowling.BowlingPackage;
27:
28: /**
29: * @author jfaltermeier
30: *
31: */
32: public class PlayerValidatorHeight extends ECPValidator {
33:
34:         /**
35:          * {@inheritDoc}
36:          *
37:          * @see org.eclipse.emf.ecp.diagnostician.ECPValidator#getValidatedEClassifier()
38:          */
39:         @Override
40:         public Set<EClassifier> getValidatedEClassifier() {
41:                 final Set<EClassifier> classifiers = new LinkedHashSet<EClassifier>();
42:                 classifiers.add(BowlingPackage.eINSTANCE.getPlayer());
43:                 return classifiers;
44:         }
45:
46:         /**
47:          * {@inheritDoc}
48:          *
49:          * @see org.eclipse.emf.ecp.diagnostician.ECPValidator#validate(org.eclipse.emf.ecore.EClass,
50:          * org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)
51:          */
52:         @Override
53:         public boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) {
54:                 diagnostics.add(createDiagnostic(Diagnostic.WARNING, "source", 0, "Height", new Object[] { eObject,
55:                         BowlingPackage.eINSTANCE.getPlayer_Height() }, context));
56:                 return false;
57:         }
58:
59: }