public Jsr262MBeanServerConnection(int enumerationMaxElements, string serverUri) { _enumerationMaxElements = enumerationMaxElements; _soapClient = new SOAPClient(serverUri); _manClient = new ManagementClient(serverUri); _enumClient = new EnumerationClient(true, serverUri); _eventingClient = new EventingClient(serverUri); }
public static void PerformTest() { var client = new EnumerationClient(Optimize, "http://localhost:12345/Enumeration"); client.BindFilterDialect(FilterMap.DefaultDialect, typeof(JmxNotificationFilter)); int countEstimate = client.EstimateCount("http://tempuri.org", new Filter(FilterMap.DefaultDialect, new JmxNotificationFilter())); Console.WriteLine("Client: Total items estimate: {0}", countEstimate); foreach (EndpointReference item in client.EnumerateEPR("http://tempuri.org", new Filter(FilterMap.DefaultDialect, new JmxNotificationFilter()), BatchSize)) { Console.WriteLine("Client: Got item {0}", item); } }
public void It_returns_proper_fault_if_filter_dialect_is_not_supported() { var enumerationServer = new EnumerationServer() .Bind("supportedDialect", typeof(object), new Mock <IEnumerationRequestHandler>().Object); var soapClient = new TestingSOAPClient(enumerationServer); var enumerationClient = new EnumerationClient(false, soapClient); try { enumerationClient .EnumerateEPR("http://tempuri.org", new Filter("unsupportedDialect", "A"), 10) .ToList(); } catch (FaultException ex) { Assert.AreEqual(new NotSupportedDialectFaultException(), ex); return; } Assert.Fail(); }
public void It_returns_proper_fault_if_filter_dialect_is_not_supported() { var enumerationServer = new EnumerationServer() .Bind("supportedDialect", typeof (object), new Mock<IEnumerationRequestHandler>().Object); var soapClient = new TestingSOAPClient(enumerationServer); var enumerationClient = new EnumerationClient(false, soapClient); try { enumerationClient .EnumerateEPR("http://tempuri.org", new Filter("unsupportedDialect", "A"), 10) .ToList(); } catch (FaultException ex) { Assert.AreEqual(new NotSupportedDialectFaultException(), ex); return; } Assert.Fail(); }