// Path: src/main/java/myessentials/economy/api/Economy.java
// public class Economy {
//     public static final String CURRENCY_VAULT = "$Vault";
//     public static final String CURRENCY_FORGE_ESSENTIALS = "$ForgeEssentials";
//     public static final String CURRENCY_CUSTOM = "$Custom:";
// 
//     private String costItemName;
//     private Class<? extends IEconManager> econManagerClass;
// 
//     public Economy(String costItemName) {
//         this.costItemName = costItemName;
//         if(costItemName.equals(CURRENCY_VAULT)) {
//             if (ClassUtils.isBukkitLoaded()) {
//                 econManagerClass = BukkitCompat.initEconomy();
//             }
//             if(econManagerClass == null)
//                 throw new EconomyException("Failed to initialize Vault economy!");
//         } else if(costItemName.equals(CURRENCY_FORGE_ESSENTIALS)) {
//             if(Loader.isModLoaded("ForgeEssentials"))
//                 econManagerClass = ForgeessentialsEconomy.class;
//             if(econManagerClass == null)
//                 throw new EconomyException("Failed to initialize ForgeEssentials economy!");
//         } else if(costItemName.startsWith(CURRENCY_CUSTOM)) {
//             try{
//                 econManagerClass = Class.forName(costItemName.substring(CURRENCY_CUSTOM.length())).asSubclass(IEconManager.class);
//             }
//             catch (Exception e){
//                 throw new EconomyException("Failed to initialize custom economy!", e);
//             }
//         }
//     }
// 
//     public IEconManager economyManagerForUUID(UUID uuid) {
//         if (econManagerClass == null) {
//             return null;
//         }
//         try {
//             IEconManager manager = econManagerClass.newInstance();
//             manager.setPlayer(uuid);
//             return manager;
//         } catch(Exception ex) {
//             MyEssentialsCore.instance.LOG.info("Failed to create IEconManager", ex);
//         }
// 
//         return null; // Hopefully this doesn't break things...
//     }
// 
//     /**
//      * Takes the amount of money specified.
//      * Returns false if player doesn't have the money necessary
//      */
//     public boolean takeMoneyFromPlayer(EntityPlayer player, int amount) {
//         if(costItemName.equals(CURRENCY_FORGE_ESSENTIALS) || costItemName.equals(CURRENCY_VAULT) || costItemName.startsWith(CURRENCY_CUSTOM)) {
//             IEconManager eco = economyManagerForUUID(player.getUniqueID());
//             if (eco == null)
//                 return false;
//             int wallet = eco.getWallet();
//             if (wallet >= amount) {
//                 eco.removeFromWallet(amount);
//                 return true;
//             }
//             return false;
//         } else {
//             return PlayerUtils.takeItemFromPlayer(player, costItemName, amount);
//         }
//     }
// 
//     /**
//      * Takes the amount of money specified.
//      * Returns false if player doesn't have the money necessary
//      */
//     public void giveMoneyToPlayer(EntityPlayer player, int amount) {
//         if (costItemName.equals(CURRENCY_FORGE_ESSENTIALS) || costItemName.equals(CURRENCY_VAULT) || costItemName.startsWith(CURRENCY_CUSTOM)) {
//             IEconManager eco = economyManagerForUUID(player.getUniqueID());
//             if (eco == null)
//                 return;
//             eco.addToWallet(amount);
//         } else {
//             PlayerUtils.giveItemToPlayer(player, costItemName, amount);
//         }
//     }
// 
//     /**
//      * Gets the currency string currently used.
//      */
//     public String getCurrency(int amount) {
//         if(costItemName.equals(CURRENCY_FORGE_ESSENTIALS) || costItemName.equals(CURRENCY_VAULT) || costItemName.startsWith(CURRENCY_CUSTOM)) {
//             if (econManagerClass == null) {
//                 return null;
//             }
//             try {
//                 IEconManager manager = econManagerClass.newInstance();
//                 return manager.currency(amount);
//             } catch(Exception ex) {
//                 MyEssentialsCore.instance.LOG.info("Failed to create IEconManager", ex);
//             }
//             return "$";
// 
//         } else {
//             return ItemUtils.itemStackFromName(costItemName).getDisplayName() + (amount == 1 ? "" : "s");
//         }
//     }
// }
// 
// Path: src/main/java/myessentials/economy/api/IEconManager.java
// public interface IEconManager {
// 
//     void setPlayer(UUID uuid);
// 
//     /**
//      * Add a set amount to a target's Wallet
//      */
//     void addToWallet(int amountToAdd);
// 
//     /**
//      * Get the amount of money the player has
//      */
//     int getWallet();
// 
//     /**
//      * Remove a set amount from a target's Wallet
//      * returns true if it succeded, false if it didn't
//      */
//     boolean removeFromWallet(int amountToSubtract);
// 
//     /**
//      * Set the target's Wallet to the specified amount
//      */
//     void setWallet(int setAmount, EntityPlayer player);
// 
//     /**
//      * Gets the singular or plural term of the currency used
//      */
//     String currency(int amount);
// 
//     /**
//      * Gets a combo of getWallet + currency
//      */
//     String getMoneyString();
//     
//     /**
//      * Saves all wallets to disk
//      * (for users still on the server when it's stopping)
//      */
//     void save();
// 
//     Map<String, Integer> getItemTables();
// }
// 
// Path: src/test/java/myessentials/test/MECTest.java
// public class MECTest extends BaseTest {
// 
//     @Before
//     public void initConfig() {
//         TestConfig.instance.init(configFile, Constants.MOD_ID);
//     }
// 
// }


import metest.api.TestPlayer;
import myessentials.economy.api.Economy;
import myessentials.economy.api.IEconManager;
import myessentials.test.MECTest;
import net.minecraft.entity.player.EntityPlayerMP;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
package myessentials.test.economy;



public class EconomyForgeEssentialsTest extends MECTest {

    private EntityPlayerMP player;
    private Economy economy;
// Path: src/main/java/myessentials/economy/api/Economy.java
// public class Economy {
//     public static final String CURRENCY_VAULT = "$Vault";
//     public static final String CURRENCY_FORGE_ESSENTIALS = "$ForgeEssentials";
//     public static final String CURRENCY_CUSTOM = "$Custom:";
// 
//     private String costItemName;
//     private Class<? extends IEconManager> econManagerClass;
// 
//     public Economy(String costItemName) {
//         this.costItemName = costItemName;
//         if(costItemName.equals(CURRENCY_VAULT)) {
//             if (ClassUtils.isBukkitLoaded()) {
//                 econManagerClass = BukkitCompat.initEconomy();
//             }
//             if(econManagerClass == null)
//                 throw new EconomyException("Failed to initialize Vault economy!");
//         } else if(costItemName.equals(CURRENCY_FORGE_ESSENTIALS)) {
//             if(Loader.isModLoaded("ForgeEssentials"))
//                 econManagerClass = ForgeessentialsEconomy.class;
//             if(econManagerClass == null)
//                 throw new EconomyException("Failed to initialize ForgeEssentials economy!");
//         } else if(costItemName.startsWith(CURRENCY_CUSTOM)) {
//             try{
//                 econManagerClass = Class.forName(costItemName.substring(CURRENCY_CUSTOM.length())).asSubclass(IEconManager.class);
//             }
//             catch (Exception e){
//                 throw new EconomyException("Failed to initialize custom economy!", e);
//             }
//         }
//     }
// 
//     public IEconManager economyManagerForUUID(UUID uuid) {
//         if (econManagerClass == null) {
//             return null;
//         }
//         try {
//             IEconManager manager = econManagerClass.newInstance();
//             manager.setPlayer(uuid);
//             return manager;
//         } catch(Exception ex) {
//             MyEssentialsCore.instance.LOG.info("Failed to create IEconManager", ex);
//         }
// 
//         return null; // Hopefully this doesn't break things...
//     }
// 
//     /**
//      * Takes the amount of money specified.
//      * Returns false if player doesn't have the money necessary
//      */
//     public boolean takeMoneyFromPlayer(EntityPlayer player, int amount) {
//         if(costItemName.equals(CURRENCY_FORGE_ESSENTIALS) || costItemName.equals(CURRENCY_VAULT) || costItemName.startsWith(CURRENCY_CUSTOM)) {
//             IEconManager eco = economyManagerForUUID(player.getUniqueID());
//             if (eco == null)
//                 return false;
//             int wallet = eco.getWallet();
//             if (wallet >= amount) {
//                 eco.removeFromWallet(amount);
//                 return true;
//             }
//             return false;
//         } else {
//             return PlayerUtils.takeItemFromPlayer(player, costItemName, amount);
//         }
//     }
// 
//     /**
//      * Takes the amount of money specified.
//      * Returns false if player doesn't have the money necessary
//      */
//     public void giveMoneyToPlayer(EntityPlayer player, int amount) {
//         if (costItemName.equals(CURRENCY_FORGE_ESSENTIALS) || costItemName.equals(CURRENCY_VAULT) || costItemName.startsWith(CURRENCY_CUSTOM)) {
//             IEconManager eco = economyManagerForUUID(player.getUniqueID());
//             if (eco == null)
//                 return;
//             eco.addToWallet(amount);
//         } else {
//             PlayerUtils.giveItemToPlayer(player, costItemName, amount);
//         }
//     }
// 
//     /**
//      * Gets the currency string currently used.
//      */
//     public String getCurrency(int amount) {
//         if(costItemName.equals(CURRENCY_FORGE_ESSENTIALS) || costItemName.equals(CURRENCY_VAULT) || costItemName.startsWith(CURRENCY_CUSTOM)) {
//             if (econManagerClass == null) {
//                 return null;
//             }
//             try {
//                 IEconManager manager = econManagerClass.newInstance();
//                 return manager.currency(amount);
//             } catch(Exception ex) {
//                 MyEssentialsCore.instance.LOG.info("Failed to create IEconManager", ex);
//             }
//             return "$";
// 
//         } else {
//             return ItemUtils.itemStackFromName(costItemName).getDisplayName() + (amount == 1 ? "" : "s");
//         }
//     }
// }
// 
// Path: src/main/java/myessentials/economy/api/IEconManager.java
// public interface IEconManager {
// 
//     void setPlayer(UUID uuid);
// 
//     /**
//      * Add a set amount to a target's Wallet
//      */
//     void addToWallet(int amountToAdd);
// 
//     /**
//      * Get the amount of money the player has
//      */
//     int getWallet();
// 
//     /**
//      * Remove a set amount from a target's Wallet
//      * returns true if it succeded, false if it didn't
//      */
//     boolean removeFromWallet(int amountToSubtract);
// 
//     /**
//      * Set the target's Wallet to the specified amount
//      */
//     void setWallet(int setAmount, EntityPlayer player);
// 
//     /**
//      * Gets the singular or plural term of the currency used
//      */
//     String currency(int amount);
// 
//     /**
//      * Gets a combo of getWallet + currency
//      */
//     String getMoneyString();
//     
//     /**
//      * Saves all wallets to disk
//      * (for users still on the server when it's stopping)
//      */
//     void save();
// 
//     Map<String, Integer> getItemTables();
// }
// 
// Path: src/test/java/myessentials/test/MECTest.java
// public class MECTest extends BaseTest {
// 
//     @Before
//     public void initConfig() {
//         TestConfig.instance.init(configFile, Constants.MOD_ID);
//     }
// 
// }


// Path: src/test/java/myessentials/test/economy/EconomyForgeEssentialsTest.java
import metest.api.TestPlayer;
import myessentials.economy.api.Economy;
import myessentials.economy.api.IEconManager;
import myessentials.test.MECTest;
import net.minecraft.entity.player.EntityPlayerMP;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

package myessentials.test.economy;



public class EconomyForgeEssentialsTest extends MECTest {

    private EntityPlayerMP player;
    private Economy economy;
    private IEconManager manager;