public class ModelValidator extends Object
Usage:
@Test public void testModelValid() throws IOException, GenerationException { InputStream inputStream = getClass().getResourceAsStream("/mymodel.zip"); try { ModelValidator validator = new ModelValidator(); Diagnostic diagnostic = validator.validate(inputStream); if (diagnostic.getSeverity() >= Diagnostic.ERROR) { Assert.fail("Model is not valid:\n" + validator.getComposedErrorMessage(diagnostic)); } } finally { inputStream.close(); } }
Constructor and Description |
---|
ModelValidator() |
ModelValidator(com.whitestein.lsps.generation.validator.LSPSValidator validator) |
ModelValidator(com.whitestein.lsps.generation.validator.LSPSValidator validator,
List<com.whitestein.lsps.generation.SourceProvider> sourceProviderList) |
Modifier and Type | Method and Description |
---|---|
String |
getComposedErrorMessage(org.eclipse.emf.common.util.Diagnostic diagnostic) |
static List<com.whitestein.lsps.generation.SourceProvider> |
getDefaultSourceProviders() |
List<String> |
getErrorMessages(org.eclipse.emf.common.util.Diagnostic diagnostic) |
List<String> |
getValidationMessages(org.eclipse.emf.common.util.Diagnostic diagnostic,
int severity) |
org.eclipse.emf.common.util.Diagnostic |
validate(InputStream inputStream) |
public ModelValidator()
public ModelValidator(com.whitestein.lsps.generation.validator.LSPSValidator validator)
public ModelValidator(com.whitestein.lsps.generation.validator.LSPSValidator validator, List<com.whitestein.lsps.generation.SourceProvider> sourceProviderList)
public org.eclipse.emf.common.util.Diagnostic validate(InputStream inputStream) throws IOException, com.whitestein.lsps.generation.GenerationException
IOException
com.whitestein.lsps.generation.GenerationException
public static List<com.whitestein.lsps.generation.SourceProvider> getDefaultSourceProviders()
public String getComposedErrorMessage(org.eclipse.emf.common.util.Diagnostic diagnostic)
public List<String> getErrorMessages(org.eclipse.emf.common.util.Diagnostic diagnostic)
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.