Пример #1
0
  /** Composability Test. Test network component with single base component */
  @Test
  public void testModelSingleNetworkComponent() {
    String path = UNIT_BASEDIR + "comp_single_network/";

    Configuration c = flatten(SpaceExImporter.importModels(path + "sys.cfg", path + "sys.xml"));

    ToolPrinter tp = new FlowPrinter();

    tp.setOutputNone();
    tp.print(c, "", "");
  }
Пример #2
0
  /** Models with variables should not be rejected */
  @Test
  public void testModelHasVarsAcceptance() {
    String path = UNIT_BASEDIR + "no_vars_check/";

    Configuration c =
        flatten(SpaceExImporter.importModels(path + "has_vars.cfg", path + "has_vars.xml"));

    ToolPrinter tp = new FlowPrinter();

    tp.setOutputNone();
    tp.print(c, "", "");
  }
Пример #3
0
  /**
   * Models with blank forbidden states should be allowed (spaceex includes examples of these, like
   * heli)
   */
  @Test
  public void testModelBlankForbidden() {
    String path = UNIT_BASEDIR + "blank_forbidden/";

    Configuration c =
        flatten(
            SpaceExImporter.importModels(
                path + "blank_forbidden.cfg", path + "blank_forbidden.xml"));

    ToolPrinter tp = new FlowPrinter();

    tp.setOutputNone();
    tp.print(c, "", "");
  }
Пример #4
0
  @Test
  public void testOpenIntervalPrintFail() {
    // printing models with nondeterministic assignments to open intervals
    // should fail

    String path = UNIT_BASEDIR + "nondeterm_reset_open/";

    try {
      Configuration c = flatten(SpaceExImporter.importModels(path + "sys.cfg", path + "sys.xml"));

      ToolPrinter tp = new SpaceExPrinter();

      tp.setOutputNone();
      tp.print(c, "", "");

      Assert.fail("AutomatonExportException not thrown");
    } catch (AutomatonExportException e) {
      // expected
    }
  }
Пример #5
0
  /**
   * For Flow*, models require at least one variable. Thus, printing such models with a tool like
   * Flow* should raise a precondition error
   */
  @Test
  public void testModelNoVars() {
    String path = UNIT_BASEDIR + "no_vars_check/";

    Configuration c =
        flatten(SpaceExImporter.importModels(path + "discrete.cfg", path + "discrete.xml"));

    // use flow* as an example printer that needs at least one variable,
    // which should raise an error
    ToolPrinter tp = new FlowPrinter();

    tp.setOutputNone();

    try {
      tp.print(c, "", "");

      Assert.fail("precondition exception not raised for model with no variables");
    } catch (PreconditionsFailedException e) {
      // expected
    }
  }