/*
 * ProActive Parallel Suite(TM):
 * The Open Source library for parallel and distributed
 * Workflows & Scheduling, Orchestration, Cloud Automation
 * and Big Data Analysis on Enterprise Grids & Clouds.
 *
 * Copyright (c) 2007 - 2017 ActiveEon
 * Contact: contact@activeeon.com
 *
 * This library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Affero General Public License
 * as published by the Free Software Foundation: version 3 of
 * the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * If needed, contact us to obtain a release under GPL Version 2 or 3
 * or a different license than the AGPL.
 */
package performancetests.recovery;

import org.apache.jmeter.protocol.java.sampler.JUnitSampler;
import org.apache.jmeter.threads.JMeterVariables;
import org.junit.Assert;
import org.junit.Test;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;


/**
 * @Author Gleb Mykhailenko
 */
public class NodeRecoveryTest {

    public NodeRecoveryTest(String s) {
        System.out.println("We have just receiverd " + s);
    }

    @Test
    public void testNodeRecovery() throws Exception {
        JUnitSampler sampler = new JUnitSampler();
        final JMeterVariables variables = sampler.getThreadContext().getVariables();
        JUnitSampler jUnitSampler = (JUnitSampler) sampler.getThreadContext().getCurrentSampler();
        Integer nodesNumber  = Integer.valueOf(variables.get("nodesNumber"));

    }
}

@@ -1216,80 +1216,8 @@
 t;%0A%0A
-import java.util.Iterator;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0A
 %0A/**
@@ -1225,31 +1225,29 @@
  * @
-A
+a
 uthor 
-Gleb Mykhailenko
+ActiveEon Team
 %0A */
@@ -1280,16 +1280,142 @@
 Test %7B%0A%0A
+    /**%0A     * JMeter would like to call constructor which takes single string.%0A     * @param s something from JMeter%0A     */%0A
     publ
@@ -1450,73 +1450,219 @@
 ) %7B%0A
+%0A
     
+%7D%0A%0A
     
-System.out.println(%22We have just receiverd %22 + s);%0A    %7D%0A
+/**%0A     * testNodeRecovery create number of nodes (which is taken from JMeter), then test kills and start scheduler,%0A     * and finnaly count number of nodes.%0A     *%0A     * @throws Exception%0A     */
 %0A   
@@ -1985,17 +1985,16 @@
 sNumber 
- 
 = Intege
@@ -2033,16 +2033,249 @@
 mber%22));
+%0A        if (nodesNumber == 10 %7C%7C nodesNumber == 300) %7B%0A            Thread.sleep(2000);%0A        %7D%0A        if (nodesNumber %3C= 100) %7B%0A            Assert.assertTrue(true);%0A        %7D else %7B%0A            Assert.assertTrue(false);%0A        %7D
 %0A%0A    %7D%0A

Apply spotlessApply