Skip to content
Snippets Groups Projects
Commit b96caf18 authored by Daniel Ratiu's avatar Daniel Ratiu
Browse files

starting JUnit tests for the constraints checker of state machines

refs 1496
parent b3d2b92b
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ package org.fortiss.tooling.kernel.ui.internal;
import static java.util.Collections.emptyList;
import static org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator.getImageDescriptor;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.postRefreshNotification;
import static org.fortiss.tooling.kernel.utils.ServicesUtils.performAllConstraintChecksRecursively;
import java.util.ArrayList;
import java.util.Collection;
......@@ -46,7 +47,6 @@ import org.eclipse.ui.progress.UIJob;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IConstraintCheckerService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener;
import org.fortiss.tooling.kernel.ui.ESharedImages;
......@@ -59,7 +59,7 @@ import org.fortiss.tooling.kernel.ui.service.IMarkerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 5F88E90183F4CA6A1EDE3C733CA38149
* @ConQAT.Rating YELLOW Hash: EBB48CFD49BC6889431671D4ED54E9F4
*/
public class MarkerService implements IMarkerService, IPersistencyServiceListener,
ILightweightLabelDecorator {
......@@ -183,9 +183,10 @@ public class MarkerService implements IMarkerService, IPersistencyServiceListene
@Override
public void refreshMarkers(ITopLevelElement element) {
EObject rootModelElement = element.getRootModelElement();
List<IConstraintViolation<? extends EObject>> checkResult =
IConstraintCheckerService.INSTANCE.performAllConstraintChecksRecursively(element
.getRootModelElement());
performAllConstraintChecksRecursively(rootModelElement);
synchronized(violationCache) {
CacheEntry entry = getCacheEntry(element);
entry.updateCacheEntries(checkResult);
......
/*--------------------------------------------------------------------------+
$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
| |
| Copyright 2013 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.utils;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
import org.fortiss.tooling.kernel.service.IConstraintCheckerService;
/**
* Utility methods to ease the access to kernel services.
*
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 18709 $
* @ConQAT.Rating YELLOW Hash: 76E1D6B3AE7CF160BECFA6AADA85D8D8
*/
public class ServicesUtils {
/** Proxy for {@link IConstraintCheckerService#performAllConstraintChecksRecursively(EObject)} */
public static List<IConstraintViolation<? extends EObject>>
performAllConstraintChecksRecursively(EObject modelElement) {
return IConstraintCheckerService.INSTANCE
.performAllConstraintChecksRecursively(modelElement);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment