All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gsd.sreenidhi.utils.SystemEnvironment Maven / Gradle / Ivy

Go to download

A Java framework that provides complete end-to-end automation functionality using Cucumber JVM to interface with Selenium, Appium and Java Core Technologies

There is a newer version: 1.2.16
Show newest version
package com.gsd.sreenidhi.utils;

import java.net.InetAddress;
import java.util.Enumeration;
import java.util.Properties;

import com.gsd.sreenidhi.cheetah.engine.CheetahEngine;
import com.gsd.sreenidhi.cheetah.database.DBExecutor;
import com.gsd.sreenidhi.cheetah.exception.CheetahException;
import com.gsd.sreenidhi.forms.Constants;

/**
 * @author Sreenidhi, Gundlupet
 *
 */
public class SystemEnvironment {

	/**
	 * @param props
	 *            Properties
	 * @throws CheetahException
	 *             Generic Exception Object that handles all exceptions
	 */
	public static void processEnvironment(Properties props) throws CheetahException {
		CheetahEngine.logger.logMessage(null, SystemEnvironment.class.getName(), "Attempting DB Update: Test System Environment", Constants.LOG_INFO);
		InetAddress networkId = NetworkUtils.getLocalHostLANAddress();
		String properties = "";
		@SuppressWarnings("unchecked")
		Enumeration enums = (Enumeration) props.propertyNames();
		if(enums!=null) {
			while (enums.hasMoreElements()) {
				String key = enums.nextElement();
				String value = props.getProperty(key);
				properties = properties + key + " : " + value + "\n";
			}
		}else {
			properties="";
		}
		
		DBExecutor.recordEnvironment(properties, networkId);
		CheetahEngine.logger.logMessage(null, SystemEnvironment.class.getName(), "Process Environment Complete!", Constants.LOG_INFO);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy