Package org.jboss.test.cmp2.commerce

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


   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);
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);
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);
View Full Code Here

   // Tests ---------------------------------------------------
   public void testStandaloneFKMapping() throws Exception
   {
      InstituteLocal institute = null;
      DepartmentLocal department = null;
      try {
         institute = getInstituteHome().create("NTUUKPI", "Natinal Technical University Of The Ukraine KPI");
         department = getDepartmentHome().create("KV", "Specialized Computer Systems");
         institute.getDepartments().add(department);
         assertTrue("department.getInstitute().isIdentical(institute)", department.getInstitute().isIdentical(institute));
         department.setInstitute(null);
         assertTrue("institute.getDepartments().isEmpty()", institute.getDepartments().isEmpty());
      } finally {
         removeEntity(institute);
         removeEntity(department);
      }
View Full Code Here

         removeEntity(department);
      }
   }

   public void testJoing() throws Exception {
      DepartmentLocal department = null;
      GroupLocal kv62Group = null;
      GroupLocal kv63Group = null;
      try {
         System.out.println("testJoin()");
         department = getDepartmentHome().create("KV", "Specialized Computer Systems");
View Full Code Here

   }

   public void testCompleteFKToPKMapping()
         throws Exception
   {
      DepartmentLocal department = null;
      GroupLocal kv62Group = null;
      try {
         // one-side instance created before many-side instance
         department = getDepartmentHome().create("KV", "Specialized Computer Systems");
         assertTrue("department.getGroups().isEmpty()", department.getGroups().isEmpty());

         kv62Group = getGroupHome().create("KV", 62, "KV-62");
         assertTrue("department.getGroups().contains(kv62Group)", department.getGroups().contains(kv62Group));
         assertTrue("kv62Group.getDepartment().isIdentical(department)", kv62Group.getDepartment().isIdentical(department));

         kv62Group.remove();
         assertTrue("department.getGroups().isEmpty()", department.getGroups().isEmpty());

         // many-side instance created before one-side instance
         department.remove();
         kv62Group = getGroupHome().create("KV", 62, "KV-62");
         assertTrue("kv62Group.getDepartment() == null", kv62Group.getDepartment() == null);

         department = getDepartmentHome().create("KV", "Specialized Computer Systems");
         assertTrue("kv62Group.getDepartment().isIdentical(department)", kv62Group.getDepartment().isIdentical(department));
         assertTrue("department.getGroups().contains(kv62Group)", department.getGroups().contains(kv62Group));

         department.remove();
         department = null;
         assertTrue("kv62Group.getDepartment() == null", kv62Group.getDepartment() == null);
      } finally {
         removeEntity(department);
         removeEntity(kv62Group);
View Full Code Here

   public void testFKToCMPMapping()
         throws Exception
   {
      GroupLocal kv61Group = null;
      GroupLocal kv62Group = null;
      ExamenationLocal exam = null;
      try {
         kv62Group = getGroupHome().create("KV", 62, "KV-62");
         exam = getExamHome().create("kv61-1", "Math", "KV", 62);
         assertTrue("kv62Group.isIdentical(exam.getGroup())", kv62Group.isIdentical(exam.getGroup()));
         assertTrue("kv62Group.getExamenations().contains(exam)", kv62Group.getExamenations().contains(exam));

         kv61Group = getGroupHome().create("KV", 61, "KV-61");
         exam.setGroup(kv61Group);
         assertTrue("expected: exam.getGroupNumber() == 61;"
                    + " got: exam.getGroupNumber() == " + exam.getGroupNumber(),
                    exam.getGroupNumber() == 61);

         exam.setGroupNumber(62);
         assertTrue("kv62Group.isIdentical(exam.getGroup())", kv62Group.isIdentical(exam.getGroup()));
         assertTrue("kv62Group.getExamenations().contains(exam);", kv62Group.getExamenations().contains(exam));
         assertTrue("kv61Group.getExamenations().isEmpty();", kv61Group.getExamenations().isEmpty());

         exam.setDepartmentCode("KM");
         exam.setDepartmentCode2("XKM");
         assertTrue("exam.getGroup() == null", exam.getGroup() == null);
         assertTrue("kv62Group.getExamenations().isEmpty();", kv62Group.getExamenations().isEmpty());

         exam.setDepartmentCode("KV");
         exam.setDepartmentCode2("XKV");
         assertTrue("kv62Group.isIdentical(exam.getGroup())", kv62Group.isIdentical(exam.getGroup()));
         assertTrue("kv62Group.getExamenations().contains(exam);", kv62Group.getExamenations().contains(exam));
      } finally {
         removeEntity(exam);
         removeEntity(kv61Group);
         removeEntity(kv62Group);
View Full Code Here

      }
   }

   public void testJoing() throws Exception {
      DepartmentLocal department = null;
      GroupLocal kv62Group = null;
      GroupLocal kv63Group = null;
      try {
         System.out.println("testJoin()");
         department = getDepartmentHome().create("KV", "Specialized Computer Systems");
         kv62Group = getGroupHome().create("KV", 62, "KV-62");
         kv63Group = getGroupHome().create("KV", 63, "KV-63");
View Full Code Here

   public void testCompleteFKToPKMapping()
         throws Exception
   {
      DepartmentLocal department = null;
      GroupLocal kv62Group = null;
      try {
         // one-side instance created before many-side instance
         department = getDepartmentHome().create("KV", "Specialized Computer Systems");
         assertTrue("department.getGroups().isEmpty()", department.getGroups().isEmpty());

         kv62Group = getGroupHome().create("KV", 62, "KV-62");
         assertTrue("department.getGroups().contains(kv62Group)", department.getGroups().contains(kv62Group));
         assertTrue("kv62Group.getDepartment().isIdentical(department)", kv62Group.getDepartment().isIdentical(department));

         kv62Group.remove();
         assertTrue("department.getGroups().isEmpty()", department.getGroups().isEmpty());

         // many-side instance created before one-side instance
         department.remove();
         kv62Group = getGroupHome().create("KV", 62, "KV-62");
         assertTrue("kv62Group.getDepartment() == null", kv62Group.getDepartment() == null);

         department = getDepartmentHome().create("KV", "Specialized Computer Systems");
         assertTrue("kv62Group.getDepartment().isIdentical(department)", kv62Group.getDepartment().isIdentical(department));
         assertTrue("department.getGroups().contains(kv62Group)", department.getGroups().contains(kv62Group));

         department.remove();
         department = null;
         assertTrue("kv62Group.getDepartment() == null", kv62Group.getDepartment() == null);
      } finally {
         removeEntity(department);
         removeEntity(kv62Group);
      }
   }
View Full Code Here

   public void testPartialFKToPKMapping()
         throws Exception
   {
      StudentLocal petrovStudent = null;
      StudentLocal sidorovStudent = null;
      GroupLocal group = null;
      try {
         petrovStudent = getStudentHome().create("KV", "Petrov", "Petrov works on KV department.");
         group = getGroupHome().create("KV", 62, "KV-62");
         assertTrue("petrovStudent.getGroup() == null", petrovStudent.getGroup() == null);

         petrovStudent.setGroup(group);
         assertTrue("group.isIdentical(petrovStudent.getGroup())", group.isIdentical(petrovStudent.getGroup()));
         assertTrue("group.getStudents().contains(petrovStudent)", group.getStudents().contains(petrovStudent));

         sidorovStudent = getStudentHome().create("KV", "Sidorov", "Sidorov works on KV department.");
         group.getStudents().add(sidorovStudent);
         assertTrue("sidorovStudent.getGroup().isIdentical(group)", sidorovStudent.getGroup().isIdentical(group));
         assertTrue("group.getStudents().contains(petrovStudent)", group.getStudents().contains(petrovStudent));
         assertTrue("group.getStudents().contains(sidorovStudent)", group.getStudents().contains(sidorovStudent));

         group.remove();
         group = null;
         assertTrue("petrovStudent.getGroup() == null", petrovStudent.getGroup() == null);
         assertTrue("sidorovStudent.getGroup() == null", sidorovStudent.getGroup() == null);

         /*
 
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.