Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [app4mc-dev] AmaltheaLoader.loadFrom in multiple test

Hi Robert,

I thought I noticed this some time ago as well, but running it currently in APP4MC 0.9.3 — 0.9.5 works for me:

Did you try running the tests a fresh workspace?

Best regards,
Robert


==============================
Fachhochschule Dortmund
University of Applied Sciences and Arts
==============================
Robert Hoettger
IDiAL Institute
Otto-Hahn-Str. 23, 44227 Dortmund
room EG 04
phone +49 231 9112-9548
robert.hoettger@xxxxxxxxxxxxxx
www.fh-dortmund.de
==============================

On Sep 5, 2019, at 16:23, Robert.Hilbrich@xxxxxx wrote:

Hi all,
I am using junit4 to create tests regarding the import of APP4MC models and I think there might be a bug in the APP4MC (de-) serializer code. I have the following two identical tests:
 
@Test
    def testARAMiS2Import() {
        val pathURL = class.protectionDomain.codeSource.location
        val pathURI = (new File(pathURL.file).toURI)
        val path = Paths.get(pathURI)
        val subPath = path.subpath(0, path.nameCount - 3)
        val finalPath = Paths.get(path.root.toString, subPath.toString,'''com.co4e.assist.mapping.tests/resources/project-aramis-uc55/aramis_usecase55.amxmi''').toString
 
        val model_1 = AmaltheaLoader.loadFromFileNamed(finalPath)
       Assert.assertNotNull(model_1)
           
        val model_2 = AmaltheaLoader.loadFromFileNamed(finalPath)
        Assert.assertNotNull(model_2)   
     }
    
     @Test
      def testARAMiS2Import_copy() {
        val pathURL = class.protectionDomain.codeSource.location
        val pathURI = (new File(pathURL.file).toURI)
        val path = Paths.get(pathURI)
        val subPath = path.subpath(0, path.nameCount - 3)
        val finalPath = Paths.get(path.root.toString, subPath.toString,'''com.co4e.assist.mapping.tests/resources/project-aramis-uc55/aramis_usecase55.amxmi''').toString
 
        val model_1 = AmaltheaLoader.loadFromFileNamed(finalPath)
       Assert.assertNotNull(model_1)
           
        val model_2 = AmaltheaLoader.loadFromFileNamed(finalPath)
        Assert.assertNotNull(model_2)   
     }
 
Interestingly, the first test that is executed by junit succeeds, but the following test fails, because it returns an empty model.
 
<image001.png>
 
It seems like I can execute “loadFromFileNamed” multiple times within a single test, but not in two different test cases of the same testsuite. This is weird, because most of the loading code is static – just the EPackage registry stuff isn’t. Anybody ever stumbled over this behavior? 
 
Any pointers or feedback would be greatly appreciated.
 
Best,
Robert
 
——————————————————————————
Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)
Institut für Verkehrssystemtechnik | Rutherfordstraße 2 | 12489 Berlin
 
Dr. Robert Hilbrich | Gruppenleiter Simulation und Modellierung
Telefon 030 67055-582 | Telefax 030 67055-291 | Robert.Hilbrich@xxxxxx
 
_______________________________________________
app4mc-dev mailing list
app4mc-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/app4mc-dev


Back to the top