Examples of TestEntity


Examples of org.jboss.test.jbossts.crash.TestEntity

   private boolean checkDatabase(String entityPK)
   {
      try
      {
         TestEntityHelperRem hlp = (TestEntityHelperRem) config.getNamingContext(serverName).lookup(TestEntityHelper.REMOTE_JNDI_NAME);
         TestEntity recoveredEntity = hlp.getTestEntity(entityPK);

         if (recoveredEntity != null)
         {
            print("TestWithJPA#checkDatabase(): initEntity = " + initEntity);
            print("TestWithJPA#checkDatabase(): recoveredEntity = " + recoveredEntity);

            return (rollbackExpected) ? recoveredEntity.getA() == initEntity.getA()
                  : recoveredEntity.getA() != initEntity.getA();
           
         }
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jboss.test.jbossts.crash.TestEntity

         // name of this test will be the primary key for test record in DB
         String testEntityPKServer0 = getName() + "_" + serverName0;
         String testEntityPKServer1 = getName() + "_" + serverName1;
        
         // initialize databases
         TestEntity initEntityServer0 = initDatabase(serverName0, testEntityPKServer0);
         TestEntity initEntityServer1 = initDatabase(serverName1, testEntityPKServer1);

         // run the crash test
         boolean result = propagationTest(fSpecsNode0, fSpecsNode1, testEntityPKServer0, testEntityPKServer1);
         print("test result: " + result);
View Full Code Here

Examples of org.jboss.test.jbossts.crash.TestEntity

   private TestEntity initDatabase(String serverName, String entityPK) throws Exception
   {
      TestEntityHelperRem hlp = (TestEntityHelperRem) config.getNamingContext(serverName).lookup(TestEntityHelper.REMOTE_JNDI_NAME);

      TestEntity initEntity = hlp.initTestEntity(entityPK);
//      if (isDebug)
//         print("TestContextPropagation#initDatabase(serverName=" + serverName + "): initEntity = " + initEntity);

      return initEntity;
   }
View Full Code Here

Examples of org.jboss.test.jbossts.crash.TestEntity

   private boolean checkDatabase(String serverName, String entityPK, TestEntity initEntity)
   {
      try
      {
         TestEntityHelperRem hlp = (TestEntityHelperRem) config.getNamingContext(serverName).lookup(TestEntityHelper.REMOTE_JNDI_NAME);
         TestEntity checkedEntity = hlp.getTestEntity(entityPK);

         if (checkedEntity != null)
         {
//            if (isDebug)
//            {
//               print("TestContextPropagation#checkDatabase(serverName=" + serverName + "): initEntity = " + initEntity);
//               print("TestContextPropagation#checkDatabase(serverName=" + serverName + "): checkedEntity = " + checkedEntity);
//            }

            return (rollbackExpected) ? checkedEntity.getA() == initEntity.getA()
                  : checkedEntity.getA() != initEntity.getA();
         }
      }
      catch (Exception e)
      {
         e.printStackTrace();
View Full Code Here

Examples of org.jboss.test.jpa.support.TestEntity

            EntityManager em = (EntityManager) ctx.lookup("java:comp/env/persistence/em");
           
            String mode = req.getParameter("mode");
            if ("Write".equals(mode))
            {
               TestEntity test = new TestEntity("Hello", "World");
               em.persist(test);
            }
            else
            {
               TestEntity test = em.find(TestEntity.class, "Hello");
               resp.setContentType("text/plain");
               PrintWriter out = resp.getWriter();
               out.print(test.getDescription());
               out.close();
            }
         }
         catch (Exception e)
         {
View Full Code Here

Examples of org.jboss.test.jpa.support.TestEntity

            EntityManager em = (EntityManager) ctx.lookup("java:comp/env/persistence/em");
           
            String mode = req.getParameter("mode");
            if ("Write".equals(mode))
            {
               TestEntity test = new TestEntity("Hello", "World");
               em.persist(test);
            }
            else
            {
               TestEntity test = em.find(TestEntity.class, "Hello");
               resp.setContentType("text/plain");
               PrintWriter out = resp.getWriter();
               out.print(test.getDescription());
               out.close();
            }
         }
         catch (Exception e)
         {
View Full Code Here

Examples of org.kitesdk.data.hbase.avro.entities.TestEntity

    ds.put(createSpecificEntity(1));

    DatasetWriter<TestEntity> writer = ds.newWriter();
    try {
      for (int i = 2; i < 10; ++i) {
        TestEntity entity = createSpecificEntity(i);
        writer.write(entity);
      }
    } finally {
      writer.close();
    }

    // ensure the new entities are what we expect with get operations
    for (int i = 0; i < 10; ++i) {
      String iStr = Long.toString(i);
      Key key = new Key.Builder(ds)
          .add("part1", "part1_" + iStr)
          .add("part2", "part2_" + iStr).build();
      compareEntitiesWithString(i, ds.get(key));
    }

    // ensure the new entities are what we expect with scan operations
    int cnt = 0;
    DatasetReader<TestEntity> reader = ds.newReader();
    try {
      for (TestEntity entity : reader) {
        compareEntitiesWithString(cnt, entity);
        cnt++;
      }
      assertEquals(10, cnt);
    } finally {
      reader.close();
    }

    Key key = new Key.Builder(ds)
        .add("part1", "part1_5")
        .add("part2", "part2_5").build();

    // test delete
    ds.delete(key);
    TestEntity deletedRecord = ds.get(key);
    assertNull(deletedRecord);
  }
View Full Code Here

Examples of org.springframework.test.context.transaction.ejb.model.TestEntity

  @PersistenceContext
  protected EntityManager entityManager;


  protected final TestEntity getTestEntity(String name) {
    TestEntity te = entityManager.find(TestEntity.class, name);
    if (te == null) {
      te = new TestEntity(name, 0);
      entityManager.persist(te);
    }
    return te;
  }
View Full Code Here

Examples of ru.dreamteam.couch.TestEntity

        createTestEntity("d");
        createTestEntity("x");
    }

    private void createTestEntity(String s) {
        TestEntity entity = new TestEntity();
        entity.setText(s);
        db.save(entity);
    }
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.