public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            CtcSettings.Initialize(executionData);

            TelnetSnmpActivityData activityData = executionData.GetMetadata <TelnetSnmpActivityData>(CtcMetadataConverter.Converters);

            if (null == _tests)
            {
                _tests = new TelnetTests(activityData);
            }
            PrinterFamilies family = (PrinterFamilies)Enum.Parse(typeof(PrinterFamilies), activityData.ProductCategory);

            // create instance of ews adapter
            EwsWrapper.Instance().Create(family, activityData.ProductName, activityData.PrinterIP, activityData.SitemapsVersion, BrowserModel.Firefox);

            EwsWrapper.Instance().Start();

            // Enable telnet as after cold reset telnet will be disabled by default in the new product versions.
            EwsWrapper.Instance().SetTelnet();

            foreach (int testNumber in activityData.TestNumbers)
            {
                try
                {
                    ExecutionServices.SessionRuntime.AsInternal().WaitIfPaused();
                    _tests.RunTest(executionData, testNumber, IPAddress.Parse(activityData.PrinterIP), (ProductFamilies)Enum.Parse(typeof(ProductFamilies), activityData.ProductCategory));
                }
                catch (Exception pauseException)
                {
                    TraceFactory.Logger.Fatal("Error while pausing: " + pauseException.Message);
                }
            }

            return(new PluginExecutionResult(PluginResult.Passed));
        }
        public TelnetSnmpConfigurationControl()
        {
            InitializeComponent();

            _activityData              = new TelnetSnmpActivityData();
            base.OnProductNameChanged += new ProductNameChangedEventHandler(TelnetConfigurationControl_OnProductNameChanged);
            //  Telnet_sitemapVersionSelector.PrinterFamily = base.ProductCategory.ToString();
            //  Telnet_sitemapVersionSelector.PrinterName = base.ProductName;

            fieldValidator.RequireCustom(textBoxIP, textBoxIP.IsValidIPAddress, "Enter valid IP address");
            fieldValidator.RequireCustom(Telnet_sitemapVersionSelector, Telnet_sitemapVersionSelector.ValidateControls);

            base.PropertyChanged += (s, e) => ConfigurationChanged(s, e);
            Telnet_sitemapVersionSelector.PropertyChanged += (s, e) => ConfigurationChanged(s, e);
        }
        public static string CreateConfigurationData(TelnetSnmpActivityData activityData)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("<Configurations>");
            builder.Append("<Configuration id=\"Mamba 1.1\">");
            builder.Append("<Browser>Firefox</Browser>");
            builder.Append("<Version>Version 1.1</Version>");
            builder.Append("<Product>" + activityData.ProductName + "</Product>");
            builder.Append("<DeviceAddress>" + activityData.PrinterIP + "</DeviceAddress>");
            builder.Append("<ProductType>" + activityData.ProductCategory + "</ProductType>");
            builder.Append("<HttpRemoteControlHost>localhost</HttpRemoteControlHost>");
            builder.Append("<HttpRemoteControlPort>4444</HttpRemoteControlPort>");
            builder.Append("</Configuration>");
            builder.Append("</Configurations>");

            return(builder.ToString());
        }
Exemple #4
0
 public TelnetTests(TelnetSnmpActivityData data) : base(data.ProductName)
 {
     _activityData = data;
     ProductFamily = data.ProductCategory;
     Sliver        = "Telnet";
 }
 public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
 {
     _activityData = configuration.GetMetadata <TelnetSnmpActivityData>(CtcMetadataConverter.Converters);
     CtcSettings.Initialize(environment);
     LoadUI();
 }
 public void Initialize(PluginEnvironment environment)
 {
     _activityData = new TelnetSnmpActivityData();
     CtcSettings.Initialize(environment);
     LoadUI();
 }