Package org.jboss.test.cmp2.commerce

Examples of org.jboss.test.cmp2.commerce.CustomerHome


   }

   public void testFindByColorDeclaredSql()
      throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass childId = new IDClass(4);
      facade.createChild(childId);
      try
      {
         facade.setColor(childId, ColorEnum.BLUE);
         IDClass id = facade.findByColorDeclaredSql(ColorEnum.BLUE);
         assertEquals(childId, id);
      }
      finally
      {
         facade.removeChild(childId);
      }
   }
View Full Code Here


   }

   public void testLowColor()
      throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass childId = new IDClass(3);
      facade.createChild(childId);
      try
      {
         facade.setColor(childId, ColorEnum.RED);
         List ids = facade.findLowColor(ColorEnum.BLUE);
         assertEquals(1, ids.size());
         assertEquals(childId, ids.get(0));
      }
      finally
      {
         facade.removeChild(childId);
      }
   }
View Full Code Here

      }
   }

   public void testSelectColors() throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass[] ids = new IDClass[]{new IDClass(555), new IDClass(666), new IDClass(777)};

      try
      {
         facade.createChild(ids[0]);
         ColorEnum min = ColorEnum.RED.valueOf(0);
         facade.setColor(ids[0], min);

         facade.createChild(ids[1]);
         ColorEnum avg = ColorEnum.RED.valueOf(1);
         facade.setColor(ids[1], avg);

         facade.createChild(ids[2]);
         ColorEnum max = ColorEnum.RED.valueOf(2);
         facade.setColor(ids[2], max);

         ColorEnum color = facade.selectMinColor();
         assertEquals(min, color);     
         color = facade.selectMaxColor();
         assertEquals(max, color);
         color = facade.selectAvgColor();
         assertEquals(avg, color);
      }
      finally
      {
         for(int i = 0; i < ids.length; ++i)
            facade.removeChild(ids[i]);
      }
   }
View Full Code Here

      }
   }

   public void testSelectColor() throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass childId = new IDClass(6);
      facade.createChild(childId);
      try
      {
         facade.setColor(childId, ColorEnum.RED);
         ColorEnum color = facade.selectColor(childId);
         assertEquals(ColorEnum.RED, color);
      }
      finally
      {
         facade.removeChild(childId);
      }
   }
View Full Code Here

   // Tests

   public void testColorEnum()
      throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass childId = new IDClass(1);
      facade.createChild(childId);
      assertTrue(ColorEnum.RED == facade.getColorForId(childId));
      facade.setColor(childId, ColorEnum.GREEN);
      assertTrue(ColorEnum.GREEN == facade.getColorForId(childId));
      facade.setColor(childId, ColorEnum.BLUE);
      assertTrue(ColorEnum.BLUE == facade.getColorForId(childId));
      facade.removeChild(childId);
   }
View Full Code Here

   public void testColorEnum()
      throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass childId = new IDClass(1);
      facade.createChild(childId);
      assertTrue(ColorEnum.RED == facade.getColorForId(childId));
      facade.setColor(childId, ColorEnum.GREEN);
      assertTrue(ColorEnum.GREEN == facade.getColorForId(childId));
      facade.setColor(childId, ColorEnum.BLUE);
View Full Code Here

   public void testAnimalEnum()
      throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass childId = new IDClass(2);
      facade.createChild(childId);
      assertTrue(AnimalEnum.PENGUIN == facade.getAnimalForId(childId));
      facade.setAnimal(childId, AnimalEnum.DOG);
      assertTrue(AnimalEnum.DOG == facade.getAnimalForId(childId));
      facade.setAnimal(childId, AnimalEnum.CAT);
View Full Code Here

   public void testFindByColor()
      throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass childId = new IDClass(3);
      facade.createChild(childId);
      try
      {
         facade.setColor(childId, ColorEnum.BLUE);
         IDClass id = facade.findByColor(ColorEnum.BLUE);
         assertEquals(childId, id);
      }
      finally
      {
         facade.removeChild(childId);
View Full Code Here

   public void testFindAndOrderByColor()
      throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass childId = new IDClass(3);
      facade.createChild(childId);
      try
      {
         facade.setColor(childId, ColorEnum.BLUE);
         IDClass id = facade.findAndOrderByColor(ColorEnum.BLUE);
         assertEquals(childId, id);
      }
      finally
      {
         facade.removeChild(childId);
View Full Code Here

   public void testFindByColorDeclaredSql()
      throws Exception
   {
      Facade facade = FacadeUtil.getHome().create();
      IDClass childId = new IDClass(4);
      facade.createChild(childId);
      try
      {
         facade.setColor(childId, ColorEnum.BLUE);
         IDClass id = facade.findByColorDeclaredSql(ColorEnum.BLUE);
         assertEquals(childId, id);
      }
      finally
      {
         facade.removeChild(childId);
View Full Code Here

TOP

Related Classes of org.jboss.test.cmp2.commerce.CustomerHome

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.