1 package org.simantics.modeling.tests.commands;
5 import junit.framework.Assert;
7 import org.simantics.db.Resource;
8 import org.simantics.db.WriteGraph;
9 import org.simantics.db.exception.DatabaseException;
10 import org.simantics.db.testing.common.WriteCommand;
11 import org.simantics.issues.common.AllModelIssues;
12 import org.simantics.modeling.tests.cases.ModelingCommandSequenceTest;
13 import org.simantics.modeling.tests.traits.SingleModelTrait;
15 public class AssertModelIssueCount extends WriteCommand<ModelingCommandSequenceTest> {
17 private SingleModelTrait model;
20 public AssertModelIssueCount(SingleModelTrait model, int expected) {
22 this.expected = expected;
26 protected void run(WriteGraph graph, ModelingCommandSequenceTest environment) throws DatabaseException {
28 Set<Resource> issues = graph.sync(new AllModelIssues(model.getResource()));
29 Assert.assertEquals(expected, issues.size());