Package org.jboss.verifier

Examples of org.jboss.verifier.Section


/*      */
/*  344 */     if (session.isStateless())
/*      */     {
/*  346 */       if (!hasDefaultCreateMethod(this.home))
/*      */       {
/*  348 */         fireSpecViolationEvent(session, new Section("7.11.6.d2"));
/*  349 */         status = false;
/*      */       }
/*      */       else
/*      */       {
/*  353 */         Method create = getDefaultCreateMethod(this.home);
/*      */
/*  355 */         if (hasMoreThanOneCreateMethods(this.home))
/*      */         {
/*  357 */           fireSpecViolationEvent(session, new Section("7.11.6.d2"));
/*  358 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */
/*  368 */     if (!hasEJBHomeInterface(this.home))
/*      */     {
/*  370 */       fireSpecViolationEvent(session, new Section("7.11.6.a"));
/*  371 */       status = false;
/*      */     }
/*      */
/*  385 */     Iterator it = Arrays.asList(this.home.getMethods()).iterator();
/*  386 */     while (it.hasNext())
/*      */     {
/*  388 */       Method method = (Method)it.next();
/*      */
/*  390 */       if (!hasLegalRMIIIOPArguments(method))
/*      */       {
/*  392 */         fireSpecViolationEvent(session, method, new Section("7.11.6.b1"));
/*  393 */         status = false;
/*      */       }
/*      */
/*  396 */       if (!hasLegalRMIIIOPReturnType(method))
/*      */       {
/*  398 */         fireSpecViolationEvent(session, method, new Section("7.11.6.b2"));
/*  399 */         status = false;
/*      */       }
/*      */
/*  402 */       if (!throwsRemoteException(method))
/*      */       {
/*  404 */         fireSpecViolationEvent(session, method, new Section("7.11.6.b3"));
/*  405 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/*  414 */     if (!hasCreateMethod(this.home))
/*      */     {
/*  416 */       fireSpecViolationEvent(session, new Section("7.11.6.d1"));
/*  417 */       status = false;
/*      */     }
/*      */
/*  440 */     Iterator createMethods = getCreateMethods(this.home);
/*  441 */     while (createMethods.hasNext())
/*      */     {
/*  443 */       Method create = (Method)createMethods.next();
/*      */
/*  445 */       if (!hasMatchingEJBCreate(this.bean, create))
/*      */       {
/*  447 */         fireSpecViolationEvent(session, create, new Section("7.11.6.e"));
/*  448 */         status = false;
/*      */       }
/*      */
/*  451 */       if (!hasRemoteReturnType(session, create))
/*      */       {
/*  453 */         fireSpecViolationEvent(session, create, new Section("7.11.6.f"));
/*  454 */         status = false;
/*      */       }
/*      */
/*  457 */       if (hasMatchingEJBCreate(this.bean, create))
/*      */       {
/*  459 */         Method ejbCreate = getMatchingEJBCreate(this.bean, create);
/*  460 */         if (!hasMatchingExceptions(ejbCreate, create))
/*      */         {
/*  462 */           fireSpecViolationEvent(session, create, new Section("7.11.6.g"));
/*      */
/*  464 */           status = false;
/*      */         }
/*      */       }
/*      */
/*  468 */       if (!throwsCreateException(create))
/*      */       {
/*  470 */         fireSpecViolationEvent(session, create, new Section("7.11.6.h"));
/*  471 */         status = false;
/*      */       }
/*      */     }
/*      */
/*  475 */     return status;
View Full Code Here


/*      */
/*  495 */     if (session.isStateless())
/*      */     {
/*  497 */       if (!hasDefaultCreateMethod(this.localHome))
/*      */       {
/*  499 */         fireSpecViolationEvent(session, new Section("7.11.8.d2"));
/*  500 */         status = false;
/*      */       }
/*      */       else
/*      */       {
/*  504 */         Method create = getDefaultCreateMethod(this.localHome);
/*      */
/*  506 */         if (hasMoreThanOneCreateMethods(this.localHome))
/*      */         {
/*  508 */           fireSpecViolationEvent(session, new Section("7.11.8.d2"));
/*  509 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */
/*  519 */     if (!hasEJBLocalHomeInterface(this.localHome))
/*      */     {
/*  521 */       fireSpecViolationEvent(session, new Section("7.11.8.a"));
/*  522 */       status = false;
/*      */     }
/*      */
/*  530 */     Iterator it = Arrays.asList(this.localHome.getMethods()).iterator();
/*  531 */     while (it.hasNext())
/*      */     {
/*  533 */       Method method = (Method)it.next();
/*      */
/*  535 */       if (throwsRemoteException(method))
/*      */       {
/*  537 */         fireSpecViolationEvent(session, method, new Section("7.11.8.b"));
/*  538 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/*  547 */     if (!hasCreateMethod(this.localHome))
/*      */     {
/*  549 */       fireSpecViolationEvent(session, new Section("7.11.8.d1"));
/*  550 */       status = false;
/*      */     }
/*      */
/*  573 */     Iterator createMethods = getCreateMethods(this.localHome);
/*  574 */     while (createMethods.hasNext())
/*      */     {
/*  576 */       Method create = (Method)createMethods.next();
/*      */
/*  578 */       if (!hasMatchingEJBCreate(this.bean, create))
/*      */       {
/*  580 */         fireSpecViolationEvent(session, create, new Section("7.11.8.e"));
/*      */
/*  582 */         status = false;
/*      */       }
/*      */
/*  585 */       if (!hasLocalReturnType(session, create))
/*      */       {
/*  587 */         fireSpecViolationEvent(session, create, new Section("7.11.8.f"));
/*      */
/*  589 */         status = false;
/*      */       }
/*      */
/*  592 */       if (hasMatchingEJBCreate(this.bean, create))
/*      */       {
/*  594 */         Method ejbCreate = getMatchingEJBCreate(this.bean, create);
/*  595 */         if (!hasMatchingExceptions(ejbCreate, create))
/*      */         {
/*  597 */           fireSpecViolationEvent(session, create, new Section("7.11.8.g"));
/*      */         }
/*      */
/*      */       }
/*      */
/*  602 */       if (!throwsCreateException(create))
/*      */       {
/*  604 */         fireSpecViolationEvent(session, create, new Section("7.11.8.h"));
/*      */
/*  606 */         status = false;
/*      */       }
/*      */     }
/*      */
View Full Code Here

/*      */   {
/*  618 */     boolean status = true;
/*      */
/*  625 */     if (!hasEJBObjectInterface(this.remote))
/*      */     {
/*  627 */       fireSpecViolationEvent(session, new Section("7.11.5.a"));
/*  628 */       status = false;
/*      */     }
/*      */
/*  642 */     Iterator it = Arrays.asList(this.remote.getMethods()).iterator();
/*  643 */     while (it.hasNext())
/*      */     {
/*  645 */       Method method = (Method)it.next();
/*      */
/*  647 */       if (!hasLegalRMIIIOPArguments(method))
/*      */       {
/*  649 */         fireSpecViolationEvent(session, method, new Section("7.11.5.b1"));
/*  650 */         status = false;
/*      */       }
/*      */
/*  653 */       if (!hasLegalRMIIIOPReturnType(method))
/*      */       {
/*  655 */         fireSpecViolationEvent(session, method, new Section("7.11.5.b2"));
/*  656 */         status = false;
/*      */       }
/*      */
/*  659 */       if (!throwsRemoteException(method))
/*      */       {
/*  661 */         fireSpecViolationEvent(session, method, new Section("7.11.5.b3"));
/*  662 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/*  679 */     it = Arrays.asList(this.remote.getDeclaredMethods()).iterator();
/*  680 */     while (it.hasNext())
/*      */     {
/*  682 */       Method remoteMethod = (Method)it.next();
/*      */
/*  684 */       if (!hasMatchingMethod(this.bean, remoteMethod))
/*      */       {
/*  686 */         fireSpecViolationEvent(session, remoteMethod, new Section("7.11.5.d1"));
/*      */
/*  689 */         status = false;
/*      */       }
/*      */
/*  692 */       if (hasMatchingMethod(this.bean, remoteMethod))
/*      */       {
/*      */         try
/*      */         {
/*  696 */           Method beanMethod = this.bean.getMethod(remoteMethod.getName(), remoteMethod.getParameterTypes());
/*      */
/*  699 */           if (!hasMatchingReturnType(remoteMethod, beanMethod))
/*      */           {
/*  701 */             fireSpecViolationEvent(session, remoteMethod, new Section("7.11.5.d2"));
/*      */
/*  703 */             status = false;
/*      */           }
/*      */
/*  706 */           if (!hasMatchingExceptions(beanMethod, remoteMethod))
/*      */           {
/*  708 */             fireSpecViolationEvent(session, remoteMethod, new Section("7.11.5.d3"));
/*      */
/*  710 */             status = false;
/*      */           }
/*      */         }
/*      */         catch (NoSuchMethodException ignored)
View Full Code Here

/*      */   {
/*  727 */     boolean status = true;
/*      */
/*  734 */     if (!hasEJBLocalObjectInterface(this.local))
/*      */     {
/*  736 */       fireSpecViolationEvent(session, new Section("7.11.7.a"));
/*  737 */       status = false;
/*      */     }
/*      */
/*  745 */     Iterator it = Arrays.asList(this.local.getMethods()).iterator();
/*  746 */     while (it.hasNext())
/*      */     {
/*  748 */       Method method = (Method)it.next();
/*  749 */       if (throwsRemoteException(method))
/*      */       {
/*  751 */         fireSpecViolationEvent(session, method, new Section("7.11.7.b"));
/*  752 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/*  769 */     it = Arrays.asList(this.local.getDeclaredMethods()).iterator();
/*  770 */     while (it.hasNext())
/*      */     {
/*  772 */       Method localMethod = (Method)it.next();
/*      */
/*  774 */       if (!hasMatchingMethod(this.bean, localMethod))
/*      */       {
/*  776 */         fireSpecViolationEvent(session, localMethod, new Section("7.11.7.d1"));
/*      */
/*  778 */         status = false;
/*      */       }
/*      */
/*  781 */       if (hasMatchingMethod(this.bean, localMethod))
/*      */       {
/*      */         try
/*      */         {
/*  785 */           Method beanMethod = this.bean.getMethod(localMethod.getName(), localMethod.getParameterTypes());
/*      */
/*  788 */           if (!hasMatchingReturnType(localMethod, beanMethod))
/*      */           {
/*  790 */             fireSpecViolationEvent(session, localMethod, new Section("7.11.7.d2"));
/*      */
/*  792 */             status = false;
/*      */           }
/*      */
/*  795 */           if (!hasMatchingExceptions(beanMethod, localMethod))
/*      */           {
/*  797 */             fireSpecViolationEvent(session, localMethod, new Section("7.11.7.d3"));
/*      */
/*  799 */             status = false;
/*      */           }
/*      */         }
/*      */         catch (NoSuchMethodException ignored)
View Full Code Here

/*      */   {
/*  816 */     boolean status = true;
/*      */
/*  823 */     if (!hasSessionBeanInterface(this.bean))
/*      */     {
/*  825 */       fireSpecViolationEvent(session, new Section("7.11.2.a"));
/*  826 */       status = false;
/*      */     }
/*      */
/*  838 */     if (hasSessionSynchronizationInterface(this.bean))
/*      */     {
/*  840 */       if (session.isStateless())
/*      */       {
/*  842 */         fireSpecViolationEvent(session, new Section("7.5.3.a"));
/*  843 */         status = false;
/*      */       }
/*      */
/*  846 */       if (session.isBeanManagedTx())
/*      */       {
/*  848 */         fireSpecViolationEvent(session, new Section("7.5.3.b"));
/*  849 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/*  858 */     if (!hasEJBCreateMethod(this.bean, true))
/*      */     {
/*  860 */       fireSpecViolationEvent(session, new Section("7.11.3"));
/*  861 */       status = false;
/*      */     }
/*      */
/*  869 */     if ((hasSessionSynchronizationInterface(this.bean)) && (session.isBeanManagedTx()))
/*      */     {
/*  872 */       fireSpecViolationEvent(session, new Section("7.6.1"));
/*  873 */       status = false;
/*      */     }
/*      */
/*  880 */     if (!isPublic(this.bean))
/*      */     {
/*  882 */       fireSpecViolationEvent(session, new Section("7.11.2.b1"));
/*  883 */       status = false;
/*      */     }
/*      */
/*  890 */     if (isFinal(this.bean))
/*      */     {
/*  892 */       fireSpecViolationEvent(session, new Section("7.11.2.b2"));
/*  893 */       status = false;
/*      */     }
/*      */
/*  900 */     if (isAbstract(this.bean))
/*      */     {
/*  902 */       fireSpecViolationEvent(session, new Section("7.11.2.b3"));
/*  903 */       status = false;
/*      */     }
/*      */
/*  911 */     if (!hasDefaultConstructor(this.bean))
/*      */     {
/*  913 */       fireSpecViolationEvent(session, new Section("7.11.2.c"));
/*  914 */       status = false;
/*      */     }
/*      */
/*  921 */     if (hasFinalizer(this.bean))
/*      */     {
/*  923 */       fireSpecViolationEvent(session, new Section("7.11.2.d"));
/*  924 */       status = false;
/*      */     }
/*      */
/*  939 */     if (hasEJBCreateMethod(this.bean, true))
/*      */     {
/*  941 */       Iterator it = getEJBCreateMethods(this.bean);
/*  942 */       while (it.hasNext())
/*      */       {
/*  944 */         Method ejbCreate = (Method)it.next();
/*      */
/*  946 */         if (!isPublic(ejbCreate))
/*      */         {
/*  948 */           fireSpecViolationEvent(session, ejbCreate, new Section("7.11.3.b"));
/*      */
/*  950 */           status = false;
/*      */         }
/*      */
/*  953 */         if ((isFinal(ejbCreate)) || (isStatic(ejbCreate)))
/*      */         {
/*  955 */           fireSpecViolationEvent(session, ejbCreate, new Section("7.11.3.c"));
/*      */
/*  957 */           status = false;
/*      */         }
/*      */
/*  960 */         if (!hasVoidReturnType(ejbCreate))
/*      */         {
/*  962 */           fireSpecViolationEvent(session, ejbCreate, new Section("7.11.3.d"));
/*      */
/*  964 */           status = false;
/*      */         }
/*      */
/*  967 */         if (!hasLegalRMIIIOPArguments(ejbCreate))
/*      */         {
/*  969 */           fireSpecViolationEvent(session, ejbCreate, new Section("7.11.3.e"));
/*      */
/*  971 */           status = false;
/*      */         }
/*      */       }
/*      */     }
View Full Code Here

/*      */   {
/*  984 */     boolean status = true;
/*      */
/*  991 */     if (!hasEJBHomeInterface(this.home))
/*      */     {
/*  993 */       fireSpecViolationEvent(entity, new Section("12.2.9.a"));
/*  994 */       status = false;
/*      */     }
/*      */
/* 1008 */     Iterator methods = Arrays.asList(this.home.getMethods()).iterator();
/* 1009 */     while (methods.hasNext())
/*      */     {
/* 1011 */       Method method = (Method)methods.next();
/*      */
/* 1013 */       if (!hasLegalRMIIIOPArguments(method))
/*      */       {
/* 1015 */         fireSpecViolationEvent(entity, method, new Section("12.2.9.b1"));
/*      */
/* 1017 */         status = false;
/*      */       }
/*      */
/* 1020 */       if (!hasLegalRMIIIOPReturnType(method))
/*      */       {
/* 1022 */         fireSpecViolationEvent(entity, method, new Section("12.2.9.b2"));
/*      */
/* 1024 */         status = false;
/*      */       }
/*      */
/* 1027 */       if (!throwsRemoteException(method))
/*      */       {
/* 1029 */         fireSpecViolationEvent(entity, method, new Section("12.2.9.b3"));
/*      */
/* 1031 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/* 1044 */     methods = Arrays.asList(this.home.getMethods()).iterator();
/* 1045 */     while (methods.hasNext())
/*      */     {
/* 1047 */       Method method = (Method)methods.next();
/*      */
/* 1050 */       if (method.getDeclaringClass().getName().equals("javax.ejb.EJBHome")) {
/*      */         continue;
/*      */       }
/* 1053 */       if (isCreateMethod(method))
/*      */       {
/* 1076 */         if (!hasMatchingEJBCreate(this.bean, method))
/*      */         {
/* 1078 */           fireSpecViolationEvent(entity, method, new Section("12.2.9.d"));
/* 1079 */           status = false;
/*      */         }
/*      */
/* 1082 */         if (!hasRemoteReturnType(entity, method))
/*      */         {
/* 1084 */           fireSpecViolationEvent(entity, method, new Section("12.2.9.e"));
/* 1085 */           status = false;
/*      */         }
/*      */
/* 1088 */         if ((hasMatchingEJBCreate(this.bean, method)) && (hasMatchingEJBPostCreate(this.bean, method)))
/*      */         {
/* 1091 */           Method ejbCreate = getMatchingEJBCreate(this.bean, method);
/* 1092 */           Method ejbPostCreate = getMatchingEJBPostCreate(this.bean, method);
/*      */
/* 1094 */           if ((!hasMatchingExceptions(ejbCreate, method)) || (!hasMatchingExceptions(ejbPostCreate, method)))
/*      */           {
/* 1097 */             fireSpecViolationEvent(entity, method, new Section("12.2.9.f"));
/*      */           }
/*      */
/*      */         }
/*      */
/* 1102 */         if (!throwsCreateException(method))
/*      */         {
/* 1104 */           fireSpecViolationEvent(entity, method, new Section("12.2.9.g"));
/* 1105 */           status = false;
/*      */         }
/*      */       }
/* 1108 */       else if (isFinderMethod(method))
/*      */       {
/* 1131 */         if (entity.isBMP())
/*      */         {
/* 1133 */           if (!hasMatchingEJBFind(this.bean, method))
/*      */           {
/* 1135 */             fireSpecViolationEvent(entity, method, new Section("12.2.9.h"));
/*      */
/* 1137 */             status = false;
/*      */           }
/*      */
/* 1140 */           if ((!hasRemoteReturnType(entity, method)) && (!isMultiObjectFinder(method)))
/*      */           {
/* 1143 */             fireSpecViolationEvent(entity, method, new Section("12.2.9.j"));
/*      */
/* 1145 */             status = false;
/*      */           }
/*      */
/* 1148 */           if (hasMatchingEJBFind(this.bean, method))
/*      */           {
/* 1150 */             Method ejbFind = getMatchingEJBFind(this.bean, method);
/* 1151 */             if (!hasMatchingExceptions(ejbFind, method))
/*      */             {
/* 1153 */               fireSpecViolationEvent(entity, method, new Section("12.2.9.k"));
/*      */
/* 1155 */               status = false;
/*      */             }
/*      */           }
/*      */
/* 1159 */           if (!throwsFinderException(method))
/*      */           {
/* 1161 */             fireSpecViolationEvent(entity, method, new Section("12.2.9.l"));
/*      */
/* 1163 */             status = false;
/*      */           }
/*      */         }
/*      */
/* 1167 */         if (entity.isCMP())
/*      */         {
/* 1170 */           if ((!hasRemoteReturnType(entity, method)) && (!isMultiObjectFinder(method)))
/*      */           {
/* 1173 */             fireSpecViolationEvent(entity, method, new Section("10.6.10.a"));
/*      */
/* 1175 */             status = false;
/*      */           }
/*      */
/* 1178 */           if (!throwsFinderException(method))
/*      */           {
/* 1180 */             fireSpecViolationEvent(entity, method, new Section("10.6.10.b"));
/*      */
/* 1182 */             status = false;
/*      */           }
/*      */
/* 1191 */           if ((!method.getName().equals("findByPrimaryKey")) && (!method.getName().equals("findAll")) && (!hasMatchingQuery(method, entity)))
/*      */           {
/* 1195 */             fireSpecViolationEvent(entity, method, new Section("10.5.6"));
/*      */
/* 1197 */             status = false;
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/* 1212 */       else if (!hasMatchingEJBHome(this.bean, method))
/*      */       {
/* 1214 */         fireSpecViolationEvent(entity, method, new Section("12.2.9.m"));
/*      */
/* 1216 */         status = false;
/*      */       }
/*      */
/*      */     }
View Full Code Here

/*      */   {
/* 1230 */     boolean status = true;
/*      */
/* 1237 */     if (!hasEJBLocalHomeInterface(this.localHome))
/*      */     {
/* 1239 */       fireSpecViolationEvent(entity, new Section("12.2.11.a"));
/* 1240 */       status = false;
/*      */     }
/*      */
/* 1248 */     Iterator homeMethods = Arrays.asList(this.localHome.getMethods()).iterator();
/* 1249 */     while (homeMethods.hasNext())
/*      */     {
/* 1251 */       Method method = (Method)homeMethods.next();
/*      */
/* 1253 */       if (throwsRemoteException(method))
/*      */       {
/* 1255 */         fireSpecViolationEvent(entity, method, new Section("12.2.11.b"));
/* 1256 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/* 1269 */     homeMethods = Arrays.asList(this.localHome.getMethods()).iterator();
/* 1270 */     while (homeMethods.hasNext())
/*      */     {
/* 1272 */       Method method = (Method)homeMethods.next();
/*      */
/* 1275 */       if (method.getDeclaringClass().getName().equals("javax.ejb.EJBLocalHome")) {
/*      */         continue;
/*      */       }
/* 1278 */       if (isCreateMethod(method))
/*      */       {
/* 1301 */         if (!hasMatchingEJBCreate(this.bean, method))
/*      */         {
/* 1303 */           fireSpecViolationEvent(entity, method, new Section("12.2.11.e"));
/*      */
/* 1305 */           status = false;
/*      */         }
/*      */
/* 1308 */         if (!hasLocalReturnType(entity, method))
/*      */         {
/* 1310 */           fireSpecViolationEvent(entity, method, new Section("12.2.11.f"));
/*      */
/* 1312 */           status = false;
/*      */         }
/*      */
/* 1315 */         if ((hasMatchingEJBCreate(this.bean, method)) && (hasMatchingEJBPostCreate(this.bean, method)))
/*      */         {
/* 1318 */           Method ejbCreate = getMatchingEJBCreate(this.bean, method);
/* 1319 */           Method ejbPostCreate = getMatchingEJBPostCreate(this.bean, method);
/*      */
/* 1321 */           if ((!hasMatchingExceptions(ejbCreate, method)) || (!hasMatchingExceptions(ejbPostCreate, method)))
/*      */           {
/* 1324 */             fireSpecViolationEvent(entity, method, new Section("12.2.11.g"));
/*      */           }
/*      */
/*      */         }
/*      */
/* 1329 */         if (!throwsCreateException(method))
/*      */         {
/* 1331 */           fireSpecViolationEvent(entity, method, new Section("12.2.11.h"));
/*      */
/* 1333 */           status = false;
/*      */         }
/*      */       }
/* 1336 */       else if (isFinderMethod(method))
/*      */       {
/* 1358 */         if ((!hasLocalReturnType(entity, method)) && (!isMultiObjectFinder(method)))
/*      */         {
/* 1361 */           fireSpecViolationEvent(entity, method, new Section("12.2.11.j"));
/*      */
/* 1363 */           status = false;
/*      */         }
/*      */
/* 1366 */         if (!throwsFinderException(method))
/*      */         {
/* 1368 */           fireSpecViolationEvent(entity, method, new Section("12.2.11.k"));
/*      */
/* 1370 */           status = false;
/*      */         }
/*      */
/* 1373 */         if (entity.isCMP())
/*      */         {
/* 1381 */           if (hasMatchingEJBFind(this.bean, method))
/*      */           {
/* 1383 */             fireSpecViolationEvent(entity, method, new Section("10.6.2.j"));
/*      */
/* 1385 */             status = false;
/*      */           }
/*      */
/* 1396 */           if ((!method.getName().equals("findByPrimaryKey")) && (!method.getName().equals("findAll")) && (!hasMatchingQuery(method, entity)))
/*      */           {
/* 1400 */             fireSpecViolationEvent(entity, method, new Section("10.5.6"));
/*      */
/* 1402 */             status = false;
/*      */           }
/*      */         }
/*      */
/* 1406 */         if (entity.isBMP())
/*      */         {
/* 1408 */           if (!hasMatchingEJBFind(this.bean, method))
/*      */           {
/* 1410 */             fireSpecViolationEvent(entity, method, new Section("12.2.11.i"));
/*      */
/* 1412 */             status = false;
/*      */           }
/*      */           else
/*      */           {
/* 1416 */             Method ejbFind = getMatchingEJBFind(this.bean, method);
/*      */
/* 1418 */             if (!hasMatchingExceptions(ejbFind, method))
/*      */             {
/* 1420 */               fireSpecViolationEvent(entity, method, new Section("12.2.11.l"));
/*      */             }
/*      */
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/* 1437 */       else if (!hasMatchingEJBHome(this.bean, method))
/*      */       {
/* 1439 */         fireSpecViolationEvent(entity, method, new Section("12.2.11.m"));
/*      */
/* 1441 */         status = false;
/*      */       }
/*      */
/*      */     }
View Full Code Here

/*      */   {
/* 1454 */     boolean status = true;
/*      */
/* 1461 */     if (!hasEJBLocalObjectInterface(this.local))
/*      */     {
/* 1463 */       fireSpecViolationEvent(entity, new Section("12.2.10.a"));
/* 1464 */       status = false;
/*      */     }
/*      */
/* 1472 */     Iterator localMethods = Arrays.asList(this.local.getMethods()).iterator();
/* 1473 */     while (localMethods.hasNext())
/*      */     {
/* 1475 */       Method method = (Method)localMethods.next();
/*      */
/* 1477 */       if (throwsRemoteException(method))
/*      */       {
/* 1479 */         fireSpecViolationEvent(entity, method, new Section("12.2.10.b"));
/* 1480 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/* 1498 */     localMethods = Arrays.asList(this.local.getMethods()).iterator();
/* 1499 */     while (localMethods.hasNext())
/*      */     {
/* 1501 */       Method method = (Method)localMethods.next();
/*      */
/* 1505 */       if (method.getDeclaringClass().getName().equals("javax.ejb.EJBLocalObject")) {
/*      */         continue;
/*      */       }
/* 1508 */       if (!hasMatchingMethod(this.bean, method))
/*      */       {
/* 1510 */         fireSpecViolationEvent(entity, method, new Section("12.2.10.c"));
/* 1511 */         status = false;
/*      */       }
/*      */
/* 1514 */       if (hasMatchingMethod(this.bean, method))
/*      */       {
/*      */         try
/*      */         {
/* 1518 */           Method beanMethod = this.bean.getMethod(method.getName(), method.getParameterTypes());
/*      */
/* 1521 */           if (!hasMatchingReturnType(beanMethod, method))
/*      */           {
/* 1523 */             fireSpecViolationEvent(entity, method, new Section("12.2.10.d"));
/*      */
/* 1525 */             status = false;
/*      */           }
/*      */
/* 1528 */           if (!hasMatchingExceptions(beanMethod, method))
/*      */           {
/* 1530 */             fireSpecViolationEvent(entity, method, new Section("12.2.10.e"));
/*      */
/* 1533 */             status = false;
/*      */           }
/*      */         }
/*      */         catch (NoSuchMethodException ignored)
View Full Code Here

/*      */   {
/* 1550 */     boolean status = true;
/*      */
/* 1557 */     if (!hasEJBObjectInterface(this.remote))
/*      */     {
/* 1559 */       fireSpecViolationEvent(entity, new Section("9.2.7.a"));
/* 1560 */       status = false;
/*      */     }
/*      */
/* 1574 */     Iterator it = Arrays.asList(this.remote.getMethods()).iterator();
/* 1575 */     while (it.hasNext())
/*      */     {
/* 1577 */       Method method = (Method)it.next();
/*      */
/* 1579 */       if (!hasLegalRMIIIOPArguments(method))
/*      */       {
/* 1581 */         fireSpecViolationEvent(entity, method, new Section("9.2.7.b"));
/* 1582 */         status = false;
/*      */       }
/*      */
/* 1585 */       if (!hasLegalRMIIIOPReturnType(method))
/*      */       {
/* 1587 */         fireSpecViolationEvent(entity, method, new Section("9.2.7.c"));
/* 1588 */         status = false;
/*      */       }
/*      */
/* 1591 */       if (!hasLegalRMIIIOPExceptionTypes(method))
/*      */       {
/* 1593 */         fireSpecViolationEvent(entity, method, new Section("9.2.7.h"));
/* 1594 */         status = false;
/*      */       }
/*      */
/* 1597 */       if (!throwsRemoteException(method))
/*      */       {
/* 1599 */         fireSpecViolationEvent(entity, method, new Section("9.2.7.d"));
/* 1600 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/* 1618 */     it = Arrays.asList(this.remote.getMethods()).iterator();
/* 1619 */     while (it.hasNext())
/*      */     {
/* 1621 */       Method method = (Method)it.next();
/*      */
/* 1624 */       if (method.getDeclaringClass().getName().equals("javax.ejb.EJBObject")) {
/*      */         continue;
/*      */       }
/* 1627 */       if (!hasMatchingMethod(this.bean, method))
/*      */       {
/* 1629 */         fireSpecViolationEvent(entity, method, new Section("9.2.7.e"));
/* 1630 */         status = false;
/*      */       }
/*      */
/* 1633 */       if (hasMatchingMethod(this.bean, method))
/*      */       {
/*      */         try
/*      */         {
/* 1637 */           Method beanMethod = this.bean.getMethod(method.getName(), method.getParameterTypes());
/*      */
/* 1640 */           if (!hasMatchingReturnType(beanMethod, method))
/*      */           {
/* 1642 */             fireSpecViolationEvent(entity, method, new Section("9.2.7.f"));
/*      */
/* 1644 */             status = false;
/*      */           }
/*      */
/* 1647 */           if (!hasMatchingExceptions(beanMethod, method))
/*      */           {
/* 1649 */             fireSpecViolationEvent(entity, method, new Section("9.2.7.g"));
/*      */
/* 1651 */             status = false;
/*      */           }
/*      */         }
/*      */         catch (NoSuchMethodException ignored)
View Full Code Here

/*      */   {
/* 1668 */     boolean status = true;
/*      */
/* 1675 */     if (!hasEntityBeanInterface(this.bean))
/*      */     {
/* 1677 */       fireSpecViolationEvent(entity, new Section("10.6.2.a"));
/* 1678 */       status = false;
/*      */     }
/*      */
/* 1685 */     if ((!isPublic(this.bean)) || (!isAbstract(this.bean)))
/*      */     {
/* 1687 */       fireSpecViolationEvent(entity, new Section("10.6.2.b"));
/* 1688 */       status = false;
/*      */     }
/*      */
/* 1696 */     if (!hasDefaultConstructor(this.bean))
/*      */     {
/* 1698 */       fireSpecViolationEvent(entity, new Section("10.6.2.c"));
/* 1699 */       status = false;
/*      */     }
/*      */
/* 1706 */     if (hasFinalizer(this.bean))
/*      */     {
/* 1708 */       fireSpecViolationEvent(entity, new Section("10.6.2.d"));
/* 1709 */       status = false;
/*      */     }
/*      */
/* 1725 */     if (hasEJBCreateMethod(this.bean, false))
/*      */     {
/* 1727 */       Iterator it = getEJBCreateMethods(this.bean);
/* 1728 */       while (it.hasNext())
/*      */       {
/* 1730 */         Method ejbCreate = (Method)it.next();
/* 1731 */         if (!isPublic(ejbCreate))
/*      */         {
/* 1733 */           fireSpecViolationEvent(entity, ejbCreate, new Section("10.6.4.b"));
/*      */
/* 1735 */           status = false;
/*      */         }
/*      */
/* 1738 */         if ((isFinal(ejbCreate)) || (isStatic(ejbCreate)))
/*      */         {
/* 1740 */           fireSpecViolationEvent(entity, ejbCreate, new Section("10.6.4.c"));
/*      */
/* 1742 */           status = false;
/*      */         }
/*      */
/* 1745 */         if (!hasPrimaryKeyReturnType(entity, ejbCreate))
/*      */         {
/* 1747 */           fireSpecViolationEvent(entity, ejbCreate, new Section("10.6.4.d"));
/*      */
/* 1749 */           status = false;
/*      */         }
/*      */
/* 1766 */         if (!throwsCreateException(ejbCreate))
/*      */         {
/* 1768 */           fireSpecViolationEvent(entity, ejbCreate, new Section("10.6.4.g"));
/*      */
/* 1770 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */
/* 1788 */     if (hasEJBCreateMethod(this.bean, false))
/*      */     {
/* 1790 */       Iterator it = getEJBCreateMethods(this.bean);
/*      */
/* 1792 */       while (it.hasNext())
/*      */       {
/* 1794 */         Method ejbCreate = (Method)it.next();
/*      */
/* 1796 */         if (!hasMatchingEJBPostCreate(this.bean, ejbCreate))
/*      */         {
/* 1798 */           fireSpecViolationEvent(entity, ejbCreate, new Section("10.6.5.a"));
/*      */
/* 1800 */           status = false;
/*      */         }
/*      */
/* 1803 */         if (hasMatchingEJBPostCreate(this.bean, ejbCreate))
/*      */         {
/* 1805 */           Method ejbPostCreate = getMatchingEJBPostCreate(this.bean, ejbCreate);
/*      */
/* 1808 */           if (!isPublic(ejbPostCreate))
/*      */           {
/* 1810 */             fireSpecViolationEvent(entity, ejbPostCreate, new Section("10.6.5.b"));
/*      */
/* 1812 */             status = false;
/*      */           }
/*      */
/* 1815 */           if (isStatic(ejbPostCreate))
/*      */           {
/* 1817 */             fireSpecViolationEvent(entity, ejbPostCreate, new Section("10.6.5.c"));
/*      */
/* 1819 */             status = false;
/*      */           }
/*      */
/* 1822 */           if (isFinal(ejbPostCreate))
/*      */           {
/* 1824 */             fireSpecViolationEvent(entity, ejbPostCreate, new Section("10.6.5.d"));
/*      */
/* 1826 */             status = false;
/*      */           }
/*      */
/* 1829 */           if (!hasVoidReturnType(ejbPostCreate))
/*      */           {
/* 1831 */             fireSpecViolationEvent(entity, ejbPostCreate, new Section("10.6.5.e"));
/*      */
/* 1833 */             status = false;
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */
/* 1848 */     Iterator it = getEjbHomeMethods(this.bean);
/* 1849 */     while (it.hasNext())
/*      */     {
/* 1851 */       Method ejbHome = (Method)it.next();
/* 1852 */       if (!isPublic(ejbHome))
/*      */       {
/* 1854 */         fireSpecViolationEvent(entity, ejbHome, new Section("10.6.6.a"));
/* 1855 */         status = false;
/*      */       }
/*      */
/* 1858 */       if (isStatic(ejbHome))
/*      */       {
/* 1860 */         fireSpecViolationEvent(entity, ejbHome, new Section("10.6.6.b"));
/* 1861 */         status = false;
/*      */       }
/*      */
/* 1864 */       if (throwsRemoteException(ejbHome))
/*      */       {
/* 1866 */         fireSpecViolationEvent(entity, ejbHome, new Section("10.6.6.c"));
/* 1867 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/* 1876 */     it = entity.getCMPFields();
/* 1877 */     while (it.hasNext())
/*      */     {
/* 1879 */       String fieldName = (String)it.next();
/* 1880 */       String getName = "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
/*      */
/* 1882 */       Class fieldType = null;
/*      */       try
/*      */       {
/* 1886 */         Method m = this.bean.getMethod(getName, new Class[0]);
/* 1887 */         fieldType = m.getReturnType();
/*      */
/* 1891 */         if (fieldType == Void.TYPE)
/*      */         {
/* 1893 */           fireSpecViolationEvent(entity, new Section("jb.7.1.b", "Field: " + fieldName));
/*      */         }
/*      */
/*      */       }
/*      */       catch (NoSuchMethodException nsme)
/*      */       {
/* 1899 */         fireSpecViolationEvent(entity, new Section("10.6.2.g", "Field: " + fieldName));
/*      */
/* 1901 */         status = false;
/*      */       }
/*      */
/* 1904 */       String setName = "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
/*      */
/* 1906 */       Class[] args = new Class[1];
/* 1907 */       args[0] = fieldType;
/*      */       try
/*      */       {
/* 1911 */         Method m = this.bean.getMethod(setName, args);
/* 1912 */         fieldType = m.getReturnType();
/*      */
/* 1916 */         if (fieldType != Void.TYPE)
/*      */         {
/* 1918 */           fireSpecViolationEvent(entity, new Section("jb.7.1.a", "Field: " + fieldName));
/*      */         }
/*      */
/*      */       }
/*      */       catch (NoSuchMethodException nsme)
/*      */       {
/*      */         try
/*      */         {
/* 1930 */           args[0] = this.classloader.loadClass("java.util.Collection");
/* 1931 */           m = this.bean.getMethod(setName, args);
/*      */         }
/*      */         catch (NoSuchMethodException nsme2)
/*      */         {
/*      */           Method m;
/* 1935 */           fireSpecViolationEvent(entity, new Section("10.6.2.h", "Field: " + fieldName));
/*      */
/* 1937 */           status = false;
/*      */         }
/*      */         catch (ClassNotFoundException cnfe)
/*      */         {
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */
/* 1955 */     it = getEjbSelectMethods(this.bean);
/* 1956 */     while (it.hasNext())
/*      */     {
/* 1958 */       Method ejbSelect = (Method)it.next();
/*      */
/* 1960 */       if (!isPublic(ejbSelect))
/*      */       {
/* 1962 */         fireSpecViolationEvent(entity, ejbSelect, new Section("10.6.7.a"));
/* 1963 */         status = false;
/*      */       }
/*      */
/* 1966 */       if (!isAbstract(ejbSelect))
/*      */       {
/* 1968 */         fireSpecViolationEvent(entity, ejbSelect, new Section("10.6.7.b"));
/* 1969 */         status = false;
/*      */       }
/*      */
/* 1972 */       if (!throwsFinderException(ejbSelect))
/*      */       {
/* 1974 */         fireSpecViolationEvent(entity, ejbSelect, new Section("10.6.7.c"));
/* 1975 */         status = false;
/*      */       }
/*      */
/* 1978 */       if (!hasMatchingQuery(ejbSelect, entity))
/*      */       {
/* 1980 */         fireSpecViolationEvent(entity, ejbSelect, new Section("10.5.7"));
/* 1981 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/* 1989 */     if (hasFinderMethod(this.bean))
/*      */     {
/* 1991 */       fireSpecViolationEvent(entity, new Section("10.6.2.i"));
/* 1992 */       status = false;
/*      */     }
/*      */
/* 1995 */     return status;
/*      */   }
View Full Code Here

TOP

Related Classes of org.jboss.verifier.Section

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.