Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[app4mc-dev] AmaltheaLoader.loadFrom in multiple test
  • From: <Robert.Hilbrich@xxxxxx>
  • Date: Thu, 5 Sep 2019 14:23:49 +0000
  • Accept-language: de-DE, en-US
  • Delivered-to: app4mc-dev@xxxxxxxxxxx
  • Ironport-phdr: 9a23:pgbttRPPID8KlTnsJE0l6mtUPXoX/o7sNwtQ0KIMzox0Ivj7rarrMEGX3/hxlliBBdydt6sezbOJ7Ou+BiQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagf79+Ngi6oAfTu8UZgIZvKLs6xwfUrHdPZ+lY335jK0iJnxb76Mew/Zpj/DpVtvk86cNOUrj0crohQ7BAAzsoL2465MvwtRneVgSP/WcTUn8XkhVTHQfI6gzxU4rrvSv7sup93zSaPdHzQLspVzmu87tnRRn1gygAKjA57XrXitRug61HvBKvqRt/w4vOb4GUMvp1Y6fRcNweSGZEWMtaSi5PDZ6mb4YXD+QPI/tWr5XzqVUNrBuxGQajCfj1yjNUgnL7x7E23/g8HQzAwQcuH8gOsHPRrNjtM6ocTee1w7LWwjXZc/NawzXz6InMch86u/GMXK5/ccrKxEYyEwPFlE+cppH7MD6M0OkGrmaV7+1lVe21im4nrRl8rSWrxsc2kIXGm5wax1bZ/it62IY4PcC0RFJhbdK5E5ZduDuWO5Z4T84hWW1kpTs2xqUbtZO5YiQG0oorywPFZ/CacYWF4wjvWPuJLTtlhX9ofKiziwiy/EWv0OHxV9O43EtXoidBlNTHq2oD2AbJ6sedT/tw5kKh2TGS2A/N8uxEOkU0lbbDK54m374wioIfsUTdES/yn0X7lKGYeEMq9Oan6+rpYrLoqJybOYFulg3yL6sglc2hDOgiMwgOWXSb+f6m27H54EL5RK9KgucrnabHqJzaJMIbqbClAwJNz4ov9wyzAyql3dkXh3ULMVxIdRGdg4T0Jl3COPX4Au2+g1Sonjdr3ffGPrj5D5vRKXjMi6nufaxh60JGygQzzNRf6IlOCrEAPP3zWlT8u8HcDh8jKQC73vjoBM1n1owCQWKPHrOZMKTKvFCS/uIvO+aBZIoJtzrkNvcq+eDugGQnllABeamp3IMXaGumEfh8JEWZe3Xs0Z89FjJetxImEOnhzVGPTxZebHKzR7kxoDYhB9T1I53EQ9X5uruL0T2nWL1XYmpcC1uMOXvsbcOIVqFfO2qpPsZ9n2lcBvCaQIg72ETy5QI=
  • Ironport-sdr: d9SuTwXNE5J0zEXNxAd0BU8Xwlte35JytuhOIo7q5Ntkor5js0HHF5TmIhPv9fdBqZFeDrc+wp QhUHVmWJxkYA==
  • List-archive: <https://www.eclipse.org/mailman/private/app4mc-dev>
  • List-help: <mailto:app4mc-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/app4mc-dev>, <mailto:app4mc-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/app4mc-dev>, <mailto:app4mc-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdVj9OkYd2jtPn5bTXGMIVg2QeWy9Q==
  • Thread-topic: AmaltheaLoader.loadFrom in multiple test

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.

 

 

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

www.DLR.de | Institut für Verkehrssystemtechnik

 


Back to the top