#!/usr/bin/env python

import os, sys

# ACS Imports
from Acspy.Clients.SimpleClient import PySimpleClient 

#Inizialization of variables
comp = None

# define the component name
compName="TESTCOMP1_1"

if __name__ == "__main__" :

# Get the client
	simpleClient = PySimpleClient()

# Get the static component reference
	try:
		comp = simpleClient.getComponent (comp_name=compName)
		print ("Retrieved "+ compName +" reference")
	except Exception(e):
		print("Exception encountered getting "+ compName +" reference")
		print("The exception was: ", e)

# Test a method of the component
	try:
		metName="doSomething()"
		comp.doSomething()
		print ("Successfully ran "+metName+" method")
	except Exception(e):
		print ("Exception encountered in "+metName+"method")
		print ("The exception was: ", e)

# Release the component
	try:
		simpleClient.releaseComponent(compName)
		print ("Released the " + compName + " Component")
	except Exception(e):
		print("Exception encountered releasing" + compName)
		print("The exception was: ", e)

	simpleClient.disconnect()
	print ("Finishing the test")
