Package eu.planets_project.tb.impl

Examples of eu.planets_project.tb.impl.TestBean


  /* (non-Javadoc)
   * Note: The TestBean test Object must must be the one that is already persisted
   * @see test.eu.planets_project.tb.TesterRemote#updateExistingTestEntry(int, eu.planets_project.tb.impl.TestBean)
   */
  public void updateExistingTestEntry(int pKey, String sName, int htableKey, String htableValue){
    TestBean t_helper = manager.find(TestBean.class, pKey);
    //System.out.println("updating: "+t_helper.getId()+" "+t_helper.getName());
    t_helper.setName(sName);
    t_helper.setKeyValuePairs(htableKey, htableValue);
    manager.persist(t_helper);
  }
View Full Code Here


    t_helper.setKeyValuePairs(htableKey, htableValue);
    manager.persist(t_helper);
  }
 
  public void deleteTestEntry(int pKey){
    TestBean t_helper = manager.find(TestBean.class, pKey);
    manager.remove(t_helper);
  }
View Full Code Here

      Context jndiContext = getInitialContext();
      //Object ref = jndiContext.lookup("java:eu/planets_project/tb/TestWizzard/local");
      TesterRemote dao_r = (TesterRemote) PortableRemoteObject.narrow(jndiContext.lookup("TestWizzard/remote"), TesterRemote.class);
     
      System.out.println("Before finding ID1");
      TestBean test_find1 = dao_r.findTestEntry(1);
      System.out.println("found ID "+test_find1.getId());
      System.out.println("found Name "+test_find1.getName());
     
      System.out.println("Before finding ID2");
      TestBean test_find2 = dao_r.findTestEntry(2);
      System.out.println("found ID "+test_find2.getId());
      System.out.println("found Name "+test_find2.getName());
     
      /*System.out.println("Via Local Interface");
      TesterLocal dao_l = (TesterLocal) jndiContext.lookup("TestWizzard/local");
      jndiContext.lookup("TestWizzard/local");
     
View Full Code Here

      System.out.println("Via Remote Interface");
      Context jndiContext = getInitialContext();
      //Object ref = jndiContext.lookup("java:eu/planets_project/tb/TestWizzard/local");
      TesterRemote dao_r = (TesterRemote) PortableRemoteObject.narrow(jndiContext.lookup("TestWizzard/remote"), TesterRemote.class);

      TestBean test_1 = new TestBean();
      test_1.setId(1);
      test_1.setName("Andrew1");
      System.out.println("Before storing ID1");
      dao_r.createTestEntry(test_1);
      System.out.println("Successfully stored ID1");
     
      TestBean test_2 = new TestBean();
      test_2.setId(2);
      test_2.setName("Andrew2");
      System.out.println("Before storing ID2");
      dao_r.createTestEntry(test_2);
      System.out.println("Successfully stored ID2");
     
      System.out.println("Before finding ID1");
      TestBean test_find1 = dao_r.findTestEntry(1);
      System.out.println("found ID "+test_find1.getId());
      System.out.println("found Name "+test_find1.getName());
     
      System.out.println("Before finding ID2");
      TestBean test_find2 = dao_r.findTestEntry(2);
      System.out.println("found ID "+test_find2.getId());
      System.out.println("found Name "+test_find2.getName());
     
      /*System.out.println("Via Local Interface");
      TesterLocal dao_l = (TesterLocal) jndiContext.lookup("TestWizzard/local");
      jndiContext.lookup("TestWizzard/local");
     
View Full Code Here

      jndiContext = getInitialContext();

      dao_r = (TesterRemote) PortableRemoteObject.narrow(
        jndiContext.lookup("ejb/TestWizzard/remote"), TesterRemote.class);

      TestBean test_1 = new TestBean();
      test_1.setId(1);
      test_1.setName("Andrew1");
      //System.out.println("Setup: Before storing ID1");
      dao_r.createTestEntry(test_1);
      //System.out.println("Setup: Successfully stored ID1");
   
      TestBean test_2 = new TestBean();
      test_2.setId(2);
      test_2.setName("Andrew2");
      //System.out.println("Setup: Before storing ID2");
      dao_r.createTestEntry(test_2);
      //System.out.println("Setup: Successfully stored ID2");
    } catch (NamingException e) {
      System.out.println("Setup: Exception while setUp: "+e.toString());
View Full Code Here

      }
  }
 
  public void testEntitiesCreated(){
   
    TestBean test_find1 = dao_r.findTestEntry(1);
    //System.out.println("found ID "+test_find1.getId());
    //System.out.println("found Name "+test_find1.getName());
   
    TestBean test_find2 = dao_r.findTestEntry(2);
    //System.out.println("found ID "+test_find2.getId());
    //System.out.println("found Name "+test_find2.getName());
   
    assertEquals("Andrew1",test_find1.getName());
    assertEquals("Andrew2",test_find2.getName());
   
  }
View Full Code Here

    //TestBean test_find1 = dao_r.findTestEntry(1);
    //test_find1.setName("NewName");
   
    dao_r.updateExistingTestEntry(1, "NewName",20, "20erWert");
   
    TestBean test_find2 = dao_r.findTestEntry(1);
    String htableValue = test_find2.getKeyValueOfPair(20);
    assertEquals("20erWert", htableValue);
    assertEquals("NewName",test_find2.getName());
  }
View Full Code Here

  }
 
  public void testEntitiesDeleted(){
    dao_r.deleteTestEntry(1);
    dao_r.deleteTestEntry(2);
    TestBean test_find1 = dao_r.findTestEntry(1);
    TestBean test_find2 = dao_r.findTestEntry(2);
   
    assertNull(test_find1);
    assertNull(test_find2);
  }
View Full Code Here

TOP

Related Classes of eu.planets_project.tb.impl.TestBean

Copyright © 2018 www.massapicom. 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.