def test_get_and_alter(self): # the class is defined in the 4.1 JAR mark_server_version_at_least(self, self.client, "4.1") self.atomic_long.set(123) self.assertEqual(123, self.atomic_long.get_and_alter(Multiplication(-1))) self.assertEqual(-123, self.atomic_long.get())
def test_apply(self): # the class is defined in the 4.1 JAR mark_server_version_at_least(self, self.client, "4.1") self.ref.set("hell") self.assertEqual("hello", self.ref.apply(AppendString("o"))) self.assertEqual("hell", self.ref.get())
def test_alter_and_get(self): # the class is defined in the 4.1 JAR mark_server_version_at_least(self, self.client, "4.1") self.ref.set("123") self.assertEqual("123...", self.ref.alter_and_get(AppendString("..."))) self.assertEqual("123...", self.ref.get())
def test_alter_with_incompatible_types(self): # the class is defined in the 4.1 JAR mark_server_version_at_least(self, self.client, "4.1") self.ref.set(42) with self.assertRaises(ClassCastError): self.ref.alter(AppendString("."))
def setUp(self): mark_server_version_at_least(self, self.client, "4.2")
def setUp(self): self.map_name = random_string() self.map = self.client.get_map(self.map_name).blocking() mark_server_version_at_least(self, self.client, "4.2")
def test_apply(self): # the class is defined in the 4.1 JAR mark_server_version_at_least(self, self.client, "4.1") self.atomic_long.set(42) self.assertEqual(84, self.atomic_long.apply(Multiplication(2))) self.assertEqual(42, self.atomic_long.get())
def test_alter(self): # the class is defined in the 4.1 JAR mark_server_version_at_least(self, self.client, "4.1") self.atomic_long.set(2) self.assertIsNone(self.atomic_long.alter(Multiplication(5))) self.assertEqual(10, self.atomic_long.get())