psdi.app.repairfacility.unittest

Class RepFacilityTestUtil

  • java.lang.Object
    • psdi.app.repairfacility.unittest.RepFacilityTestUtil


  • public class RepFacilityTestUtil
    extends java.lang.Object
    Utility class for Repair Facilities related test classes
    • Constructor Detail

      • RepFacilityTestUtil

        public RepFacilityTestUtil()
    • Method Detail

      • createRandomWO

        public static WORemote createRandomWO(UserInfo userInfo)
                                       throws java.rmi.RemoteException,
                                              MXException
        Creates a new workorder record, choosing randomly the value for WORKORDER.WONUM
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • createRandomWO

        public static WORemote createRandomWO(MboSetRemote woSet,
                                              java.lang.String insertSite)
                                       throws java.rmi.RemoteException,
                                              MXException
        Creates a new workorder record, choosing randomly the value for WORKORDER.WONUM
        Parameters:
        insertSite -
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • createRandomAsset

        public static AssetRemote createRandomAsset(UserInfo userInfo)
                                             throws java.rmi.RemoteException,
                                                    MXException
        Creates a new asset record, choosing randomly the value for ASSET.ASSETNUM
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • createRandomAsset

        public static AssetRemote createRandomAsset(UserInfo userInfo,
                                                    MboSetRemote assetSet)
                                             throws java.rmi.RemoteException,
                                                    MXException
        Creates a new asset record, choosing randomly the value for ASSET.ASSETNUM
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • updateFacilitiesMaxvarForAllOrgs

        public static void updateFacilitiesMaxvarForAllOrgs(UserInfo userInfo,
                                                            boolean enable)
                                                     throws MXException,
                                                            java.rmi.RemoteException
        Updates the Repair Facility maxvar for all organizations
        Parameters:
        userInfo -
        enable -
        Throws:
        MXException
        java.rmi.RemoteException
      • updateFacilitiesMaxvar

        public static void updateFacilitiesMaxvar(UserInfo userInfo,
                                                  java.lang.String orgid,
                                                  boolean enable)
                                           throws MXException,
                                                  java.rmi.RemoteException
        Updates the Repair Facility maxvar for one specific organization
        Parameters:
        userInfo -
        enable -
        Throws:
        MXException
        java.rmi.RemoteException
      • updateByPassMaxvarForAllOrgs

        public static void updateByPassMaxvarForAllOrgs(UserInfo userInfo,
                                                        boolean enable)
                                                 throws MXException,
                                                        java.rmi.RemoteException
        Updates the By Pass Repair Facility Warning Message maxvar for all organizations
        Parameters:
        userInfo -
        enable -
        Throws:
        MXException
        java.rmi.RemoteException
      • updateByPassMaxvar

        public static void updateByPassMaxvar(UserInfo userInfo,
                                              java.lang.String orgid,
                                              boolean enable)
                                       throws MXException,
                                              java.rmi.RemoteException
        Updates the By Pass Repair Facility Warning Message maxvar for one specific organization
        Parameters:
        userInfo -
        enable -
        Throws:
        MXException
        java.rmi.RemoteException
      • allowNullRepairFacilityInUserGroups

        public static void allowNullRepairFacilityInUserGroups(boolean allowNull,
                                                               java.lang.String userName,
                                                               UserInfo userInfo)
                                                        throws MXException,
                                                               java.rmi.RemoteException
        Goes thru each group the user belongs to and update the NULLREPFAC according to the received parameter
        Parameters:
        allowNull - Specifies the value to be set to NULLREPFAC flag
        userName - Specifies the user who will have the groups updated
        userInfo - The UserInfo object to be passed to the MXServer to perform all mbo-related operations
        Throws:
        MXException
        java.rmi.RemoteException
      • allowNullRepairFacilityInUserGroups

        public static void allowNullRepairFacilityInUserGroups(boolean allowNull,
                                                               java.lang.String userName,
                                                               UserInfo userInfo,
                                                               boolean excludeEveryoneGroup,
                                                               boolean excludeNewUsersGroup)
                                                        throws MXException,
                                                               java.rmi.RemoteException
        Goes thru each group the user belongs to and update the NULLREPFAC according to the received parameter
        Parameters:
        allowNull - Specifies the value to be set to NULLREPFAC flag
        userName - Specifies the user who will have the groups updated
        userInfo - The UserInfo object to be passed to the MXServer to perform all mbo-related operations
        excludeEveryoneGroup - Determines if EVERYONE group has to be ignored
        excludeNewUsersGroup - Determines if DEFLTREG group has to be ignored
        Throws:
        MXException
        java.rmi.RemoteException
      • authorizeIndividualRepairFacility

        public static void authorizeIndividualRepairFacility(MboRemote repairFacility,
                                                             java.lang.String groupName)
                                                      throws MXException,
                                                             java.rmi.RemoteException
        Adds a REPFACAUTH record (if need be) to the group, to authorize the repair facility
        Parameters:
        repairFacility -
        groupName -
        Throws:
        MXException
        java.rmi.RemoteException
      • authorizeIndividualRepairFacilityToUserGroups

        public static void authorizeIndividualRepairFacilityToUserGroups(MboRemote repairFacility,
                                                                         java.lang.String userName,
                                                                         UserInfo userInfo)
                                                                  throws MXException,
                                                                         java.rmi.RemoteException
        Adds a REPFACAUTH record (if need be) to each group the user belongs to, in order to authorize the repair facility
        Parameters:
        repairFacility -
        userName -
        userInfo -
        Throws:
        MXException
        java.rmi.RemoteException
      • authorizeIndividualRepairFacilityToUserGroups

        public static void authorizeIndividualRepairFacilityToUserGroups(MboRemote repairFacility,
                                                                         java.lang.String userName,
                                                                         UserInfo userInfo,
                                                                         boolean excludeEveryoneGroup,
                                                                         boolean excludeNewUsersGroup)
                                                                  throws MXException,
                                                                         java.rmi.RemoteException
        Adds a REPFACAUTH record (if need be) to each group the user belongs to, in order to authorize the repair facility
        Parameters:
        repairFacility -
        userInfo - The UserInfo object to be passed to the MXServer to perform all mbo-related operations
        userInfo -
        excludeEveryoneGroup - Determines if EVERYONE group has to be ignored
        excludeNewUsersGroup - Determines if DEFLTREG group has to be ignored
        Throws:
        MXException
        java.rmi.RemoteException
      • authorizeAllRepairFacilitiesToUserGroups

        public static void authorizeAllRepairFacilitiesToUserGroups(java.lang.String userName,
                                                                    UserInfo userInfo)
                                                             throws java.rmi.RemoteException,
                                                                    MXException
        Goes thru each group the user belongs to and set the AUTHALLREPFACS flag to true
        Parameters:
        userName - Specifies the user who will have the groups updated
        userInfo - The UserInfo object to be passed to the MXServer to perform all mbo-related operations
        Throws:
        java.rmi.RemoteException
        MXException
      • authorizeAllRepairFacilitiesToUserGroups

        public static void authorizeAllRepairFacilitiesToUserGroups(java.lang.String userName,
                                                                    UserInfo userInfo,
                                                                    boolean excludeEveryoneGroup,
                                                                    boolean excludeNewUsersGroup)
                                                             throws java.rmi.RemoteException,
                                                                    MXException
        Goes thru each group the user belongs to and set the AUTHALLREPFACS flag to true
        Parameters:
        userName - Specifies the user who will have the groups updated
        userInfo - The UserInfo object to be passed to the MXServer to perform all mbo-related operations
        excludeEveryoneGroup - Determines if EVERYONE group has to be ignored
        excludeNewUsersGroup - Determines if DEFLTREG group has to be ignored
        Throws:
        java.rmi.RemoteException
        MXException
      • clearRepairFacilityAuthorization

        public static void clearRepairFacilityAuthorization(MboRemote maxUser,
                                                            UserInfo userInfo)
                                                     throws java.rmi.RemoteException,
                                                            MXException
        Goes thru each group the user belongs to and set the AUTHALLREPFACS flag to false
        Parameters:
        userName - Specifies the user who will have the groups updated
        userInfo - The UserInfo object to be passed to the MXServer to perform all mbo-related operations
        Throws:
        java.rmi.RemoteException
        MXException
      • clearIndividualRepairFacilityAuthorization

        public static void clearIndividualRepairFacilityAuthorization(java.lang.String userName,
                                                                      UserInfo userInfo)
                                                               throws java.rmi.RemoteException,
                                                                      MXException
        Goes thru each group the user belongs to and set the AUTHALLREPFACS flag to false
        Parameters:
        userName - Specifies the user who will have the groups updated
        userInfo - The UserInfo object to be passed to the MXServer to perform all mbo-related operations
        Throws:
        java.rmi.RemoteException
        MXException
      • createNewUser

        public static MaxUserRemote createNewUser(MaxGroupRemote group,
                                                  UserInfo userInfo)
                                           throws java.rmi.RemoteException,
                                                  MXException
        Parameters:
        group -
        userInfo - The UserInfo object to be passed to the MXServer to perform all mbo-related operations
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • addUserToGroups

        public static void addUserToGroups(MboRemote user,
                                           MboSetRemote groupSet)
                                    throws java.rmi.RemoteException,
                                           MXException
        Parameters:
        user -
        groupSet -
        Throws:
        java.rmi.RemoteException
        MXException
      • addUserToGroup

        public static void addUserToGroup(MboRemote user,
                                          MboRemote group)
                                   throws MXException,
                                          java.rmi.RemoteException
        Parameters:
        user -
        group -
        Throws:
        MXException
        java.rmi.RemoteException