Examples of VerificationEngine


Examples of org.openiaml.verification.crocopat.VerificationEngine

  public void test1() throws Exception {
    // load model
    EObject model = loadModelDirectly("src/org/openiaml/verification/crocopat/tests/BigInfiniteLoop-10.iaml");
   
    VerificationEngine engine = new VerificationEngine();
    IStatus result = engine.verify(model, new NullProgressMonitor());
    ModelInferenceTestCase.assertStatusIsNotOK(result);
 
    // there should be violations
    List<VerificationViolation> violations = engine.getViolations();
    assertNotNull("Violations should not be null", violations);
   
    // there should be ten
    assertEquals("there should be 10 violations", 10, violations.size());
   
View Full Code Here

Examples of org.openiaml.verification.crocopat.VerificationEngine

    // we only want to deal with InternetApplications (root)   
    if (!eClass.equals(ModelPackage.eINSTANCE.getInternetApplication())) {
      return true;
    }
   
    VerificationEngine verify = new VerificationEngine();
    try {
      IStatus result = verify.verify(eObject, new NullProgressMonitor());
     
      if (result.isOK()) {
        // everything was fine
        return true;
      }
     
      // add diagnoses to all of the failing objects
      for (VerificationViolation violation : verify.getViolations()) {
        diagnostics.add(new BasicDiagnostic(
            Diagnostic.WARNING, /* severity */
            "org.openiaml.model.actions", /* source */
            0, /* code */
            violation.getMessage(), /* message */
 
View Full Code Here

Examples of org.openiaml.verification.crocopat.VerificationEngine

    // do inference on the model
    model = resource.getContents().get(0);
    monitor.worked(1);

    // do verification
    VerificationEngine verify = new VerificationEngine();
    IStatus status;
    try {
      status = verify.verify(model, new SubProgressMonitor(monitor, 9));
    } catch (VerificationException e) {
      return errorStatus(e);
    }
   
    // check for violation exceptions
    if (!verify.getViolations().isEmpty()) {     
      StringBuffer buf = new StringBuffer();
     
      for (int i = 0; i < 5 && i < verify.getViolations().size(); i++) {
        VerificationViolation violation = verify.getViolations().get(i);
        if (i != 0)
          buf.append("\n");
       
        buf.append(violation.getMessage())
          .append(": ");
       
        for (int j = 0; j < violation.getObjects().size(); j++) {
          if (j != 0)
            buf.append("; ");
          buf.append(IamlBreadcrumb.breadcrumb(violation.getObjects().get(j)));
        }
      }
     
      if (verify.getViolations().size() > 5) {
        // there are more
        buf.append("\n(...")
          .append(verify.getViolations().size() - 5)
          .append(" more)");       
      }
     
      // return the error
      return errorStatus("Verification failed:\n\n" + buf.toString());
View Full Code Here

Examples of org.openiaml.verification.nusmv.VerificationEngine

    // do inference on the model
    model = resource.getContents().get(0);
    monitor.worked(1);

    // do verification
    VerificationEngine verify = new VerificationEngine();
    IStatus status;
    try {
      status = verify.verify(model, new SubProgressMonitor(monitor, 9));
    } catch (VerificationException e) {
      return errorStatus(e);
    }

    // check for violation exceptions
    if (!verify.getViolations().isEmpty()) {
      final StringBuffer buf = new StringBuffer();

      for (int i = 0; i < 5 && i < verify.getViolations().size(); i++) {
        NuSMVViolation violation = verify.getViolations().get(i);
        if (i != 0)
          buf.append("\n");

        buf.append(violation.getMessage());

      }

      if (verify.getViolations().size() > 5) {
        // there are more
        buf.append("\n(...").append(verify.getViolations().size() - 5)
            .append(" more)");
      }
     
      Display.getDefault().asyncExec(new Runnable() {
View Full Code Here

Examples of org.openiaml.verification.nusmv.VerificationEngine

   */
  protected List<NuSMVViolation> assertValid(String modelFile, int violationsSize) throws VerificationException {
    EObject model = loadModelDirectly(modelFile);
    assertNotNull(model);
   
    VerificationEngine engine = new VerificationEngine(true);
   
    return assertValid(model, violationsSize, engine);
  }
View Full Code Here

Examples of org.openiaml.verification.nusmv.VerificationEngine

   */
  protected List<NuSMVViolation> assertValid(String modelFile, int violationsSize, final String ltlspec) throws VerificationException {
    EObject model = loadModelDirectly(modelFile);
    assertNotNull(model);
   
    VerificationEngine engine = new VerificationEngine(true) {

      @Override
      public List<VerificationRule> getVerificationRules() {
        VerificationRule rule = new StringVerificationRule(ltlspec);
        return Collections.singletonList(rule);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.