Browse Source

New PrismNotSupportedException, to be throw when a model/prop/engine combination is not supported. Displays as UNSUPPORTED, not FAIL, in test mode. [from Joachim Klein]

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@9998 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 11 years ago
parent
commit
88928e8b89
  1. 5
      prism/src/parser/ast/Property.java
  2. 2
      prism/src/prism/PrismCL.java
  3. 39
      prism/src/prism/PrismNotSupportedException.java

5
prism/src/parser/ast/Property.java

@ -35,6 +35,7 @@ import parser.type.*;
import parser.visitor.*;
import prism.PrismException;
import prism.PrismLangException;
import prism.PrismNotSupportedException;
import prism.PrismUtils;
/**
@ -254,6 +255,10 @@ public class Property extends ASTElement
}
// Check for exceptions
if (result instanceof PrismNotSupportedException) {
// not supported -> handle in caller
throw (PrismNotSupportedException)result;
}
if (result instanceof Exception) {
String errMsg = ((Exception) result).getMessage();
if (strExpected.startsWith("Error")) {

2
prism/src/prism/PrismCL.java

@ -401,6 +401,8 @@ public class PrismCL implements PrismModelListener
} else {
mainLog.println("Testing result: NOT TESTED");
}
} catch (PrismNotSupportedException e) {
mainLog.println("Testing result: UNSUPPORTED: " + e.getMessage());
} catch (PrismException e) {
mainLog.println("Testing result: FAIL: " + e.getMessage());
if (testExitsOnFail)

39
prism/src/prism/PrismNotSupportedException.java

@ -0,0 +1,39 @@
//==============================================================================
//
// Copyright (c) 2002-
// Authors:
// * Joachim Klein <klein@tcs.inf.tu-dresden.de> (TU Dresden)
//
//------------------------------------------------------------------------------
//
// This file is part of PRISM.
//
// PRISM is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// PRISM is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with PRISM; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//==============================================================================
package prism;
/**
* An exception indicating that a given feature is (currently) not supported,
* e.g., a given combination of model type, engine and property.
*/
public class PrismNotSupportedException extends PrismException
{
public PrismNotSupportedException(String s)
{
super(s);
}
}
Loading…
Cancel
Save