Package com.gwesm

Source Code of com.gwesm.TestAccounts

package com.gwesm;

import junit.framework.Assert;

import org.junit.Test;

import com.gwesm.core.Account;
import com.gwesm.core.GWESM;
import com.gwesm.dao.CastorDAO;
import com.gwesm.dao.DAO;

public class TestAccounts {

  @Test
  public void testSaveGWESM() throws Exception {

    final String outputFile = "testsData\\outputs\\SaveGWESM.xml";
    DAO dao = new CastorDAO();

    // Creation de l'arbre
    GWESM gwesm = new GWESM();

    Account account1 = new Account("Mon Compte");
    gwesm.addAccount(account1);

    // Verif création
    Assert.assertEquals(1, gwesm.getAccounts().size());

    // Sauvegarde
    dao.saveData(gwesm, outputFile);

    // Chargement
    GWESM loadedGwesm = dao.loadData(outputFile);
    // Verif persistence
    Assert.assertEquals(1, loadedGwesm.getAccounts().size());

  }
}
TOP

Related Classes of com.gwesm.TestAccounts

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.