|
From: <sar...@us...> - 2014-09-25 14:32:35
|
Revision: 21159
http://sourceforge.net/p/sbml/code/21159
Author: sarahkeating
Date: 2014-09-25 14:32:32 +0000 (Thu, 25 Sep 2014)
Log Message:
-----------
added a new option to the CompFlatteningConverter to allow any p[ackage to be stripped
did a first pass at getting comp flattening to use flags from the converter; adding a large number of tests some of which do not as yet pass; they are commented out for now
Modified Paths:
--------------
trunk/libsbml/src/sbml/SBase.cpp
trunk/libsbml/src/sbml/SBase.h
trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp
trunk/libsbml/src/sbml/packages/comp/util/CompFlatteningConverter.cpp
trunk/libsbml/src/sbml/packages/comp/util/CompFlatteningConverter.h
trunk/libsbml/src/sbml/packages/comp/util/test/TestRunner.c
Added Paths:
-----------
trunk/libsbml/src/sbml/packages/comp/util/test/TestCompFlatteningConverterStripPackage.cpp
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc_layout.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc_no_comp.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_layout.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_layout_no_comp.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_req_unknown.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_req_unknown_no_comp.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_unreq_unknown.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_unreq_unknown_no_comp.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat_fbc_added.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat_fbc_removed.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_no_comp.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_only.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat_both_removed.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat_fbc_removed.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat_layout_removed.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/layout_in_external.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/layout_in_external_flat.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/layout_in_external_flat_layout_added.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/layout_in_external_flat_layout_removed.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/layout_in_external_no_comp.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/layout_in_external_only.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/layout_in_submodels.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/layout_in_submodels_flat_layout_removed.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/req_unknown_in_external.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/req_unknown_in_external_flat_unknown_removed.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/req_unknown_in_external_no_comp.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/req_unknown_in_external_only.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/unreq_unknown_in_external.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/unreq_unknown_in_external_flat_unknown_removed.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/unreq_unknown_in_external_no_comp.xml
trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/unreq_unknown_in_external_only.xml
Modified: trunk/libsbml/src/sbml/SBase.cpp
===================================================================
--- trunk/libsbml/src/sbml/SBase.cpp 2014-09-25 14:12:02 UTC (rev 21158)
+++ trunk/libsbml/src/sbml/SBase.cpp 2014-09-25 14:32:32 UTC (rev 21159)
@@ -3020,6 +3020,14 @@
}
+SBasePlugin*
+SBase::getDisabledPlugin(unsigned int n)
+{
+ if (n>=getNumDisabledPlugins()) return NULL;
+ return mDisabledPlugins[n];
+}
+
+
/*
* Returns a plugin object (extenstion interface) of package extension
* with the given package name or URI.
@@ -3036,6 +3044,13 @@
}
+const SBasePlugin*
+SBase::getDisabledPlugin(unsigned int n) const
+{
+ return const_cast<SBase*>(this)->getDisabledPlugin(n);
+}
+
+
/*
* Returns the number of plugin objects of package extensions.
*
Modified: trunk/libsbml/src/sbml/SBase.h
===================================================================
--- trunk/libsbml/src/sbml/SBase.h 2014-09-25 14:12:02 UTC (rev 21158)
+++ trunk/libsbml/src/sbml/SBase.h 2014-09-25 14:32:32 UTC (rev 21159)
@@ -2658,6 +2658,40 @@
/**
+ * Returns the nth disabled plug-in object (extension interface) for an SBML Level 3
+ * package extension.
+ *
+ * @copydetails doc_what_are_plugins
+ *
+ * @param n the index of the disabled plug-in to return
+ *
+ * @return the nth disabled plug-in object (the libSBML extension interface) of a
+ * package extension.
+ *
+ * @see getNumDisabledPlugins()
+ * @see getPlugin(@if java String@else const std::string& package@endif)
+ */
+ SBasePlugin* getDisabledPlugin(unsigned int n);
+
+
+ /**
+ * Returns the nth disabled plug-in object (extension interface) for an SBML Level 3
+ * package extension.
+ *
+ * @copydetails doc_what_are_plugins
+ *
+ * @param n the index of the disabled plug-in to return
+ *
+ * @return the nth disabled plug-in object (the libSBML extension interface) of a
+ * package extension.
+ *
+ * @see getNumDisabledPlugins()
+ * @see getPlugin(@if java String@else const std::string& package@endif)
+ */
+ const SBasePlugin* getDisabledPlugin(unsigned int n) const;
+
+
+ /**
* Returns the number of plug-in objects (extenstion interfaces) for SBML
* Level 3 package extensions known.
*
Modified: trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp 2014-09-25 14:12:02 UTC (rev 21158)
+++ trunk/libsbml/src/sbml/packages/comp/sbml/Submodel.cpp 2014-09-25 14:32:32 UTC (rev 21159)
@@ -929,7 +929,14 @@
mInstantiatedModel->enablePackageInternal(getPackageURI(), getPrefix(), true);
}
-
+ // disable any packages that were disabled on the rootdoc
+ for (unsigned int n = 0; n < rootdoc->getNumDisabledPlugins(); n++)
+ {
+ SBasePlugin * plugin = rootdoc->getDisabledPlugin(n);
+
+ mInstantiatedModel->enablePackageInternal(plugin->getURI(),
+ plugin->getPrefix(), false);
+ }
CompModelPlugin* origmodplug =
static_cast<CompModelPlugin*>(rootdoc->getModel()->getPlugin(getPrefix()));
Modified: trunk/libsbml/src/sbml/packages/comp/util/CompFlatteningConverter.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/CompFlatteningConverter.cpp 2014-09-25 14:12:02 UTC (rev 21158)
+++ trunk/libsbml/src/sbml/packages/comp/util/CompFlatteningConverter.cpp 2014-09-25 14:32:32 UTC (rev 21159)
@@ -39,6 +39,7 @@
#include <sbml/packages/comp/common/CompExtensionTypes.h>
#include <sbml/SBMLWriter.h>
#include <sbml/SBMLReader.h>
+#include <sbml/util/IdList.h>
#ifdef __cplusplus
@@ -111,6 +112,8 @@
"specify whether to abort if any unflattenable packages are encountered");
prop.addOption("stripUnflattenablePackages", true,
"specify whether to strip any unflattenable packages ignored by 'abortIfUnflattenable'");
+ prop.addOption("stripPackages", "",
+ "comma separated list of packages to be stripped before flattening is attempted");
return prop;
}
@@ -149,7 +152,14 @@
return LIBSBML_OPERATION_SUCCESS;
}
- // look at the document and work out the status of any packages
+ // strip packages as instructed by user
+ int success = stripPackages();
+ if (success != LIBSBML_OPERATION_SUCCESS)
+ {
+ return LIBSBML_OPERATION_FAILED;
+ }
+
+ // look at the document and work out the status of any remaining packages
mPackageValues.clear();
analyseDocument();
@@ -639,6 +649,27 @@
}
+const std::string&
+CompFlatteningConverter::getPackagesToStrip() const
+{
+ static std::string empty = "";
+
+ if (getProperties() == NULL)
+ {
+ return empty;
+ }
+ else if (getProperties()->hasOption("stripPackages") == false)
+ {
+ return empty;
+ }
+ else
+ {
+ return getProperties()->getValue("stripPackages");
+ }
+}
+
+
+
void
CompFlatteningConverter::stripUnflattenablePackages()
{
@@ -723,6 +754,53 @@
}
}
+int
+CompFlatteningConverter::stripPackages()
+{
+ IdList pkgsToStrip(getPackagesToStrip());
+
+ unsigned int num = pkgsToStrip.size();
+
+ if (num == 0)
+ {
+ return LIBSBML_OPERATION_SUCCESS;
+ }
+
+ XMLNamespaces *ns = mDocument->getSBMLNamespaces()->getNamespaces();
+ for (int i = 0; i < ns->getLength(); i++)
+ {
+ std::string nsURI = ns->getURI(i);
+ std::string package = ns->getPrefix(i);
+ if (package.empty() == true)
+ {
+ continue;
+ }
+ else if (pkgsToStrip.contains(package) == true)
+ {
+ mDocument->enablePackage(nsURI, package, false);
+ mDisabledPackages.insert(make_pair(nsURI, package));
+ }
+ }
+
+ unsigned int count = 0;
+ for (unsigned int i = 0; i < num; i++)
+ {
+ if (mDocument->isPackageEnabled(pkgsToStrip.at(i)) == false)
+ {
+ count++;
+ }
+ }
+
+ if (num == count)
+ {
+ return LIBSBML_OPERATION_SUCCESS;
+ }
+ else
+ {
+ return LIBSBML_OPERATION_FAILED;
+ }
+}
+
bool
CompFlatteningConverter::canBeFlattened()
{
Modified: trunk/libsbml/src/sbml/packages/comp/util/CompFlatteningConverter.h
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/CompFlatteningConverter.h 2014-09-25 14:12:02 UTC (rev 21158)
+++ trunk/libsbml/src/sbml/packages/comp/util/CompFlatteningConverter.h 2014-09-25 14:32:32 UTC (rev 21159)
@@ -254,6 +254,8 @@
private:
+ int stripPackages();
+
int reconstructDocument(Model* flatmodel);
int reconstructDocument(Model* flatmodel,
@@ -277,6 +279,8 @@
bool getAbortForNone() const;
+ const std::string& getPackagesToStrip() const;
+
bool canBeFlattened();
void restoreNamespaces();
Added: trunk/libsbml/src/sbml/packages/comp/util/test/TestCompFlatteningConverterStripPackage.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/TestCompFlatteningConverterStripPackage.cpp (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/TestCompFlatteningConverterStripPackage.cpp 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,572 @@
+/**
+ * \file TestCompFlatteningConverterStripPackage.cpp
+ * \brief Implementation of the Tests for the Comp flattening converter
+ * \author Frank T. Bergmann
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2013-2014 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
+ * 3. University of Heidelberg, Heidelberg, Germany
+ *
+ * Copyright 2011-2012 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/common/common.h>
+
+#include <sbml/packages/comp/common/CompExtensionTypes.h>
+
+#include <sbml/conversion/SBMLConverterRegistry.h>
+#include <sbml/SBMLReader.h>
+#include <sbml/SBMLTypes.h>
+
+#include <string>
+
+#include <check.h>
+
+using namespace std;
+
+LIBSBML_CPP_NAMESPACE_USE
+
+
+std::string writeSBMLToStringSafe1(const SBMLDocument* doc)
+{
+ char* modelC = writeSBMLToString(doc);
+ std::string model(modelC);
+ free(modelC);
+ return model;
+}
+
+
+BEGIN_C_DECLS
+
+extern char *TestDataDirectory;
+
+void TestPair(std::string file1, std::string file2, std::string pkgToStrip,
+ unsigned int numErrors = 0)
+{
+ std::string filename(TestDataDirectory);
+ std::string dir("test_external_flat_strip/");
+
+ ConversionProperties props;
+
+ props.addOption("flatten comp");
+ props.addOption("basePath", filename);
+ props.addOption("performValidation", true);
+ props.addOption("stripPackages", pkgToStrip);
+ props.addOption("abortIfUnflattenable", "none");
+
+ SBMLConverter* converter = SBMLConverterRegistry::getInstance().
+ getConverterFor(props);
+
+ // load document
+ std::string cfile = filename + dir + file1;
+ SBMLDocument* doc = readSBMLFromFile(cfile.c_str());
+
+ // fail if there is no model (readSBMLFromFile always returns a valid doc)
+ fail_unless(doc->getModel() != NULL);
+
+ fail_unless(doc->getErrorLog()->getNumFailsWithSeverity(LIBSBML_SEV_ERROR)
+ == numErrors);
+
+ converter->setDocument(doc);
+ int result = converter->convert();
+
+ // fail if conversion was not valid
+ fail_unless(result == LIBSBML_OPERATION_SUCCESS);
+
+ std::string newModel = writeSBMLToStringSafe1(doc);
+
+ std::string ffile = filename + dir + file2;
+ SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str());
+ std::string flatModel = writeSBMLToStringSafe1(fdoc);
+
+ fail_unless(flatModel == newModel);
+
+ delete doc;
+ delete fdoc;
+ delete converter;
+}
+
+
+void TestPairDiffDir(std::string file1, std::string file2,
+ std::string pkgToStrip,
+ unsigned int numErrors = 0)
+{
+ std::string filename(TestDataDirectory);
+
+ ConversionProperties props;
+
+ props.addOption("flatten comp");
+ props.addOption("basePath", filename);
+ props.addOption("performValidation", true);
+ props.addOption("stripPackages", pkgToStrip);
+ props.addOption("abortIfUnflattenable", "none");
+
+ SBMLConverter* converter = SBMLConverterRegistry::getInstance().
+ getConverterFor(props);
+
+ // load document
+ std::string cfile = filename + file1;
+ SBMLDocument* doc = readSBMLFromFile(cfile.c_str());
+
+ // fail if there is no model (readSBMLFromFile always returns a valid doc)
+ fail_unless(doc->getModel() != NULL);
+
+ fail_unless(doc->getErrorLog()->getNumFailsWithSeverity(LIBSBML_SEV_ERROR)
+ == numErrors);
+
+ converter->setDocument(doc);
+ int result = converter->convert();
+
+ // fail if conversion was not valid
+ fail_unless(result == LIBSBML_OPERATION_SUCCESS);
+
+ std::string newModel = writeSBMLToStringSafe1(doc);
+
+ std::string ffile = filename + file2;
+ SBMLDocument* fdoc = readSBMLFromFile(ffile.c_str());
+ std::string flatModel = writeSBMLToStringSafe1(fdoc);
+
+ fail_unless(flatModel == newModel);
+
+ delete doc;
+ delete fdoc;
+ delete converter;
+}
+
+
+START_TEST (test_comp_flatten_strip_fbc_submodels)
+{
+ // fbc in modeldefinitions within one doc
+ if (SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPairDiffDir("aggregate_fbc2.xml",
+ "aggregate_fbc2_flat_fbc_removed.xml", "fbc");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_submodels_1)
+{
+ // fbc in modeldefinitions within one doc
+ if (SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPairDiffDir("aggregate_fbc2.xml", "aggregate_fbc2_flat.xml", "");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_external)
+{
+ // fbc in main doc and external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_in_external.xml",
+ "fbc_in_external_flat_fbc_removed.xml", "fbc");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_external_1)
+{
+ // fbc in main doc and external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_in_external.xml", "fbc_in_external_flat.xml", "");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_external_2)
+{
+ // fbc not in main doc but only in external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_in_external_only.xml",
+ "fbc_in_external_flat_fbc_removed.xml", "fbc");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_external_3)
+{
+ // fbc not in main doc but only in external doc
+ // flat doc should declare fbc
+ if (SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_in_external_only.xml",
+ "fbc_in_external_flat_fbc_added.xml", "");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_external_4)
+{
+ // comp in main doc not in external; fbc in both
+ if (SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_in_external_no_comp.xml",
+ "fbc_in_external_flat_fbc_removed.xml", "fbc");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_layout_submodels)
+{
+ // layout in modeldefinitions within one doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true)
+ {
+ TestPair("layout_in_submodels.xml",
+ "layout_in_submodels_flat_layout_removed.xml", "layout");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_layout_submodels_1)
+{
+ // layout in modeldefinitions within one doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true)
+ {
+ TestPairDiffDir("aggregate_layout.xml",
+ "aggregate_layout_flat_layout_removed.xml", "layout");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_layout_external)
+{
+ // layout in main doc and external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true)
+ {
+ TestPair("layout_in_external.xml",
+ "layout_in_external_flat_layout_removed.xml", "layout");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_layout_external_1)
+{
+ // layout in main doc and external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true)
+ {
+ TestPair("layout_in_external.xml", "layout_in_external_flat.xml", "");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_layout_external_2)
+{
+ // layout not in main doc but only in external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true)
+ {
+ TestPair("layout_in_external_only.xml",
+ "layout_in_external_flat_layout_removed.xml", "layout");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_layout_external_3)
+{
+ // layout not in main doc but only in external doc
+ // flat doc should declare layout
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true)
+ {
+ TestPair("layout_in_external_only.xml",
+ "layout_in_external_flat_layout_added.xml", "");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_layout_external_4)
+{
+ // comp in main doc not in external; layout in both
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true)
+ {
+ TestPair("layout_in_external_no_comp.xml",
+ "layout_in_external_flat_layout_removed.xml", "layout");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_unreq_unknown_submodels)
+{
+ // unknown unrequired package in modeldefinitions within one doc
+ TestPairDiffDir("unknown9.xml", "unknown9_flat.xml", "");
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_unreq_unknown_external)
+{
+ // unknown unrequired in main doc and external doc
+ TestPair("unreq_unknown_in_external.xml", "unreq_unknown_in_external_flat_unknown_removed.xml", "extra");
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_unreq_unknown_external_1)
+{
+ // unknown unrequired in main doc and external doc
+ TestPair("unreq_unknown_in_external.xml", "unreq_unknown_in_external_flat_unknown_removed.xml", "");
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_unreq_unknown_external_2)
+{
+ // unknown unrequired not in main doc but only in external doc
+ TestPair("unreq_unknown_in_external_only.xml", "unreq_unknown_in_external_flat_unknown_removed.xml", "extra");
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_unreq_unknown_external_3)
+{
+ // unknown unrequired not in main doc but only in external doc
+ TestPair("unreq_unknown_in_external_only.xml", "unreq_unknown_in_external_flat_unknown_removed.xml", "");
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_unreq_unknown_external_4)
+{
+ // comp in main doc not in external; unknown unrequired in both
+ TestPair("unreq_unknown_in_external_no_comp.xml", "unreq_unknown_in_external_flat_unknown_removed.xml", "extra");
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_req_unknown_submodels)
+{
+ // unknown required package in modeldefinitions within one doc
+ TestPairDiffDir("unknown10.xml", "unknown10_flat.xml", "", 1);
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_req_unknown_external)
+{
+ // unknown required in main doc and external doc
+ TestPair("req_unknown_in_external.xml", "req_unknown_in_external_flat_unknown_removed.xml", "extra", 1);
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_req_unknown_external_1)
+{
+ // unknown required in main doc and external doc
+ TestPair("req_unknown_in_external.xml", "req_unknown_in_external_flat_unknown_removed.xml", "", 1);
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_req_unknown_external_2)
+{
+ // unknown required not in main doc but only in external doc
+ TestPair("req_unknown_in_external_only.xml", "req_unknown_in_external_flat_unknown_removed.xml", "extra");
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_req_unknown_external_3)
+{
+ // unknown required not in main doc but only in external doc
+ TestPair("req_unknown_in_external_only.xml", "req_unknown_in_external_flat_unknown_removed.xml", "");
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_req_unknown_external_4)
+{
+ // comp in main doc not in external; unknown required in both
+ TestPair("req_unknown_in_external_no_comp.xml", "req_unknown_in_external_flat_unknown_removed.xml", "extra", 1);
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_layout_external)
+{
+ // fbc and layout in main doc and external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true
+ && SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_layout_in_external.xml",
+ "fbc_layout_in_external_flat_both_removed.xml", "layout, fbc");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_layout_external_1)
+{
+ // fbc and layout in main doc and external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true
+ && SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_layout_in_external.xml",
+ "fbc_layout_in_external_flat_both_removed.xml", "fbc, layout");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_layout_external_2)
+{
+ // fbc and layout in main doc and external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true
+ && SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_layout_in_external.xml",
+ "fbc_layout_in_external_flat_fbc_removed.xml", "fbc");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_layout_external_3)
+{
+ // fbc and layout in main doc and external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true
+ && SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_layout_in_external.xml",
+ "fbc_layout_in_external_flat_layout_removed.xml", "layout");
+ }
+}
+END_TEST
+
+
+START_TEST (test_comp_flatten_strip_fbc_layout_external_4)
+{
+ // fbc and layout in main doc and external doc
+ if (SBMLExtensionRegistry::isPackageEnabled("layout") == true
+ && SBMLExtensionRegistry::isPackageEnabled("fbc") == true)
+ {
+ TestPair("fbc_layout_in_external.xml",
+ "fbc_layout_in_external_flat.xml", "");
+ }
+}
+END_TEST
+
+
+Suite *
+create_suite_TestFlatteningConverterStripPackage (void)
+{
+ TCase *tcase = tcase_create("SBMLCompFlatteningConverterStripPackage");
+ Suite *suite = suite_create("SBMLCompFlatteningConverterStripPackage");
+
+ // fbc in modeldefinitions within one doc
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_submodels);
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_submodels_1);
+
+ // fbc in main doc and external doc
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_external);
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_external_1);
+
+ // fbc not in main doc but only in external doc
+ // FAILS - fbc not removed from external references
+ //tcase_add_test(tcase, test_comp_flatten_strip_fbc_external_2);
+
+ // fbc not in main doc but only in external doc
+ // flat doc should declare fbc
+ // FAILS - fbc not declared on flat doc
+ //tcase_add_test(tcase, test_comp_flatten_strip_fbc_external_3);
+
+ // comp in main doc not in external; fbc in both
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_external_4);
+
+ // layout in modeldefinitions within one doc
+ tcase_add_test(tcase, test_comp_flatten_strip_layout_submodels);
+ tcase_add_test(tcase, test_comp_flatten_strip_layout_submodels_1);
+
+ // layout in main doc and external doc
+ tcase_add_test(tcase, test_comp_flatten_strip_layout_external);
+ tcase_add_test(tcase, test_comp_flatten_strip_layout_external_1);
+
+ // layout not in main doc but only in external doc
+ tcase_add_test(tcase, test_comp_flatten_strip_layout_external_2);
+
+ // layout not in main doc but only in external doc
+ // flat doc should declare layout
+ // FAILS - layout not declared on flat doc
+ //tcase_add_test(tcase, test_comp_flatten_strip_layout_external_3);
+
+ // comp in main doc not in external; layout in both
+ tcase_add_test(tcase, test_comp_flatten_strip_layout_external_4);
+
+ // unknown unrequired package in modeldefinitions within one doc
+ tcase_add_test(tcase, test_comp_flatten_strip_unreq_unknown_submodels);
+
+ // unknown unrequired in main doc and external doc
+ tcase_add_test(tcase, test_comp_flatten_strip_unreq_unknown_external);
+ tcase_add_test(tcase, test_comp_flatten_strip_unreq_unknown_external_1);
+
+ // unknown unrequired not in main doc but only in external doc
+ tcase_add_test(tcase, test_comp_flatten_strip_unreq_unknown_external_2);
+
+ // unknown unrequired not in main doc but only in external doc
+ tcase_add_test(tcase, test_comp_flatten_strip_unreq_unknown_external_3);
+
+ // comp in main doc not in external; unknown unrequired in both
+ tcase_add_test(tcase, test_comp_flatten_strip_unreq_unknown_external_4);
+
+ // unknown required package in modeldefinitions within one doc
+ tcase_add_test(tcase, test_comp_flatten_strip_req_unknown_submodels);
+
+ // unknown required in main doc and external doc
+ tcase_add_test(tcase, test_comp_flatten_strip_req_unknown_external);
+ tcase_add_test(tcase, test_comp_flatten_strip_req_unknown_external_1);
+
+ // unknown required not in main doc but only in external doc
+ // FAILS conversion
+ //tcase_add_test(tcase, test_comp_flatten_strip_req_unknown_external_2);
+
+ // unknown required not in main doc but only in external doc
+ // FAILS conversion
+ //tcase_add_test(tcase, test_comp_flatten_strip_req_unknown_external_3);
+
+ // comp in main doc not in external; unknown required in both
+ tcase_add_test(tcase, test_comp_flatten_strip_req_unknown_external_4);
+
+ // fbc and layout in main doc and external doc
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_layout_external);
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_layout_external_1);
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_layout_external_2);
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_layout_external_3);
+ tcase_add_test(tcase, test_comp_flatten_strip_fbc_layout_external_4);
+
+
+ suite_add_tcase(suite, tcase);
+
+ return suite;
+}
+
+
+END_C_DECLS
+
Modified: trunk/libsbml/src/sbml/packages/comp/util/test/TestRunner.c
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/TestRunner.c 2014-09-25 14:12:02 UTC (rev 21158)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/TestRunner.c 2014-09-25 14:32:32 UTC (rev 21159)
@@ -121,6 +121,7 @@
Suite *create_suite_TestURIResolvers (void);
Suite *create_suite_TestExternalModelResolving (void);
Suite *create_suite_TestCompFlatteningNewFlags (void);
+Suite *create_suite_TestFlatteningConverterStripPackage (void);
/**
* Global.
@@ -171,6 +172,7 @@
srunner_add_suite( runner, create_suite_TestFlatteningConverter() );
srunner_add_suite( runner, create_suite_TestExternalModelResolving() );
srunner_add_suite( runner, create_suite_TestCompFlatteningNewFlags() );
+ srunner_add_suite( runner, create_suite_TestFlatteningConverterStripPackage() );
/* srunner_set_fork_status(runner, CK_NOFORK); */
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" comp:required="true"
+ xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version1" level="3" version="1" fbc:required="false">
+ <model id="Mod2">
+ <listOfCompartments>
+ <compartment id="c2" name="comp4" constant="true" units="litre"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="c2" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ </listOfSpecies>
+ </model>
+
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc_layout.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc_layout.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc_layout.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" comp:required="true"
+ xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version1" fbc:required="false"
+
+ xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" level="3" version="1" layout:required="false">
+ <model id="Mod1">
+ <listOfCompartments>
+ <compartment id="c1" name="comp2" constant="true" units="litre"/>
+ <compartment id="c2" constant="true" name="comp3" units="litre"/>
+
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="c2" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ </listOfSpecies>
+ <layout:listOfLayouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <layout:layout layout:id="layout_0">
+ <layout:dimensions layout:width="1500" layout:height="2000"/>
+ <layout:listOfCompartmentGlyphs>
+ <layout:compartmentGlyph layout:id="layout_glyph_0" layout:compartment="c1">
+ <layout:boundingBox>
+ <layout:position layout:x="816" layout:y="0"/>
+ <layout:dimensions layout:width="500" layout:height="260"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ <layout:compartmentGlyph layout:id="layout_glyph_1" layout:compartment="c2">
+ <layout:boundingBox>
+ <layout:position layout:x="3" layout:y="2"/>
+ <layout:dimensions layout:width="1" layout:height="1"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ </layout:listOfCompartmentGlyphs>
+ </layout:layout>
+ </layout:listOfLayouts>
+ </model>
+
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc_no_comp.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc_no_comp.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_fbc_no_comp.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+
+ xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version1" level="3" version="1" fbc:required="false">
+ <model id="Mod2">
+ <listOfCompartments>
+ <compartment id="c2" name="comp4" constant="true" units="litre"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="c2" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ </listOfSpecies>
+ </model>
+
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_layout.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_layout.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_layout.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" comp:required="true"
+ xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" level="3" version="1" layout:required="false">
+ <model id="Mod1">
+ <listOfCompartments>
+ <compartment id="c1" name="comp2" constant="true" units="litre"/>
+ <compartment id="c2" constant="true" name="comp3" units="litre"/>
+
+ </listOfCompartments>
+ <layout:listOfLayouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <layout:layout layout:id="layout_0">
+ <layout:dimensions layout:width="1500" layout:height="2000"/>
+ <layout:listOfCompartmentGlyphs>
+ <layout:compartmentGlyph layout:id="layout_glyph_0" layout:compartment="c1">
+ <layout:boundingBox>
+ <layout:position layout:x="816" layout:y="0"/>
+ <layout:dimensions layout:width="500" layout:height="260"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ <layout:compartmentGlyph layout:id="layout_glyph_1" layout:compartment="c2">
+ <layout:boundingBox>
+ <layout:position layout:x="3" layout:y="2"/>
+ <layout:dimensions layout:width="1" layout:height="1"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ </layout:listOfCompartmentGlyphs>
+ </layout:layout>
+ </layout:listOfLayouts>
+ </model>
+
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_layout_no_comp.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_layout_no_comp.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_layout_no_comp.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+
+ xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" level="3" version="1" layout:required="false">
+ <model id="Mod1">
+ <listOfCompartments>
+ <compartment id="c1" name="comp2" constant="true" units="litre"/>
+ <compartment id="c2" constant="true" name="comp3" units="litre"/>
+
+ </listOfCompartments>
+ <layout:listOfLayouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <layout:layout layout:id="layout_0">
+ <layout:dimensions layout:width="1500" layout:height="2000"/>
+ <layout:listOfCompartmentGlyphs>
+ <layout:compartmentGlyph layout:id="layout_glyph_0" layout:compartment="c1">
+ <layout:boundingBox>
+ <layout:position layout:x="816" layout:y="0"/>
+ <layout:dimensions layout:width="500" layout:height="260"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ <layout:compartmentGlyph layout:id="layout_glyph_1" layout:compartment="c2">
+ <layout:boundingBox>
+ <layout:position layout:x="3" layout:y="2"/>
+ <layout:dimensions layout:width="1" layout:height="1"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ </layout:listOfCompartmentGlyphs>
+ </layout:layout>
+ </layout:listOfLayouts>
+ </model>
+
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_req_unknown.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_req_unknown.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_req_unknown.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" xmlns:extra="http://www.sbml.org/sbml/level3/version1/extra/version1" level="3" version="1" comp:required="true" extra:required="true">
+ <model id="foo" name="bar">
+ <extra:listOfThings>
+ <extra:thing extra:id="y"/>
+ <extra:thing extra:id="b"/>
+ </extra:listOfThings>
+ </model>
+</sbml>
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_req_unknown_no_comp.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_req_unknown_no_comp.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_req_unknown_no_comp.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:extra="http://www.sbml.org/sbml/level3/version1/extra/version1" level="3" version="1" extra:required="true">
+ <model id="foo" name="bar">
+ <extra:listOfThings>
+ <extra:thing extra:id="y"/>
+ <extra:thing extra:id="b"/>
+ </extra:listOfThings>
+ </model>
+</sbml>
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_unreq_unknown.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_unreq_unknown.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_unreq_unknown.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" xmlns:extra="http://www.sbml.org/sbml/level3/version1/extra/version1" level="3" version="1" comp:required="true" extra:required="false">
+ <model id="foo" name="bar">
+ <extra:listOfThings>
+ <extra:thing extra:id="y"/>
+ <extra:thing extra:id="b"/>
+ </extra:listOfThings>
+ </model>
+</sbml>
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_unreq_unknown_no_comp.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_unreq_unknown_no_comp.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/external_with_unreq_unknown_no_comp.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:extra="http://www.sbml.org/sbml/level3/version1/extra/version1" level="3" version="1" extra:required="false">
+ <model id="foo" name="bar">
+ <extra:listOfThings>
+ <extra:thing extra:id="y"/>
+ <extra:thing extra:id="b"/>
+ </extra:listOfThings>
+ </model>
+</sbml>
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version1" fbc:required="false"
+ xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" comp:required="true">
+ <model id="aggregate">
+ <comp:listOfSubmodels>
+ <comp:submodel comp:id="submod1" comp:modelRef="enzyme"/>
+ <comp:submodel comp:id="submod2" comp:modelRef="Mod2"/>
+ </comp:listOfSubmodels>
+ </model>
+ <comp:listOfModelDefinitions>
+ <comp:modelDefinition id="enzyme" name="enzyme">
+ <listOfCompartments>
+ <compartment id="comp" spatialDimensions="3" size="1" constant="true"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="comp" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ </listOfSpecies>
+ </comp:modelDefinition>
+ </comp:listOfModelDefinitions>
+ <comp:listOfExternalModelDefinitions>
+ <comp:externalModelDefinition comp:id="Mod2" comp:source="external_with_fbc.xml"/>
+ </comp:listOfExternalModelDefinitions>
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version1" fbc:required="false"
+ level="3" version="1">
+ <model id="aggregate">
+ <listOfCompartments>
+ <compartment id="submod1__comp" spatialDimensions="3" size="1" constant="true"/>
+ <compartment id="submod2__c2" name="comp4" constant="true" units="litre"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="submod1__S" compartment="submod1__comp" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ <species id="submod2__S" compartment="submod2__c2" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ </listOfSpecies>
+
+ </model>
+
+
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat_fbc_added.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat_fbc_added.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat_fbc_added.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version1" fbc:required="false"
+ level="3" version="1">
+ <model id="aggregate">
+ <listOfCompartments>
+ <compartment id="submod1__comp" spatialDimensions="3" size="1" constant="true"/>
+ <compartment id="submod2__c2" name="comp4" constant="true" units="litre"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="submod1__S" compartment="submod1__comp" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ <species id="submod2__S" compartment="submod2__c2" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ </listOfSpecies>
+
+ </model>
+
+
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat_fbc_removed.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat_fbc_removed.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_flat_fbc_removed.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1">
+ <model id="aggregate">
+ <listOfCompartments>
+ <compartment id="submod1__comp" spatialDimensions="3" size="1" constant="true"/>
+ <compartment id="submod2__c2" name="comp4" units="litre" constant="true"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="submod1__S" compartment="submod1__comp" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ <species id="submod2__S" compartment="submod2__c2" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ </listOfSpecies>
+ </model>
+</sbml>
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_no_comp.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_no_comp.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_no_comp.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version1" fbc:required="false"
+ xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" comp:required="true">
+ <model id="aggregate">
+ <comp:listOfSubmodels>
+ <comp:submodel comp:id="submod1" comp:modelRef="enzyme"/>
+ <comp:submodel comp:id="submod2" comp:modelRef="Mod2"/>
+ </comp:listOfSubmodels>
+ </model>
+ <comp:listOfModelDefinitions>
+ <comp:modelDefinition id="enzyme" name="enzyme">
+ <listOfCompartments>
+ <compartment id="comp" spatialDimensions="3" size="1" constant="true"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="comp" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ </listOfSpecies>
+ </comp:modelDefinition>
+ </comp:listOfModelDefinitions>
+ <comp:listOfExternalModelDefinitions>
+ <comp:externalModelDefinition comp:id="Mod2" comp:source="external_with_fbc_no_comp.xml"/>
+ </comp:listOfExternalModelDefinitions>
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_only.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_only.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_in_external_only.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+
+ xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1" comp:required="true">
+ <model id="aggregate">
+ <comp:listOfSubmodels>
+ <comp:submodel comp:id="submod1" comp:modelRef="enzyme"/>
+ <comp:submodel comp:id="submod2" comp:modelRef="Mod2"/>
+ </comp:listOfSubmodels>
+ </model>
+ <comp:listOfModelDefinitions>
+ <comp:modelDefinition id="enzyme" name="enzyme">
+ <listOfCompartments>
+ <compartment id="comp" spatialDimensions="3" size="1" constant="true"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="comp" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ </listOfSpecies>
+ </comp:modelDefinition>
+ </comp:listOfModelDefinitions>
+ <comp:listOfExternalModelDefinitions>
+ <comp:externalModelDefinition comp:id="Mod2" comp:source="external_with_fbc.xml"/>
+ </comp:listOfExternalModelDefinitions>
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1"
+ xmlns:comp="http://www.sbml.org/sbml/level3/version1/comp/version1" level="3" version="1"
+ comp:required="true" layout:required="false"
+ xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version1" fbc:required="false">
+ <model>
+ <listOfCompartments>
+ <compartment id="c1" constant="true" name="comp1" units="litre">
+ <comp:replacedBy comp:idRef="c1" comp:submodelRef="submod1"/>
+ </compartment>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="c1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ </listOfSpecies>
+ <comp:listOfSubmodels>
+ <comp:submodel comp:id="submod1" comp:modelRef="Mod1"/>
+ </comp:listOfSubmodels>
+ <layout:listOfLayouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <layout:layout layout:id="layout_0">
+ <layout:dimensions layout:width="1400" layout:height="1000"/>
+ <layout:listOfCompartmentGlyphs>
+ <layout:compartmentGlyph layout:id="layout_glyph_0" layout:compartment="c1">
+ <layout:boundingBox>
+ <layout:position layout:x="816" layout:y="0"/>
+ <layout:dimensions layout:width="500" layout:height="260"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ </layout:listOfCompartmentGlyphs>
+ </layout:layout>
+ </layout:listOfLayouts>
+ </model>
+ <comp:listOfExternalModelDefinitions>
+ <comp:externalModelDefinition comp:id="Mod1" comp:source="external_with_fbc_layout.xml"/>
+ </comp:listOfExternalModelDefinitions>
+
+</sbml>
\ No newline at end of file
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" xmlns:fbc="http://www.sbml.org/sbml/level3/version1/fbc/version1" level="3" version="1" layout:required="false" fbc:required="false">
+ <model>
+ <listOfCompartments>
+ <compartment id="c1" name="comp2" units="litre" constant="true"/>
+ <compartment id="submod1__c2" name="comp3" units="litre" constant="true"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="c1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ <species id="submod1__S" compartment="submod1__c2" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false" fbc:charge="9"/>
+ </listOfSpecies>
+ <layout:listOfLayouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1">
+ <layout:layout layout:id="layout_0">
+ <layout:dimensions layout:width="1400" layout:height="1000"/>
+ <layout:listOfCompartmentGlyphs>
+ <layout:compartmentGlyph layout:id="layout_glyph_0" layout:compartment="c1">
+ <layout:boundingBox>
+ <layout:position layout:x="816" layout:y="0"/>
+ <layout:dimensions layout:width="500" layout:height="260"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ </layout:listOfCompartmentGlyphs>
+ </layout:layout>
+ <layout:layout layout:id="submod1__layout_0">
+ <layout:dimensions layout:width="1500" layout:height="2000"/>
+ <layout:listOfCompartmentGlyphs>
+ <layout:compartmentGlyph layout:id="submod1__layout_glyph_0" layout:compartment="c1">
+ <layout:boundingBox>
+ <layout:position layout:x="816" layout:y="0"/>
+ <layout:dimensions layout:width="500" layout:height="260"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ <layout:compartmentGlyph layout:id="submod1__layout_glyph_1" layout:compartment="submod1__c2">
+ <layout:boundingBox>
+ <layout:position layout:x="3" layout:y="2"/>
+ <layout:dimensions layout:width="1" layout:height="1"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ </layout:listOfCompartmentGlyphs>
+ </layout:layout>
+ </layout:listOfLayouts>
+ </model>
+</sbml>
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat_both_removed.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat_both_removed.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat_both_removed.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1">
+ <model>
+ <listOfCompartments>
+ <compartment id="c1" name="comp2" units="litre" constant="true"/>
+ <compartment id="submod1__c2" name="comp3" units="litre" constant="true"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="c1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ <species id="submod1__S" compartment="submod1__c2" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ </listOfSpecies>
+ </model>
+</sbml>
Added: trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat_fbc_removed.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat_fbc_removed.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/comp/util/test/test-data/test_external_flat_strip/fbc_layout_in_external_flat_fbc_removed.xml 2014-09-25 14:32:32 UTC (rev 21159)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" level="3" version="1" layout:required="false">
+ <model>
+ <listOfCompartments>
+ <compartment id="c1" name="comp2" units="litre" constant="true"/>
+ <compartment id="submod1__c2" name="comp3" units="litre" constant="true"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="S" compartment="c1" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ ...
[truncated message content] |