model_json: update ModelView
[nit.git] / src / model / test_model_json.nit
index c544446..cc10f48 100644 (file)
@@ -23,6 +23,8 @@ class TestModelSerialization
        var suite_path: String = "NIT_TESTING_PATH".environ
        var lib_path: String = "{suite_path.dirname}/../../tests/test_prog"
 
+       var mainmodule: MModule is noinit
+
        private var model: Model do
                var toolcontext = new ToolContext
                var model = new Model
@@ -31,6 +33,7 @@ class TestModelSerialization
                if mmodules.is_empty then return model
                mbuilder.run_phases
                toolcontext.run_global_phases(mmodules)
+               mainmodule = mmodules.first
                return model
        end
 
@@ -40,54 +43,54 @@ class TestModelSerialization
                mentities.add model.mmodules.first
                mentities.add model.mclasses.first
                for mentity in mentities do
-                       print ((new MEntityRef(mentity)).to_pretty_full_json)
+                       print ((new MEntityRef(mentity)).to_pretty_full_json(mainmodule))
                end
        end
 
        fun test_packages_to_full_json is test do
                for mentity in model.mpackages do
-                       print mentity.to_pretty_full_json
+                       print mentity.to_pretty_full_json(mainmodule)
                end
        end
 
        fun test_groups_to_full_json is test do
                for mpackage in model.mpackages do
                        for mentity in mpackage.mgroups do
-                               print mentity.to_pretty_full_json
+                               print mentity.to_pretty_full_json(mainmodule)
                        end
                end
        end
 
        fun test_modules_to_full_json is test do
                for mentity in model.mmodules do
-                       print mentity.to_pretty_full_json
+                       print mentity.to_pretty_full_json(mainmodule)
                end
        end
 
        fun test_classes_to_full_json is test do
                for mentity in model.mclasses do
-                       print mentity.to_pretty_full_json
+                       print mentity.to_pretty_full_json(mainmodule)
                end
        end
 
        fun test_classdefs_to_full_json is test do
                for mclass in model.mclasses do
                        for mentity in mclass.mclassdefs do
-                               print mentity.to_pretty_full_json
+                               print mentity.to_pretty_full_json(mainmodule)
                        end
                end
        end
 
        fun test_props_to_full_json is test do
                for mentity in model.mproperties do
-                       print mentity.to_pretty_full_json
+                       print mentity.to_pretty_full_json(mainmodule)
                end
        end
 
        fun test_propdefs_to_full_json is test do
                for mprop in model.mproperties do
                        for mentity in mprop.mpropdefs do
-                               print mentity.to_pretty_full_json
+                               print mentity.to_pretty_full_json(mainmodule)
                        end
                end
        end