congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HttpXml.findUptime
Code IndexAdd Tabnine to your IDE (free)

How to use
findUptime
method
in
jrds.probe.HttpXml

Best Java code snippets using jrds.probe.HttpXml.findUptime (Showing top 2 results out of 315)

origin: fbacchella/jrds

@Override
protected Map<String, Number> parseStream(InputStream stream) {
  XmlProvider xmlstarter = find(XmlProvider.class);
  if(xmlstarter == null) {
    log(Level.ERROR, "XML Provider not found");
    return null;
  }
  Document d = xmlstarter.getDocument(stream);
  if (! validateXml(xmlstarter, d)) {
    return null;
  }
  setUptime(findUptime(xmlstarter, d));
  Map<String, Number> vars = new HashMap<>(collectKeys.size());
  for (Map.Entry<XPathExpression, Number> e: xmlstarter.fileFromXpaths(d, collectKeys.keySet()).entrySet()) {
    vars.put(collectKeys.get(e.getKey()), e.getValue());
  }
  log(Level.TRACE, "Values found: %s", vars);
  log(Level.TRACE, "%s", vars);
  vars = dom2Map(d, vars);
  log(Level.TRACE, "%s", vars);
  return vars;
}
origin: fbacchella/jrds

l = p.findUptime(p.find(XmlProvider.class), Tools.parseString(uptimeXml));
Assert.assertEquals(0, l, 0.0001);
p.find(XmlProvider.class).stop();
l = p.findUptime(p.find(XmlProvider.class), Tools.parseString(uptimeXml));
Assert.assertEquals((long) 1125, l);
p.find(XmlProvider.class).stop();
l = p.findUptime(p.find(XmlProvider.class), Tools.parseString(uptimeXml));
Assert.assertEquals((long) 0, l);
p.find(XmlProvider.class).stop();
p.find(XmlProvider.class).start();
uptimeXml = "<?xml version=\"1.0\" ?><element />";
l = p.findUptime(p.find(XmlProvider.class), Tools.parseString(uptimeXml));
Assert.assertEquals((long) 0, l);
p.find(XmlProvider.class).stop();
jrds.probeHttpXmlfindUptime

Javadoc

Extract the the uptime from the XML document, reusing the XML provider utilites

Popular methods of HttpXml

  • find
  • configure
  • dom2Map
    A method that can be overriden to extract more values from the XML document
  • getCollectMapping
  • getPd
  • log
  • setHost
  • setPd
  • setUptime
  • validateXml
    This method can be used to check that a already parsed XML is comforming some expected rules. The de

Popular in Java

  • Creating JSON documents from java classes using gson
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now