Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
leleuj committed Nov 27, 2023
1 parent 7854cfb commit 88e67f2
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `simpleperf`: a simple framework to measure performance (JDK 11)
# `simpleperf`: A simple framework for functional/performance tests (JDK 11)

### Launch a test:

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.casinthecloud</groupId>
<artifactId>simpleperf</artifactId>
<artifactId>simpletest</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.casinthecloud.simpleperf.cas;
package com.casinthecloud.simpletest.cas;

import com.casinthecloud.simpleperf.test.CasTest;
import com.casinthecloud.simpletest.test.CasTest;
import lombok.Getter;
import lombok.Setter;
import lombok.val;

import static com.casinthecloud.simpleperf.util.Utils.addUrlParameter;
import static com.casinthecloud.simpleperf.util.Utils.after;
import static com.casinthecloud.simpletest.util.Utils.addUrlParameter;
import static com.casinthecloud.simpletest.util.Utils.after;

/**
* A test performing a CAS login in the CAS server.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.casinthecloud.simpleperf.cas;
package com.casinthecloud.simpletest.cas;

import lombok.Getter;
import lombok.Setter;
import lombok.val;

import static com.casinthecloud.simpleperf.util.Utils.*;
import static com.casinthecloud.simpletest.util.Utils.*;

/**
* A test performing an OIDC login in the CAS server.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.casinthecloud.simpleperf.cas;
package com.casinthecloud.simpletest.cas;

import com.casinthecloud.simpleperf.test.CasTest;
import com.casinthecloud.simpletest.test.CasTest;
import lombok.Getter;
import lombok.Setter;
import lombok.val;

import static com.casinthecloud.simpleperf.util.Utils.between;
import static com.casinthecloud.simpleperf.util.Utils.htmlDecode;
import static com.casinthecloud.simpletest.util.Utils.between;
import static com.casinthecloud.simpletest.util.Utils.htmlDecode;

/**
* A test performing a SAML2 login in the CAS server (pac4j client).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.casinthecloud.simpleperf.execution;
package com.casinthecloud.simpletest.execution;

import com.casinthecloud.simpleperf.test.BaseTest;
import com.casinthecloud.simpletest.test.BaseTest;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
Expand All @@ -10,6 +10,9 @@
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Supplier;

import static com.casinthecloud.simpletest.util.Utils.print;
import static com.casinthecloud.simpletest.util.Utils.println;

/**
* The main class to use to launch the execution of a test.
*
Expand Down Expand Up @@ -43,8 +46,8 @@ public void launch() throws Exception {
} else {
textIteration = nbIterationsPerThread + " iterations per thread";
}
System.out.println("Execution started: " + textThread + ", " + textIteration);
System.out.print("<");
println("Execution started: " + textThread + ", " + textIteration);
print("<");

for (var i = 0; i < nbThreads; i++) {
val test = supplierTest.get();
Expand All @@ -54,14 +57,14 @@ public void launch() throws Exception {
}

while (completed.get() < nbThreads) {}
System.out.print(">");
print(">");

System.out.println();
println();
val finalTime = time.get();
if (finalTime >= 5000) {
System.out.println("Execution ended and took: " + finalTime/1000 + " s");
println("Execution ended and took: " + finalTime/1000 + " s");
} else {
System.out.println("Execution ended and took: " + finalTime + " ms");
println("Execution ended and took: " + finalTime + " ms");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.casinthecloud.simpleperf.execution;
package com.casinthecloud.simpletest.execution;

import com.casinthecloud.simpleperf.test.BaseTest;
import com.casinthecloud.simpletest.test.BaseTest;
import lombok.RequiredArgsConstructor;
import lombok.val;

import java.net.http.HttpClient;
import java.util.concurrent.atomic.AtomicInteger;

import static com.casinthecloud.simpletest.util.Utils.print;

/**
* A thread dedicated to the test execution (sequential).
*
Expand Down Expand Up @@ -45,16 +47,16 @@ public void run() {
try {
test.run();
if (smallInterval != -1 && i % smallInterval == 0) {
System.out.print((char) (97 + id));
print((char) (97 + id));
}
if (bigInterval != -1 && i % bigInterval == 0) {
System.out.print((char) (65 + id));
print((char) (65 + id));
}
} catch (final Exception e) {
if (displayErrors) {
e.printStackTrace();
} else {
System.out.print("!");
print("!");
}
if (maxErrors != -1) {
nbError++;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.casinthecloud.simpleperf.test;
package com.casinthecloud.simpletest.test;

import lombok.Getter;
import lombok.Setter;
Expand All @@ -16,7 +16,7 @@
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;

import static com.casinthecloud.simpleperf.util.Utils.*;
import static com.casinthecloud.simpletest.util.Utils.*;

/**
* The base test.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.casinthecloud.simpleperf.test;
package com.casinthecloud.simpletest.test;

import lombok.Getter;
import lombok.Setter;
import lombok.val;

import static com.casinthecloud.simpleperf.util.Utils.between;
import static com.casinthecloud.simpletest.util.Utils.between;

/**
* A test for CAS.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.casinthecloud.simpleperf.test;
package com.casinthecloud.simpletest.test;

import lombok.val;

import java.net.http.HttpClient;
import java.util.concurrent.atomic.AtomicLong;

import static com.casinthecloud.simpleperf.util.Utils.random;
import static com.casinthecloud.simpletest.util.Utils.random;

/**
* Randomly run test.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.casinthecloud.simpleperf.test;
package com.casinthecloud.simpletest.test;

/**
* A test for the web.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.casinthecloud.simpleperf.util;
package com.casinthecloud.simpletest.util;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -63,4 +63,19 @@ public static String addUrlParameter(final String url, final String name, final
}
return null;
}

public static void print(final char c) {
System.out.print(c);
}
public static void print(final String t) {
System.out.print(t);
}

public static void println(final String t) {
System.out.println(t);
}

public static void println() {
System.out.println();
}
}

0 comments on commit 88e67f2

Please sign in to comment.