Java Code Examples for java.lang.Integer#toString()

The following examples show how to use java.lang.Integer#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DoctorKafkaBrokerStatsServlet.java    From doctorkafka with Apache License 2.0 6 votes vote down vote up
public KafkaBroker getBroker(String clusterName, int brokerId) throws ClusterInfoError {
  KafkaClusterManager clusterMananger =
      DoctorKafkaMain.doctorKafka.getClusterManager(clusterName);
  if (clusterMananger == null) {
    throw new ClusterInfoError("Failed to find cluster manager for {}", clusterName);
  }
  KafkaBroker broker = clusterMananger.getCluster().getBroker(brokerId);
  if (broker == null) {
    throw new ClusterInfoError(
        "Failed to find broker {} in cluster {}",
        Integer.toString(brokerId),
        clusterName
    );
  }

  return broker;
}
 
Example 2
Source File: DoctorKafkaBrokerStatsServlet.java    From doctorkafka with Apache License 2.0 5 votes vote down vote up
public BrokerStats getLatestStats(String clusterName, KafkaBroker broker)
  throws ClusterInfoError {
  BrokerStats latestStats = broker.getLatestStats();
  if (latestStats == null) {
    throw new ClusterInfoError("Failed to get latest stats from broker {} in cluster {}",
        Integer.toString(broker.getId()),
        clusterName
    );
  }
  return latestStats;
}
 
Example 3
Source File: GenCaseResult.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
private void parseSmokeTestResult(){
	SAXReader saxReader = new SAXReader();
	Document document = null;
	String SumName;
	String keyName;
	try{
		document = saxReader.read(ResultFile);
	}catch(org.dom4j.DocumentException dex){
		dex.printStackTrace();
	}
	//Get total case number, fail number and success number
	Element rootElement = document.getRootElement();
	Iterator it = rootElement.elementIterator();
	while(it.hasNext()){
		Element element = (Element)it.next();
		SumName = element.getName();
		if ( SumName.equalsIgnoreCase("sum")){
			Iterator ittmp = element.elementIterator();
			while(ittmp.hasNext()){
				Element keyelement = (Element)ittmp.next();
				keyName = keyelement.getName();
				if (keyName.equalsIgnoreCase("same")){
					this.SameRpt = keyelement.getText();
				}else if (keyName.equalsIgnoreCase("differ")){
					this.DiffRpt = keyelement.getText();
				}else
					continue;
			}
		}
	}
	int totalRpt;

	totalRpt = Integer.valueOf(this.SameRpt.trim()).intValue();
	totalRpt += Integer.valueOf(this.DiffRpt.trim()).intValue();
	this.TotalRpt = Integer.toString(totalRpt);
	
	System.out.println("Engine Smoke Total:" + this.TotalRpt);
	System.out.println("Engine Smoke Same" + this.SameRpt);
	System.out.println("Engine Smoke Diff" + this.DiffRpt);

}