public void testDeserializeInvalidBackpackFile() throws IOException { File backPackFile = loadBackpackFile(backpackJsonInvalid); BackPackListManager.getInstance().loadBackpack(); TestUtils.sleep(1000); assertTrue( "Backpacked items loaded despite file is invalid!", BackPackListManager.getInstance().getBackpack().backpackedScripts.isEmpty()); assertFalse("Backpack.json should be deleted!", backPackFile.exists()); }
public void testDeserializeValidBackpackFile() throws IOException { File backPackFile = loadBackpackFile(backpackJsonValid); BackPackListManager.getInstance().loadBackpack(); TestUtils.sleep(1000); assertFalse( "Backpacked sprites not loaded!", BackPackListManager.getInstance().getBackpack().backpackedSprites.isEmpty()); assertFalse( "Backpacked scripts not loaded!", BackPackListManager.getInstance().getBackpack().hiddenBackpackedScripts.isEmpty()); assertFalse( "Backpacked looks not loaded!", BackPackListManager.getInstance().getBackpack().hiddenBackpackedLooks.isEmpty()); assertFalse( "Backpacked sounds not loaded!", BackPackListManager.getInstance().getBackpack().hiddenBackpackedSounds.isEmpty()); assertTrue("Backpack.json should not be deleted!", backPackFile.exists()); }