]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/commands/AssertModelIssueCount.java
Small but effective HiDPI fixes for platform G2D
[simantics/platform.git] / bundles / org.simantics.modeling.tests / src / org / simantics / modeling / tests / commands / AssertModelIssueCount.java
1 package org.simantics.modeling.tests.commands;
2
3 import java.util.Set;
4
5 import junit.framework.Assert;
6
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;
14
15 public class AssertModelIssueCount extends WriteCommand<ModelingCommandSequenceTest> {
16
17         private SingleModelTrait model;
18         private int expected;
19         
20         public AssertModelIssueCount(SingleModelTrait model, int expected) {
21                 this.model = model;
22                 this.expected = expected;
23         }
24         
25         @Override
26         protected void run(WriteGraph graph, ModelingCommandSequenceTest environment) throws DatabaseException {
27                 
28                 Set<Resource> issues = graph.sync(new AllModelIssues(model.getResource()));
29                 Assert.assertEquals(expected, issues.size());
30         
31         }
32
33 }