public void Test_getAllListernsList()
 {
     ServiceConfigurationManager cm = new ServiceConfigurationManager();
     ServiceListenerMembers[] lstMem = ServiceConfigurationManager._CRMSiteDetails;
     Assert.IsInstanceOf(typeof(Array), lstMem,"Retuned object does not match with Expected Object");
     Assert.IsInstanceOf(typeof(ServiceListenerMembers), lstMem[0], "Retuned object does not match with Expected Object");
 }
Ejemplo n.º 2
0
 public void init()
 {
     log4net.Config.XmlConfigurator.Configure();
     ILog logger = LogManager.GetLogger(typeof(ICOMS_Test_Engine));
     logger.Info("--------------------------------------------------------------");
     logger.Info("Starting Unit Testing");
     logger.Info("--------------------------------------------------------------");
     logger.Info("Load CRM Connection Details");
     ServiceConfigurationManager srvCnfgMgr = new ServiceConfigurationManager();
     srvCnfgMgr.LoadServiceConfigFile();
     srvCnfgMgr.getAllListernsList();
     srvCnfgMgr.LoadCRMConnectionDetails();
     Console.WriteLine("Starting Unit Testing");
 }
Ejemplo n.º 3
0
        static void Main()
        {
            // Comment the below line while running application as console application

            // ServiceBase.Run(new ICOMSProvisioningService());

            // Place main code here to run application as console application

             //  ---  Main code ------

            log4net.Config.XmlConfigurator.Configure();
            logger.Info("ICOMSProvisioningService::Main() called");

            ServiceListenerMembers[] arrGetListnerList;
            LoadBalancerMembers getlbListner;
            ServiceConfigurationManager cnfMgr = new ServiceConfigurationManager();

            // Load service Config file
            if (!cnfMgr.LoadServiceConfigFile())
            {
            return;
            }

            // Load Site details from service config file
            if (!cnfMgr.getAllListernsList())
            {
            return;
            }
            arrGetListnerList = ServiceConfigurationManager._CRMSiteDetails;

            // Load CRM details from service config file
            if (!cnfMgr.LoadCRMConnectionDetails())
            {
            return;
            }

            // Load Load Balancer details from service config file
            if (cnfMgr.LoadBalancerConnectionDetails())
            {
            getlbListner = ServiceConfigurationManager._LBConnectionDetails;
            Thread LBlistener = new Thread(new ParameterizedThreadStart(ListenForLoadBalancer));
            LBlistener.IsBackground = true;
            LBlistener.Start(getlbListner);
            }

            // Set Primary CRM when service starting
            CRM4cInterfaceAvailabilityManager.ActiveCRMURL = "P";

            // Check If Backup CRM is exist or Not
            CRM4cInterfaceAvailabilityManager.IsBackupCRMExist = CRM4cInterfaceAvailabilityManager.checkBackupCRMExistence();

            foreach (ServiceListenerMembers obj in arrGetListnerList)
            {
            Thread listener = new Thread(new ParameterizedThreadStart(ListenForRequests));
            listener.IsBackground = true;
            listener.Start(obj);
            }

            Console.WriteLine("ICOMS Provisioning Service Running from DEV. Enviornment");
            Console.ReadLine();
            //  ---  Main code ------

            // Place main code here to run application as console application
        }