Skip to content

Commit

Permalink
Remove Scala from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marianobarrios committed May 9, 2024
1 parent e519adf commit 82c5e7a
Show file tree
Hide file tree
Showing 49 changed files with 5 additions and 25 deletions.
14 changes: 0 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'java'
id 'scala'
id 'signing'
id 'maven-publish'
id "com.diffplug.spotless" version "6.25.0"
Expand Down Expand Up @@ -39,7 +38,6 @@ dependencies {
testImplementation 'org.slf4j:jul-to-slf4j:2.0.13'
testRuntimeOnly 'ch.qos.logback:logback-classic:1.3.4'

testImplementation 'org.scala-lang:scala3-library_3:3.4.1'
// pinned due to netty-tcnative-boringssl-static being pinned
testImplementation 'io.netty:netty-buffer:4.1.73.Final'
testImplementation 'io.netty:netty-handler:4.1.73.Final'
Expand All @@ -56,9 +54,6 @@ spotless {
// remove when spotless moved to this Palantir version
palantirJavaFormat("2.38.0")
}
scala {
scalafmt('3.7.1').configFile('.scalafmt.conf')
}
}

spotbugs {
Expand Down Expand Up @@ -87,15 +82,6 @@ spotbugsTest {
}
}

compileScala {
options.compilerArgs = [
"-language:implicitConversions",
"-Xlint",
"-deprecation",
"-Xfatal-warnings"
]
}

test {
useJUnitPlatform()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept
ClientTlsChannel.Builder builder = ClientTlsChannel.newBuilder(rawChannel, sslContext);

// instantiate TlsChannel
try (TlsChannel tlsChannel = builder.build()) {

TlsChannel tlsChannel = builder.build();
try {
mainloop:
while (true) {

Expand All @@ -68,15 +68,13 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept
}

} else if (key.isReadable() || key.isWritable()) {

try {
if (!requestSent) {
// do HTTP request
tlsChannel.write(requestBuffer);
if (requestBuffer.remaining() == 0) {
requestSent = true;
}

} else {
// handle HTTP response
int c = tlsChannel.read(responseBuffer);
Expand All @@ -101,6 +99,8 @@ public static void main(String[] args) throws IOException, GeneralSecurityExcept
}
}
}
} finally {
tlsChannel.close();
}
}
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.SplittableRandom;
import java.util.*;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.LongAdder;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import scala.util.Random;
import tlschannel.NeedsReadException;
import tlschannel.NeedsTaskException;
import tlschannel.NeedsWriteException;
Expand Down Expand Up @@ -186,7 +182,6 @@ public static Report loop(List<SocketPair> socketPairs, int dataSize, boolean re
try {
if (endpoint instanceof WriterEndpoint) {
WriterEndpoint writer = (WriterEndpoint) endpoint;
// rewriting do-while loop in a way compatible with Scala 23
do {
if (renegotiationCount < maxRenegotiations) {
if (random.nextBoolean()) {
Expand All @@ -212,7 +207,6 @@ public static Report loop(List<SocketPair> socketPairs, int dataSize, boolean re

} else if (endpoint instanceof ReaderEndpoint) {
ReaderEndpoint reader = (ReaderEndpoint) endpoint;
// rewriting do-while loop in a way compatible with Scala 23
do {
reader.buffer.clear();
int c = reader.socketGroup.external.read(reader.buffer);
Expand Down

0 comments on commit 82c5e7a

Please sign in to comment.