Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2012-01-15 13:54:12 +0000
committerEd Merks2012-01-15 13:54:12 +0000
commitcddfae8e6dd4058e14a47a0c34a39790b1968703 (patch)
tree335ff7bb96266e60f5a0128981a62abab4dc2f3e /tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation
parenta12920a0935ff60cadf65e3f3dc3d393ad75de6e (diff)
downloadorg.eclipse.emf-cddfae8e6dd4058e14a47a0c34a39790b1968703.tar.gz
org.eclipse.emf-cddfae8e6dd4058e14a47a0c34a39790b1968703.tar.xz
org.eclipse.emf-cddfae8e6dd4058e14a47a0c34a39790b1968703.zip
[368320] Format using EMF formatting rules
Diffstat (limited to 'tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation')
-rw-r--r--tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java60
1 files changed, 31 insertions, 29 deletions
diff --git a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java
index 0d11842fd..ab5fa7a7a 100644
--- a/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java
+++ b/tests/org.eclipse.emf.test.ecore.xcore/src/org/eclipse/emf/test/ecore/xcore/validation/XcoreValidationTest.java
@@ -7,6 +7,7 @@
*/
package org.eclipse.emf.test.ecore.xcore.validation;
+
import java.util.List;
import org.eclipse.emf.ecore.util.EcoreValidator;
@@ -26,6 +27,7 @@ import org.junit.runner.RunWith;
import com.google.common.collect.Lists;
import com.google.inject.Inject;
+
/**
* There are cases not covered because the grammar doesn't allow it, i.e.,
* {@link EcoreValidator#CONSISTENT_BOUNDS_NOT_ALLOWED},
@@ -59,36 +61,36 @@ import com.google.inject.Inject;
public class XcoreValidationTest
{
- @InjectParameter
- private XtextResource resource;
+ @InjectParameter
+ private XtextResource resource;
- @Inject
- private IResourceValidator validator;
+ @Inject
+ private IResourceValidator validator;
- protected String formatIssue(Issue issue)
- {
- StringBuilder result = new StringBuilder();
- result.append(issue.getSeverity().name().toLowerCase());
- if (issue.getOffset() != null && issue.getLength() != null)
- {
- result.append(" at '");
- result.append(resource.getParseResult().getRootNode().getText()
- .substring(issue.getOffset(), issue.getOffset() + issue.getLength()));
- result.append("' ");
- } else
- result.append(" ");
- result.append("message '");
- result.append(issue.getMessage());
- result.append("'");
- return result.toString();
- }
+ protected String formatIssue(Issue issue)
+ {
+ StringBuilder result = new StringBuilder();
+ result.append(issue.getSeverity().name().toLowerCase());
+ if (issue.getOffset() != null && issue.getLength() != null)
+ {
+ result.append(" at '");
+ result.append(resource.getParseResult().getRootNode().getText().substring(issue.getOffset(), issue.getOffset() + issue.getLength()));
+ result.append("' ");
+ }
+ else
+ result.append(" ");
+ result.append("message '");
+ result.append(issue.getMessage());
+ result.append("'");
+ return result.toString();
+ }
- @XpectLines()
- public List<String> validationIssues()
- {
- List<String> result = Lists.newArrayList();
- for (Issue issue : validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl))
- result.add(formatIssue(issue));
- return result;
- }
+ @XpectLines()
+ public List<String> validationIssues()
+ {
+ List<String> result = Lists.newArrayList();
+ for (Issue issue : validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl))
+ result.add(formatIssue(issue));
+ return result;
+ }
}

Back to the top