Examples of TestingEntity


Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

    DbSchemaUtil ds = new DbSchemaUtil(this.em);
    ds.prepareDefaultTestData(true, true, true);
   
    DbDataUtil du = new DbDataUtil(this.em);
    du.cleanImport("/ch/inftec/ju/testing/db/DbDataUtilTest_testingEntity.xml");
    TestingEntity te = this.em.find(TestingEntity.class, 1L);
    Assert.assertEquals("DbDataUtilTest", te.getName());
  }
View Full Code Here

Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

  @Test
  public void canExportData_toXmlDocument() {
    DbSchemaUtil ds = new DbSchemaUtil(this.em);
    ds.prepareDefaultTestData(true, true, true);
   
    TestingEntity te = new TestingEntity();
    te.setName("Export Test");
    this.em.persist(te);
   
    DbDataUtil du = new DbDataUtil(this.em);
    Document doc = du.buildExport().addTable("TestingEntity").writeToXmlDocument();
    XPathGetter xg = new XPathGetter(doc);
View Full Code Here

Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

  @Test
  public void xmlExport_copesWithCamelCaseTable_andUsesUpperCaseColumnNames() {
    DbSchemaUtil ds = new DbSchemaUtil(this.em);
    ds.prepareDefaultTestData(true, true, true);
   
    TestingEntity te = new TestingEntity();
    te.setName("Export Test");
    this.em.persist(te);
   
    // Export table with camel case
    DbDataUtil du = new DbDataUtil(this.em);
    Document doc = du.buildExport().addTable("TestingEntity").writeToXmlDocument();
View Full Code Here

Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

    JuAssumeUtils.dbIsNot(this.emUtil, DbType.MYSQL);
       
    DbSchemaUtil ds = new DbSchemaUtil(this.em);
    ds.prepareDefaultTestData(true, true, true);
   
    TestingEntity te = new TestingEntity();
    te.setName("Export Test");
    this.em.persist(te);
   
    // Export table with camel case
    DbDataUtil du = new DbDataUtil(this.em);
    Document doc = du.buildExport().addTable("testingentity").writeToXmlDocument();
View Full Code Here

Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

    JuAssumeUtils.dbIsNot(this.emUtil, DbType.MYSQL);
   
    DbSchemaUtil ds = new DbSchemaUtil(this.em);
    ds.prepareDefaultTestData(true, true, true);
   
    TestingEntity te = new TestingEntity();
    te.setName("Export Test");
    this.em.persist(te);
   
    // Export table with camel case
    DbDataUtil du = new DbDataUtil(this.em);
    Document doc = du.buildExport().addTable("TESTINGENTITY").writeToXmlDocument();
View Full Code Here

Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

  @Test
  public void xmlExport_canApply_casedTableNames() {
    DbSchemaUtil ds = new DbSchemaUtil(this.em);
    ds.prepareDefaultTestData(true, true, true);
   
    TestingEntity te = new TestingEntity();
    te.setName("Export Test");
    this.em.persist(te);
   
    // Export table with camel case
    DbDataUtil du = new DbDataUtil(this.em);
    Document doc = du.buildExport()
View Full Code Here

Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

  @Test
  public void canExportTables_basedOnDatasetXml() {
    DbSchemaUtil ds = new DbSchemaUtil(this.em);
    ds.prepareDefaultTestData(true, true, true);
   
    TestingEntity te = new TestingEntity();
    te.setName("Export Test");
    this.em.persist(te);
   
    // Export table with camel case
    DbDataUtil du = new DbDataUtil(this.em);
    Document doc = du.buildExport()
View Full Code Here

Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

        URL url = JuUrl.resource("ch/inftec/ju/testing/db/DbDataUtilTest_jdbcConnectionImport.xml");
        DbDataUtil.executeInsert(connection, url, true);
      }
    });
   
    TestingEntity te = this.em.find(TestingEntity.class, 1L);
    Assert.assertEquals("DbDataUtilTest.jdbcConnection", te.getName());
  }
View Full Code Here

Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

  @DataSetExport(tablesDataSet="AbstractDbTestTransactionTest_testingEntity.xml", doPhysicalExport=false)
  public void multipleTransactions_areSupported() {
    // H2 has a locking strategy that will cause a timeout in this scenario
    JuAssumeUtils.dbIsNot(this.emUtil, DbType.H2);
   
    TestingEntity te1 = new TestingEntity("TE1");
    this.em.persist(te1);
   
    try (EmfWork ew2 = this.startNewWork()) {
      TestingEntity te2 = new TestingEntity("TE2");
      ew2.getEm().persist(te2);
     
      try (EmfWork ew3 = this.startNewWork()) {
        TestingEntity te3 = new TestingEntity("TE3");
        ew3.getEm().persist(te3);     
      }
     
      ew2.setRollbackOnly();
    }
View Full Code Here

Examples of ch.inftec.ju.testing.db.data.entity.TestingEntity

  public void canResetIdentityGeneration_forPrimeryKeys() {
    new DbSchemaUtil(this.emUtil).prepareDefaultSchemaAndTestData();
   
    // Try to set identity generation to 10
    this.emUtil.resetIdentityGenerationOrSequences(10);
    TestingEntity te1 = new TestingEntity();
    this.em.persist(te1);
    Assert.assertEquals(new Long(10L), te1.getId());
   
    // Delete all TestingEntities and set identity generation to 1
    this.em.createQuery("delete from TestingEntity t").executeUpdate();
    this.emUtil.resetIdentityGenerationOrSequences(1);
    TestingEntity te2 = new TestingEntity();
    this.em.persist(te2);
    Assert.assertEquals(new Long(1L), te2.getId());
  }
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.