コード例 #1
0
 def test_mendix_8_java_11_memory_stats(self):
     java_version = 11
     stats = {"memory": MENDIX_8_JAVA_11_STATS}
     old_stats = _populate_stats_by_java_version_old(
         copy.deepcopy(stats), java_version)
     new_stats = _populate_stats_by_java_version(copy.deepcopy(stats),
                                                 java_version)
     # Old stats were broken for Mendix 8, so this test is fairly useless,
     # but whatever.
     self.assertNotEqual(old_stats, new_stats)
コード例 #2
0
 def test_mendix_8_java_11_memory_stats_concmarksweepgc(self):
     java_version = 11
     stats = {"memory": MENDIX_8_JAVA_11_STATS_CONCMARKSWEEPGC}
     old_stats = _populate_stats_by_java_version_old(
         copy.deepcopy(stats), java_version)
     new_stats = _populate_stats_by_java_version(copy.deepcopy(stats),
                                                 java_version)
     # if we have reached here without any exception
     # means we do support the alternate memory pool names
     self.assertNotEqual(old_stats, new_stats)
コード例 #3
0
    def test_mendix_5_java_7_memory(self):
        """Test mendix 5.x runtime with java 7

        Mendix 5.x runtimes are not supported.

        So the new stats call would raise an exception,
        as opposed to the behavior in the old stats call.
        """
        java_version = 7
        stats = {"memory": MENDIX_5_6_0_JAVA_7}
        old_stats = _populate_stats_by_java_version_old(
            copy.deepcopy(stats), java_version)

        # new behavior is to raise an exception
        with self.assertRaises(RuntimeError):
            _populate_stats_by_java_version(copy.deepcopy(stats), java_version)

        # old behavior would simply return the stats as it is
        self.assertEqual(old_stats, stats)