Skip to content

Package: ECPDirtyTester

ECPDirtyTester

nameinstructionbranchcomplexitylinemethod
ECPDirtyTester()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
test(Object, String, Object[], Object)
M: 14 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2012 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: * Eugen Neufeld - initial API and implementation
13: *
14: *******************************************************************************/
15: package org.eclipse.emf.ecp.internal.core.util;
16:
17: import org.eclipse.core.expressions.PropertyTester;
18: import org.eclipse.emf.ecp.core.ECPProject;
19: import org.eclipse.emf.ecp.core.util.ECPUtil;
20:
21: /**
22: * Tests weather a project is dirty.
23: *
24: * @author Tobias Verhoeven
25: */
26: public class ECPDirtyTester extends PropertyTester {
27:
28:         /**
29:          * {@inheritDoc}
30:          *
31:          * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[],
32:          * java.lang.Object)
33:          */
34:         @Override
35:         public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
36:                 final ECPProject project = ECPUtil.getECPProjectManager().getProject(receiver);
37:
38:•                if (project == null) {
39:                         return false;
40:                 }
41:
42:                 return Boolean.valueOf(project.hasDirtyContents()).equals(expectedValue);
43:         }
44: }