#!/usr/bin/env python
import coral

st = coral.loadDocument("../../../qa/models2import/Softsale.xmi")

st.setFilename("tmp/softsalewrittenbycoral.xmi")
st.setXMIFormat("1.2")
coral.saveDocument(st)

st.setFilename("tmp/softsalewrittenbycoral_bogus.xmi")

st2 = coral.loadDocument("tmp/softsalewrittenbycoral.xmi")

assert st != st2
assert len(st.contents()) == len(st2.contents())

for idx in range(len(st.contents())):
    r1 = st.contents()[idx]
    r2 = st2.contents()[idx]
    assert coral.isSameModel(r1, r2)
    
#
# Mistakes in Poseidon
#
# Classifier.typedParameter is not serialized
# Classifier.typedFeature is not serialized
# Class.spezialization is not serialized
# Classifier.association is not serialized
# UseCase.includer is not serialized
# Action.stimulus is not serialized
#
 
