Examples of Migrator


Examples of com.google.appengine.datanucleus.Migrator

    Key pIdKey = (Key)pId.getKey();
    Key cIdKey = (Key)cId.getKey();
    oldPM.close();

    // Migrate the data
    Migrator migrator = new Migrator(((JDOPersistenceManagerFactory)oldPMF).getNucleusContext());
    try {
      // Migrate the parent
      Entity pEntity = ds.get(pIdKey);
      boolean changed = migrator.migrate(pEntity, MigratorOneToOneParent.class);
      assertTrue("Parent entity should have been changed but wasnt", changed);
      if (changed) {
        ds.put(pEntity);
      }

      // Migrate the child
      Entity cEntity = ds.get(cIdKey);
      changed = migrator.migrate(cEntity, MigratorOneToOneChild.class);
      assertFalse("Child entity shouldnt have been changed but was", changed);
      if (changed) {
        ds.put(cEntity);
      }
View Full Code Here

Examples of com.google.appengine.datanucleus.Migrator

    Key pIdKey = (Key)pId.getKey();
    Key cIdKey = (Key)cId.getKey();
    oldPM.close();

    // Migrate the data
    Migrator migrator = new Migrator(((JDOPersistenceManagerFactory)oldPMF).getNucleusContext());
    try {
      // Migrate the parent
      Entity pEntity = ds.get(pIdKey);
      boolean changed = migrator.migrate(pEntity, MigratorOneToManyParent.class);
      assertTrue("Parent entity should have been changed but wasnt", changed);
      if (changed) {
        ds.put(pEntity);
      }

      // Migrate the child
      Entity cEntity = ds.get(cIdKey);
      changed = migrator.migrate(cEntity, MigratorOneToManyChild.class);
      assertFalse("Child entity shouldnt have been changed but was", changed);
      if (changed) {
        ds.put(cEntity);
      }
View Full Code Here

Examples of src.Migrator

import src.Migrator;

public class EquipamentoMigrationTest extends TestCase{
 
  public void testGetResultSet() throws Exception {
    Migrator migration = new EquipamentoMigration(Context.getSourceConnection(),Context.getDestinationConnection());
    ResultSet rs = migration.getResultSet();
   
    rs.next();
    assertEquals(13 ,rs.getMetaData().getColumnCount());
  }
View Full Code Here

Examples of src.Migrator

    rs.next();
    assertEquals(13 ,rs.getMetaData().getColumnCount());
  }

  public void testExecute() throws Exception {
    Migrator migration = new EquipamentoMigration(Context.getSourceConnection(),Context.getDestinationConnection());
    ResultSet rs = migration.getResultSet();
    rs.next();
   
    migration.execute(rs);
   
    Statement stm = (Statement) Context.getDestinationConnection().createStatement();
    ResultSet rs2 = (ResultSet) stm.executeQuery("SELECT id FROM EQUIPAMENTO WHERE id = " + rs.getLong(1));
    rs2.next();
   
View Full Code Here

Examples of src.Migrator

* TODO Montar um cenario de testes
*/

public class FilaInscricaoMigrationTest extends TestCase {
  public void testGetResultSet() throws Exception {
    Migrator migration = new FilaInscricaoMigration(Context
        .getSourceConnection(), Context.getDestinationConnection(),
        new Long(41), new Long(15));
    ResultSet rs = migration.getResultSet();

    rs.next();
    assertEquals(6, rs.getMetaData().getColumnCount());
  }
View Full Code Here

Examples of src.Migrator

    rs.next();
    assertEquals(6, rs.getMetaData().getColumnCount());
  }

  public void testExecute() throws Exception {
    Migrator migration = new FilaInscricaoMigration(Context
        .getSourceConnection(), Context.getDestinationConnection(),
        new Long(41), new Long(15));
    ResultSet rs = migration.getResultSet();
    rs.next();

    migration.execute(rs);

    Statement stm = (Statement) Context.getDestinationConnection()
        .createStatement();
    ResultSet rs2 = (ResultSet) stm
        .executeQuery("SELECT id FROM FILAINSCRICAO WHERE id = "
View Full Code Here

Examples of src.Migrator

import src.TurmaMigration;
import junit.framework.TestCase;

public class TurmaMigrationTest extends TestCase{
  public void testGetResultSet() throws Exception {
    Migrator migration = new TurmaMigration(Context.getSourceConnection(),Context.getDestinationConnection());
    ResultSet rs = migration.getResultSet();
   
    rs.next();
    assertEquals(9,rs.getMetaData().getColumnCount());
  }
View Full Code Here

Examples of src.Migrator

    rs.next();
    assertEquals(9,rs.getMetaData().getColumnCount());
  }
 
  public void testExecute() throws Exception {
    Migrator migration = new TurmaMigration(Context.getSourceConnection(),Context.getDestinationConnection());
    ResultSet rs = migration.getResultSet();
    rs.next();
   
    migration.execute(rs);
   
    Statement stm = (Statement) Context.getDestinationConnection().createStatement();
    ResultSet rs2 = (ResultSet) stm.executeQuery("SELECT id FROM TURMA WHERE id = " + rs.getLong(1));
    rs2.next();
   
View Full Code Here

Examples of src.Migrator

import src.PresencaMigration;

public class PresencaMigrationTest extends TestCase {
 
  public void testGetResultSet() throws Exception {
    Migrator migration = new PresencaMigration(Context.getSourceConnection(),Context.getDestinationConnection());
    ResultSet rs = migration.getResultSet();
   
    rs.next();
    assertEquals(7, rs.getMetaData().getColumnCount());
  }
View Full Code Here

Examples of src.Migrator

    rs.next();
    assertEquals(7, rs.getMetaData().getColumnCount());
  }

  public void testExecute() throws Exception {
    Migrator migration = new PresencaMigration(Context.getSourceConnection(),Context.getDestinationConnection());
    ResultSet rs = migration.getResultSet();
    rs.next();
   
    migration.execute(rs);
   
    Statement stm = (Statement) Context.getDestinationConnection().createStatement();
    ResultSet rs2 = (ResultSet) stm.executeQuery("SELECT id FROM PRESENCA WHERE id = " + rs.getLong(1));
    rs2.next();
   
View Full Code Here
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.