Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 38 additions & 35 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,48 @@ java {
}

ext.versions = [
assertj : '2.0.0',
guava : '21.0',
guice : '4.0',
log4j : '1.2.17',
testng : '7.5',
junit : '4.12',
spock : '2.3-groovy-4.0',
slf4j : '1.7.12',
hsqldb : '2.3.2',
dbutils : '1.6',
snakeyaml : '1.15',
cglib : '3.1',
httpclient : '4.4',
ioutils : '2.4',
tpchgen : '0.6',
tpcdsgen : '1.2',
commons_lang3: '3.3.2',
commons_dbcp2: '2.1',
hive_jdbc : '0.13.1-5',
hive : '3.0.0-2',
presto : '0.181',
reflections : '0.9.9',
bytebuddy : '1.15.4',
jsch : '0.1.55',
mina_sshd : '0.14.0',
freemarker : '2.3.22',
objenesis : '1.4',
jackson : '2.4.4',
cassandra : '3.4.0',
commons_cli : '1.3.1',
thrift : '0.9.3',
kafka : '3.9.0',
jakarta_inject : '2.0.1',
jakarta_annotation: '2.1.1',
Comment on lines +31 to +32
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two were added

assertj : '2.0.0',
guava : '21.0',
guice : '7.0.0',
Copy link
Contributor Author

@ZacBlanco ZacBlanco Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guice updated

log4j : '1.2.17',
testng : '7.5',
junit : '4.12',
spock : '2.3-groovy-4.0',
slf4j : '1.7.12',
hsqldb : '2.3.2',
dbutils : '1.6',
snakeyaml : '1.15',
cglib : '3.1',
httpclient : '4.4',
ioutils : '2.4',
tpchgen : '0.6',
tpcdsgen : '1.2',
commons_lang3 : '3.3.2',
commons_dbcp2 : '2.1',
hive_jdbc : '0.13.1-5',
hive : '3.0.0-2',
presto : '0.181',
reflections : '0.9.9',
bytebuddy : '1.15.4',
jsch : '0.2.25',
mina_sshd : '2.15.0',
Comment on lines +56 to +57
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both updated

freemarker : '2.3.22',
objenesis : '1.4',
jackson : '2.4.4',
cassandra : '3.4.0',
commons_cli : '1.3.1',
thrift : '0.9.3',
kafka : '3.9.0',
]

ext.libraries = [
jakarta_inject : "jakarta.inject:jakarta.inject-api:${versions.jakarta_inject}",
jakarta_annotation : "jakarta.annotation:jakarta.annotation-api:${versions.jakarta_annotation}",
assertj : "org.assertj:assertj-core:${versions.assertj}",
guava : "com.google.guava:guava:${versions.guava}",
guice : ["com.google.inject:guice:${versions.guice}",
"com.google.inject.extensions:guice-multibindings:${versions.guice}"],
guice : ["com.google.inject:guice:${versions.guice}"],
log4j : "log4j:log4j:${versions.log4j}",
testng : "org.testng:testng:${versions.testng}",
junit : "junit:junit:${versions.junit}", /* TODO: remove junit dependencies */
Expand All @@ -90,7 +93,7 @@ ext.libraries = [
presto_jdbc : "com.facebook.presto:presto-jdbc:${versions.presto}",
reflections : "org.reflections:reflections:${versions.reflections}",
bytebuddy : "net.bytebuddy:byte-buddy:${versions.bytebuddy}",
jsch : "com.jcraft:jsch:${versions.jsch}",
jsch : "com.github.mwiede:jsch:${versions.jsch}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old jsch was left unmaintained. This fork is maintained and has recent updates

mina_sshd : "org.apache.sshd:apache-sshd:${versions.mina_sshd}",
postgresql_jdbc : "org.postgresql:postgresql:9.4-1201-jdbc41",
commons_cli : "commons-cli:commons-cli:1.2",
Expand Down
2 changes: 0 additions & 2 deletions tempto-core/src/main/java/io/prestodb/tempto/ProductTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import io.prestodb.tempto.internal.initialization.RequirementsExpanderInterceptor;
import io.prestodb.tempto.internal.initialization.TestInitializationListener;
import io.prestodb.tempto.internal.listeners.ProgressLoggingListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Listeners;

@Listeners({RequirementsExpanderInterceptor.class, TestInitializationListener.class, ProgressLoggingListener.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@

import com.google.inject.Inject;
import io.prestodb.tempto.internal.fulfillment.table.TableName;

import javax.inject.Named;
import javax.inject.Singleton;
import jakarta.inject.Named;
import jakarta.inject.Singleton;

/**
* Table manager for read only databases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static io.prestodb.tempto.Requirements.compose;
import static java.util.stream.Collectors.toList;

/**
* This class gathers requirements for a given test method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Object[] getMethodArguments(Injector injector, Method method)
private boolean isAnnotatedWithInject(Method method)
{
return method.getAnnotation(Inject.class) != null ||
method.getAnnotation(javax.inject.Inject.class) != null;
method.getAnnotation(jakarta.inject.Inject.class) != null;
}

private Object createInstanceWithFields(Parameter[] parameters)
Expand Down Expand Up @@ -95,7 +95,7 @@ private static class InjectAnnotation
@Override
public Class<? extends Annotation> annotationType()
{
return javax.inject.Inject.class;
return jakarta.inject.Inject.class;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
package io.prestodb.tempto.internal.fulfillment.command;

import io.prestodb.tempto.fulfillment.command.TestCommandRequirement;

import javax.inject.Inject;
import jakarta.inject.Inject;

public class TestCommandFulfiller
extends CommandFulfiller<TestCommandRequirement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
import io.prestodb.tempto.internal.fulfillment.table.TableNameGenerator;
import io.prestodb.tempto.internal.query.CassandraQueryExecutor;
import io.prestodb.tempto.util.Lazy;
import jakarta.inject.Named;
import jakarta.inject.Singleton;
import org.slf4j.Logger;

import javax.inject.Named;
import javax.inject.Singleton;

import java.util.List;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
import io.prestodb.tempto.internal.fulfillment.table.TableNameGenerator;
import io.prestodb.tempto.internal.hadoop.hdfs.HdfsDataSourceWriter;
import io.prestodb.tempto.query.QueryExecutor;
import jakarta.inject.Named;
import jakarta.inject.Singleton;
import org.slf4j.Logger;

import javax.inject.Named;
import javax.inject.Singleton;

import java.util.Optional;

import static com.google.common.base.Preconditions.checkArgument;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
import io.prestodb.tempto.query.QueryExecutionException;
import io.prestodb.tempto.query.QueryExecutor;
import io.prestodb.tempto.query.QueryResult;
import jakarta.inject.Named;
import org.slf4j.Logger;

import javax.inject.Named;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
import io.prestodb.tempto.fulfillment.table.hive.HiveDataSource;
import io.prestodb.tempto.hadoop.hdfs.HdfsClient;
import io.prestodb.tempto.hadoop.hdfs.HdfsClient.RepeatableContentProducer;
import jakarta.inject.Inject;
import org.slf4j.Logger;

import javax.inject.Inject;

import static org.slf4j.LoggerFactory.getLogger;

public class DefaultHdfsDataSourceWriter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
import io.prestodb.tempto.query.JdbcQueryExecutor;
import io.prestodb.tempto.query.QueryExecutor;
import io.prestodb.tempto.query.QueryExecutorDispatcher;

import javax.inject.Inject;
import jakarta.inject.Inject;

import java.util.Map;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@

import com.google.common.base.Throwables;
import io.prestodb.tempto.context.TestContext;
import jakarta.inject.Inject;
import org.slf4j.Logger;

import javax.inject.Inject;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
Expand Down
4 changes: 1 addition & 3 deletions tempto-core/src/main/java/io/prestodb/tempto/util/Lazy.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@

package io.prestodb.tempto.util;

import javax.annotation.concurrent.ThreadSafe;
import javax.inject.Provider;
import jakarta.inject.Provider;

import java.util.Optional;

import static java.util.Objects.requireNonNull;

@ThreadSafe
public class Lazy<T>
implements Provider<T>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import io.prestodb.tempto.assertions.QueryAssert
import io.prestodb.tempto.internal.convention.AnnotatedFileParser
import io.prestodb.tempto.internal.convention.AnnotatedFileParser.SectionParsingResult
import io.prestodb.tempto.internal.convention.SqlResultDescriptor
import org.joda.time.DateTimeZone
import spock.lang.Specification

import java.sql.Date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import com.google.inject.Key
import com.google.inject.TypeLiteral
import io.prestodb.tempto.Requirement
import io.prestodb.tempto.fulfillment.RequirementFulfiller
import jakarta.inject.Inject
import jakarta.inject.Named
import org.junit.Before
import org.junit.Ignore
import org.junit.Test

import javax.inject.Inject
import javax.inject.Named
import java.lang.reflect.Method

import static com.google.inject.Guice.createInjector
Expand Down Expand Up @@ -87,8 +87,8 @@ class ReflectionInjectorHelperTest
assert key == 'value';
}

@javax.inject.Inject
void useKey2(@javax.inject.Named('key2') String key)
@jakarta.inject.Inject
void useKey2(@jakarta.inject.Named('key2') String key)
{
assert key == 'value2';
}
Expand All @@ -100,7 +100,7 @@ class ReflectionInjectorHelperTest
injectAndCallMethod('useStringList', List)
}

@javax.inject.Inject
@jakarta.inject.Inject
void useStringList(List<String> stringList)
{
assert stringList.size() == 3 && stringList.containsAll(['ala', 'ma', 'kota'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ package io.prestodb.tempto.internal.ssh

import com.google.common.io.Files
import io.prestodb.tempto.process.CliProcess
import org.apache.sshd.SshServer
import org.apache.sshd.server.Command
import org.apache.sshd.server.CommandFactory
import org.apache.sshd.server.PasswordAuthenticator
import org.apache.sshd.server.PublickeyAuthenticator
import org.apache.sshd.server.auth.UserAuthPassword
import org.apache.sshd.server.auth.UserAuthPublicKey
import org.apache.sshd.server.command.ScpCommandFactory
import org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory
import org.apache.sshd.scp.server.ScpCommandFactory
import org.apache.sshd.server.SshServer
import org.apache.sshd.server.auth.UserAuthFactory
import org.apache.sshd.server.auth.password.PasswordAuthenticator
import org.apache.sshd.server.auth.password.UserAuthPasswordFactory
import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator
import org.apache.sshd.server.auth.pubkey.UserAuthPublicKeyFactory
import org.apache.sshd.server.channel.ChannelSession
import org.apache.sshd.server.command.Command
import org.apache.sshd.server.command.CommandFactory
import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider
import org.apache.sshd.server.session.ServerSession
import spock.lang.Shared
Expand All @@ -31,7 +34,6 @@ import spock.lang.Specification
import java.security.PublicKey
import java.time.Duration

import static Thread.sleep
import static java.nio.charset.StandardCharsets.UTF_8

class JSchSshClientTest
Expand Down Expand Up @@ -141,12 +143,15 @@ class JSchSshClientTest

private void setupAuthentication()
{
sshd.setUserAuthFactories([new UserAuthPassword.Factory(), new UserAuthPublicKey.Factory()])
List<UserAuthFactory> userAuthFactories = new ArrayList<>();
userAuthFactories.add(new UserAuthPasswordFactory())
userAuthFactories.add(new UserAuthPublicKeyFactory())
sshd.setUserAuthFactories(userAuthFactories)

sshd.setPasswordAuthenticator(new PasswordAuthenticator() {
boolean authenticate(String username, String password, ServerSession session)
{
return USER.equals(username) && PASSWORD.equals(password);
return USER == username && PASSWORD == password;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use .equals to compare content ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in groovy it is different than Java. IntelliJ suggested the change. I can revert it though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
});

Expand All @@ -163,7 +168,8 @@ class JSchSshClientTest
{
CommandFactory delegateFactory = new CommandFactory() {
@Override
Command createCommand(String command)
Command createCommand(ChannelSession channelSession, String command)
throws IOException
{
if (command == '"echo" "hello world"') {
return new TestCommand('hello world\n', 0)
Expand All @@ -177,7 +183,10 @@ class JSchSshClientTest
}
}
}
sshd.setCommandFactory(new ScpCommandFactory(delegateFactory))
sshd.setIoServiceFactoryFactory(new Nio2ServiceFactoryFactory())
sshd.setCommandFactory(new ScpCommandFactory.Builder()
.withDelegate(delegateFactory)
.build())
}

def cleanupSpec()
Expand Down
Loading