#!/usr/bin/env python
from coral.modeler.extension import *

from coral.modeler.unittests.anExtension import TESTtestTEST

e=fromFullElementName2AbstractElementDefinition("CoralEx.1.0::FileSystem.Folder")
assert e
assert e.getName()=="Folder"

print "<1>"
e=ExtensionRegistry()

print "<2>"

entry1=coral.lang.CoralEx10.Addins.DiagramElementExt()
entry1.element_kind="UML.1.4::Package"
entry1.path="coral.modeler.unittests.anExtension.TESTtestTEST"

entry2=coral.lang.CoralEx10.Addins.DiagramElementExt()
entry2.element_kind="UML.1.4::Class"
entry2.path="coral.modeler.unittests.anExtension.TESTtestTEST1"

entry3=coral.lang.CoralEx10.Addins.DiagramElementExt()
entry3.element_kind="UML.1.4::Interface"
entry3.path="coral.modeler.unittests.anExtension.TESTtestTEST2"

entry4=coral.lang.CoralEx10.Addins.DiagramElementExt()
entry4.element_kind="UML.1.4::Association"
entry4.path="coral.modeler.unittests.anExtension.TESTtestTEST3"

entry5=coral.lang.CoralEx10.Addins.DiagramElementExt()
entry5.element_kind="UML.1.4::Model"
entry5.path="coral.modeler.unittests.anExtension.TESTtestTEST4"

entry6=coral.lang.CoralEx10.Addins.DiagramCreator()
entry6.model_kind="ClassDiagram"
entry6.path="coral.modeler.unittests.anExtension.TESTtestTEST5"

entry7=coral.lang.CoralEx10.Addins.DiagramCreator()
entry7.model_kind="DeploymentDiagram"
entry7.path="coral.modeler.unittests.anExtension.TESTtestTEST6"


e.registerEntry(entry1)
e.registerEntry(entry2)
e.registerEntry(entry3)
e.registerEntry(entry4)
e.registerEntry(entry5)
e.registerEntry(entry6)
e.registerEntry(entry7)

import coral
metamodel=coral.lang.UML14 

c=coral.lang.UML14.Package()

print "<3>"
#cl=e.getRegisteredExtensions(element=c,type="DiagramElementExt")
#c2=e.getRegisteredExtensions(element=c)
#c3=e.getRegisteredExtensions(element=None,type="*")
#c3_2=e.getRegisteredExtensions()
c4=e.getRegisteredExtensionsByType("DiagramElementExt")


#print cl
#print c2
#print c3
print c4

#assert TESTtestTEST in cl
#assert TESTtestTEST in c2
#assert TESTtestTEST in c3
assert ["UML.1.4::Package",TESTtestTEST] in c4
#assert c3==c3_2


#e.addManifest("emanifest.txt")
