diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/performance/SerializationTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/performance/SerializationTest.java index 4234a680ca..ceb21d3a7c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/performance/SerializationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/performance/SerializationTest.java @@ -60,6 +60,21 @@ public class SerializationTest extends CardTestPlayerBase { Assert.assertEquals("Must get infected counter", 1, permanent.getCounters(currentGame).getCount(CounterType.M1M1)); } + @Test + public void test_Single_KentaroTheSmilingCat() { + CardInfo cardInfo = CardRepository.instance.findCard("Kentaro, the Smiling Cat"); + Card newCard = cardInfo.getCard(); + Card permCard = CardUtil.getDefaultCardSideForBattlefield(newCard); + PermanentImpl permanent = new PermanentCard(permCard, playerA.getId(), currentGame); + currentGame.addPermanent(permanent, 0); + + // test compress (it uses default java serialization) + Object compressed = CompressUtil.compress(permanent); + Assert.assertTrue("Must be zip", compressed instanceof ZippedObjectImpl); + PermanentImpl uncompressed = (PermanentImpl) CompressUtil.decompress(compressed); + Assert.assertEquals("Must be same", permanent.getName(), uncompressed.getName()); + } + @Test public void test_LondonMulligan() { LondonMulligan mulligan = new LondonMulligan(15); diff --git a/Mage/src/main/java/mage/abilities/costs/DynamicCost.java b/Mage/src/main/java/mage/abilities/costs/DynamicCost.java index efb39245d3..1eee4f2d0a 100644 --- a/Mage/src/main/java/mage/abilities/costs/DynamicCost.java +++ b/Mage/src/main/java/mage/abilities/costs/DynamicCost.java @@ -3,10 +3,12 @@ package mage.abilities.costs; import mage.abilities.Ability; import mage.game.Game; -public interface DynamicCost { - - Cost getCost(Ability ability, Game game); - - String getText(Ability ability, Game game); +import java.io.Serializable; + +public interface DynamicCost extends Serializable { + + Cost getCost(Ability ability, Game game); + + String getText(Ability ability, Game game); }