Last active
July 25, 2019 15:40
-
-
Save willer007/b02f4487a8db8f087f9ac978dc8a6be7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package testactivities.performance; | |
import com.google.gson.annotations.SerializedName; | |
import com.google.gson.reflect.TypeToken; | |
import org.junit.jupiter.api.Test; | |
import structure.TestConfigurator; | |
import webservice.WebService; | |
import webservice.endpoints.queue.entities.jobunit.JobUnit; | |
import webservice.structure.runner.RunnerThread; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class StabilityTest extends TestConfigurator { | |
@Test | |
public void testWebService() { | |
WebService webService = new WebService(); | |
webService.configureRobot(1, new FluxoFiat()); | |
} | |
public class FluxoFiat extends RunnerThread { | |
@Override | |
public void run() { | |
configure(new TypeToken<JobUnit<Payload>>(){}.getType()); | |
for (int lin = 0; lin < 100; lin++) { | |
try { | |
JobUnit<Payload> jobUnit = (JobUnit<Payload>) QUEUE.pop("0"); | |
jobUnit.payload.STATUS_DE_EXECUCAO = "OK"; | |
jobUnit.payload.SUCESSO = "OK"; | |
if (jobUnit.getType().equals("error")) { | |
System.out.println("ERRO NA INSTANCIA" + ""); | |
System.out.println(jobUnit); | |
System.out.println("teste"); | |
} else { | |
System.out.println(QUEUE.feedback(jobUnit, "1","TESTE",1)); | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
System.out.println("pop error"); | |
} | |
} | |
} | |
} | |
public class Payload{ | |
public String COLUNA_1; | |
public String COLUNA_2; | |
public String COLUNA_3; | |
public String COLUNA_4; | |
public String COLUNA_5; | |
@SerializedName("STATUS_DE_EXECUÇÃO") | |
public String STATUS_DE_EXECUCAO; | |
public String SUCESSO; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment