⬆️ ⬇️

Another way to use IBM Rational TestManager / Robot for your testing tasks

Foreword





Immediately tell you what opened the topic. I am a developer in my life, I don’t do testing as such. But here is a twist of fate and I had to work on a testing system.



I work in a telecommunications company, this is a mobile operator. We have our own development of various commercial offers there and there is testing of this very development. As you already understood, the development is specific and testing, respectively, is also peculiar.

')

We already had our own test automation methods. These are the generators of subscriber call accounts, these are emulators of switching glands, these are wild samples in the billing database. A lot of everything.



The management had an idea to somewhat standardize this process by introducing into our processes some means that has proven itself in the world. Well, a long story. We chose IBM Rational products.



I was attracted here for the purpose of trying to introduce this system to us and most importantly integrate it with billing.



Honestly, I am not familiar with the system and learned many things, so to speak, from scratch. It is interesting for me to outline my path in order to make life easier for others - this is one, two - that experienced comrades gave me feedback. And three is my little riot. I decided that we will not test using IR, but we will use this thing exclusively for organizing tests.





Test development





So, colleagues from IBM suggest that we go through five steps: planning, designing, implementing, executing, analyzing.



This definition of requirements for the object of testing, the declaration of the so-called TestInput s. To test the requirements, TestCase s are created, which in turn are stored in TestFolder s, located in TestPlan s.



When we have test cases and requirements, we can build associations between them. Thus, we determine the coverage requirements for the test object. The output will be a picture from which it will be clear that we wanted to test, that we tested, what went well, what didn’t, and that we didn’t even try to test.



The definition of this whole structure is planning and design. There is not much practical difference between these two stages. Planning is building this structure, and designing is adding a special meaning to this structure within the area of ​​knowledge in which the object of testing is located.



The test cases themselves have an implementation. Implementation can be manual ( Manual ) or automatic ( Automatic ). Manual is a list of actions that the tester will see. He is a man, he reads what needs to be done and / or check, sees the criterion of correctness. And it does all this as it can. Automatic is a script call. Here it is curious, but we will return to it a bit later.



This we have implemented tests. Now they need to run. To start the test, to determine the parameters of the test run, a suit is created (it is impossible to put smiles), I wanted to say Suit ( Suite ). Suit includes cases and conditions for their implementation. There you can still configure a lot of things. In general, they made a suite, launched it. The system will run the scripts and / or show the tester a picture with instructions for action.



When everything ends the system will show us a log with beautiful notes of warnings, failures and successes. The whole thing can be beautifully seen in numerous reports or artistically processed in its report. You can create your reports using Crystal Reports. This is actually an assessment of the results. In essence, the result can be used as a statement of requirements, that is, from here we can go back to the first step.



Picture from the documentation.



image



Here we have passed five steps. This is how tests look like in this system. So I saw them.



Automation





IR has a bunch of scripting tools. Here you can write scripts in GUIScript, VisualBasic, VUScript, Java, the command line and something else. Let the word scripts not scare you, in IR this is a very specific term, it has little to do with programming languages, it’s just an entity that designates a method for implementing a case.



The two built-in GUIScript and VUScript languages ​​are essentially the backbone of automation in IR. In fact, all the automation here is divided into two large groups: GUI and VU. Testing the GUI speaks for itself, it is an automatic tinting of buttons in graphic interfaces. Testing with VU involvement, dashing formulation reflects the abbreviation VU - Virtual User. VU technology allows you to simulate the work of several users, several, this is hundreds, thousands, etc. In fact, this is the implementation of load tests.



GUI testing requires a desktop, that is, no more than one test can be performed on one desktop on one machine at a time. For VU there is no such restriction, but there is a license restriction for the virtual user. They need to buy things.



The GUI language is essentially Visual Basic, for VU it is C, IR has its translator and C-syntax compiler. The rest of the scripting tools that I mentioned are the implementation of VU. Virtual users through a special TSS (Test Script Service) extension can run code written in another language.



As a Java programmer, I was interested in the Java implementation. Well, in general, overdue. The description of automation scripts seems to me to be somehow so “pinchable” or something. Something on my knees is signed there. Some great beautiful universal remedy is required. And I’m also concerned about the issue of licenses. For a number of circumstances (quite objective at that time), our company did not buy licenses for VU. But the bundle has a license for one VU, a sort of marketing.



Calcutta





My views were expressed in writing a framework for the development of automation. I gave him the name CALCUTTA .



What is this whole thing about? These are small scripts , Java code, which from the IR environment can use HTTP to talk to some application server. And all testing is spinning there. In IR, we plan, design, implement, execute and analyze. We perform only part of the problem statement in the application server and part of the result. Each test run in IR will take no longer than a minute. And the testing itself in any number of parallels, on any server to spin as we need it. A whole gang of testers can use only 5 virtual users. And even one, if the group is small. At one time, only one person may need to run a test or remove a result from it.



CALCUTTA gives us the proper level of abstraction when developing test automation tools. The programmer should think only about the object of testing. In itself, a tool is a tool, a tool that can perform a particular action.



Apache Tomcat is my application server.



You can think for a long time. I better show you the code right away. So the scripts and tools.



Here is the implementation of the test to verify whether the machine is pinged. In the tool you will see a meaningless (from the point of view of the pinging task) cycle, this is just to create an imaginary pause, such a long process.



Script



  1. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  2. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  3. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  4. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  5. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  6. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  7. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  8. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  9. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  10. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  11. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  12. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  13. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  14. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  15. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  16. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  17. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  18. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  19. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  20. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  21. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  22. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  23. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  24. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  25. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  26. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  27. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  28. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  29. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  30. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }
  31. package ru.megafonvolga.calcutta.tss.sandbox ; import ru.megafonvolga.calcutta.network.Message ; import ru.megafonvolga.calcutta.tss.env.CalcuttaScriptException ; import ru.megafonvolga.calcutta.tss.env.Script ; import ru.megafonvolga.calcutta.tss.utils.Calcutta ; public class HostReachableChecker extends Script { @Override public void execute ( String [ ] args ) throws CalcuttaScriptException { if ( Calcutta. createTool ( "ping" , "ru.megafonvolga.calcutta.tools.sandbox.t2.HostReachableChecker" ) || Calcutta. isSessionMarkedToRepeat ( ) ) { Calcutta. setToolProperty ( "ping" , "host" , getScriptOption ( "host" ) ) ; Calcutta. executeTool ( "ping" , false ) ; throw new CalcuttaScriptException ( "tool \" ping \" is executing..." , "run me again to know result" , CalcuttaScriptException. EL_WARNING ) ; } else { Message inMsg = Calcutta. getToolStatus ( "ping" ) ; int code = inMsg. getIntParameter ( "currentStateCode" ) ; String message = inMsg. getStringParameter ( "currentStateMessage" ) ; double percent = inMsg. getDoubleParameter ( "currentProgressPercent" ) ; if ( code > 0 ) throw new CalcuttaScriptException ( "tool is still executing..." , "code=" + code + ", message=" + message + ", done for " + percent + "%" , CalcuttaScriptException. EL_WARNING ) ; else if ( code < 0 ) throw new CalcuttaScriptException ( "test failed" , "code=" + code + ", message=" + message, CalcuttaScriptException. EL_ERROR ) ; } } }




Tool.

  1. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  2. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  3. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  4. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  5. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  6. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  7. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  8. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  9. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  10. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  11. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  12. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  13. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  14. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  15. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  16. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  17. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  18. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  19. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  20. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  21. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  22. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  23. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  24. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  25. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  26. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  27. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  28. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  29. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  30. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  31. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  32. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  33. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  34. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  35. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  36. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  37. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  38. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  39. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  40. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }
  41. package ru.megafonvolga.calcutta.tools.sandbox.t2 ; import java.net.InetAddress ; import ru.megafonvolga.calcutta.controller.CalcuttaSession ; import ru.megafonvolga.calcutta.controller.CalcuttaToolException ; import ru.megafonvolga.calcutta.tools.Tool ; public class HostReachableChecker extends Tool { private String host = "" ; public HostReachableChecker ( CalcuttaSession session, String toolInstaceName ) { super ( session, toolInstaceName ) ; } @Override public void execute ( ) throws CalcuttaToolException { setCurrentStateCode ( 1 ) ; setCurrentStateMessage ( "waiting..." ) ; setCurrentProgressPercent ( 0.0 ) ; try { if ( ! InetAddress . getByName ( getHost ( ) ) . isReachable ( 3000 ) ) { setCurrentStateCode ( - 1 ) ; setCurrentStateMessage ( "host is unreachable" ) ; } for ( int f = 0 ; f < 10 ; f ++ ) { Thread . sleep ( 1000 ) ; setCurrentStateCode ( f + 1 ) ; setCurrentStateMessage ( "waiting...[" + f + "]" ) ; setCurrentProgressPercent ( f * 10.0 ) ; } } catch ( Exception e ) { throw new CalcuttaToolException ( e ) ; } finally { setCurrentStateMessage ( "done" ) ; setCurrentStateCode ( 0 ) ; setCurrentProgressPercent ( 100.0 ) ; } } public String getHost ( ) { return host ; } public void setHost ( String host ) { this . host = host ; } }


This is how it looks in IR.



Suit



image



Log of the first run.



image



Web presentation of the process of execution of tools.



image



Log after the test execution when the tool has completed execution.



image



In general, here. I also want to write in the future how to glue Java with Rational, so it does not immediately glue. And this is not a lot of information I found on the network. And if the topic turns out to be interesting, I will also publish a more detailed article on CALCUTTA.



The information was mainly drawn from the IBM Rational TestManager documentation.

Source: https://habr.com/ru/post/100049/



All Articles