netty.resolver tests

This commit is contained in:
Tony Torralba
2023-03-14 11:09:26 +01:00
parent 1b85e8b706
commit 8cc2686a2f
14 changed files with 224 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package generatedtest;
import io.netty.resolver.SimpleNameResolver;
import io.netty.util.concurrent.Future;
// Test case generated by GenerateFlowTestCase.ql
public class Test {
Object source() {
return null;
}
void sink(Object o) {}
public void test() throws Exception {
{
// "io.netty.resolver;SimpleNameResolver;false;resolve;(String);;Argument[0];ReturnValue;taint;ai-generated"
Future out = null;
String in = (String) source();
SimpleNameResolver instance = null;
out = instance.resolve(in);
sink(out); // $ hasTaintFlow
}
}
}

View File

@@ -0,0 +1 @@
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/netty-4.1.x

View File

@@ -0,0 +1,2 @@
import java
import TestUtilities.InlineFlowTest

View File

@@ -0,0 +1,16 @@
// Generated automatically from io.netty.resolver.NameResolver for testing purposes
package io.netty.resolver;
import io.netty.util.concurrent.Promise;
import java.io.Closeable;
import java.util.List;
public interface NameResolver<T> extends Closeable
{
io.netty.util.concurrent.Future<T> resolve(String p0);
io.netty.util.concurrent.Future<T> resolve(String p0, io.netty.util.concurrent.Promise<T> p1);
io.netty.util.concurrent.Future<java.util.List<T>> resolveAll(String p0);
io.netty.util.concurrent.Future<java.util.List<T>> resolveAll(String p0, io.netty.util.concurrent.Promise<java.util.List<T>> p1);
void close();
}

View File

@@ -0,0 +1,22 @@
// Generated automatically from io.netty.resolver.SimpleNameResolver for testing purposes
package io.netty.resolver;
import io.netty.resolver.NameResolver;
import io.netty.util.concurrent.EventExecutor;
import io.netty.util.concurrent.Promise;
import java.util.List;
abstract public class SimpleNameResolver<T> implements NameResolver<T>
{
protected SimpleNameResolver() {}
protected EventExecutor executor(){ return null; }
protected SimpleNameResolver(EventExecutor p0){}
protected abstract void doResolve(String p0, io.netty.util.concurrent.Promise<T> p1);
protected abstract void doResolveAll(String p0, io.netty.util.concurrent.Promise<java.util.List<T>> p1);
public final io.netty.util.concurrent.Future<T> resolve(String p0){ return null; }
public final io.netty.util.concurrent.Future<java.util.List<T>> resolveAll(String p0){ return null; }
public io.netty.util.concurrent.Future<T> resolve(String p0, io.netty.util.concurrent.Promise<T> p1){ return null; }
public io.netty.util.concurrent.Future<java.util.List<T>> resolveAll(String p0, io.netty.util.concurrent.Promise<java.util.List<T>> p1){ return null; }
public void close(){}
}

View File

@@ -0,0 +1,19 @@
// Generated automatically from io.netty.util.concurrent.EventExecutor for testing purposes
package io.netty.util.concurrent;
import io.netty.util.concurrent.EventExecutorGroup;
import io.netty.util.concurrent.ProgressivePromise;
import io.netty.util.concurrent.Promise;
public interface EventExecutor extends EventExecutorGroup
{
<V> ProgressivePromise<V> newProgressivePromise();
<V> io.netty.util.concurrent.Future<V> newFailedFuture(Throwable p0);
<V> io.netty.util.concurrent.Future<V> newSucceededFuture(V p0);
<V> io.netty.util.concurrent.Promise<V> newPromise();
EventExecutor next();
EventExecutorGroup parent();
boolean inEventLoop();
boolean inEventLoop(Thread p0);
}

View File

@@ -0,0 +1,29 @@
// Generated automatically from io.netty.util.concurrent.EventExecutorGroup for testing purposes
package io.netty.util.concurrent;
import io.netty.util.concurrent.EventExecutor;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public interface EventExecutorGroup extends Iterable<EventExecutor>, ScheduledExecutorService
{
<T> io.netty.util.concurrent.Future<T> submit(Runnable p0, T p1);
<T> io.netty.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> p0);
<V> io.netty.util.concurrent.ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> p0, long p1, TimeUnit p2);
EventExecutor next();
Iterator<EventExecutor> iterator();
List<Runnable> shutdownNow();
boolean isShuttingDown();
io.netty.util.concurrent.Future<? extends Object> shutdownGracefully();
io.netty.util.concurrent.Future<? extends Object> shutdownGracefully(long p0, long p1, TimeUnit p2);
io.netty.util.concurrent.Future<? extends Object> submit(Runnable p0);
io.netty.util.concurrent.Future<? extends Object> terminationFuture();
io.netty.util.concurrent.ScheduledFuture<? extends Object> schedule(Runnable p0, long p1, TimeUnit p2);
io.netty.util.concurrent.ScheduledFuture<? extends Object> scheduleAtFixedRate(Runnable p0, long p1, long p2, TimeUnit p3);
io.netty.util.concurrent.ScheduledFuture<? extends Object> scheduleWithFixedDelay(Runnable p0, long p1, long p2, TimeUnit p3);
void shutdown();
}

View File

@@ -0,0 +1,27 @@
// Generated automatically from io.netty.util.concurrent.Future for testing purposes
package io.netty.util.concurrent;
import io.netty.util.concurrent.GenericFutureListener;
import java.util.concurrent.TimeUnit;
public interface Future<V> extends java.util.concurrent.Future<V>
{
Throwable cause();
V getNow();
boolean await(long p0);
boolean await(long p0, TimeUnit p1);
boolean awaitUninterruptibly(long p0);
boolean awaitUninterruptibly(long p0, TimeUnit p1);
boolean cancel(boolean p0);
boolean isCancellable();
boolean isSuccess();
io.netty.util.concurrent.Future<V> addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> p0);
io.netty.util.concurrent.Future<V> addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... p0);
io.netty.util.concurrent.Future<V> await();
io.netty.util.concurrent.Future<V> awaitUninterruptibly();
io.netty.util.concurrent.Future<V> removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> p0);
io.netty.util.concurrent.Future<V> removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... p0);
io.netty.util.concurrent.Future<V> sync();
io.netty.util.concurrent.Future<V> syncUninterruptibly();
}

View File

@@ -0,0 +1,10 @@
// Generated automatically from io.netty.util.concurrent.GenericFutureListener for testing purposes
package io.netty.util.concurrent;
import java.util.EventListener;
public interface GenericFutureListener<F extends io.netty.util.concurrent.Future<? extends Object>> extends EventListener
{
void operationComplete(F p0);
}

View File

@@ -0,0 +1,17 @@
// Generated automatically from io.netty.util.concurrent.ProgressiveFuture for testing purposes
package io.netty.util.concurrent;
import io.netty.util.concurrent.GenericFutureListener;
public interface ProgressiveFuture<V> extends io.netty.util.concurrent.Future<V>
{
ProgressiveFuture<V> addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> p0);
ProgressiveFuture<V> addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... p0);
ProgressiveFuture<V> await();
ProgressiveFuture<V> awaitUninterruptibly();
ProgressiveFuture<V> removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> p0);
ProgressiveFuture<V> removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... p0);
ProgressiveFuture<V> sync();
ProgressiveFuture<V> syncUninterruptibly();
}

View File

@@ -0,0 +1,23 @@
// Generated automatically from io.netty.util.concurrent.ProgressivePromise for testing purposes
package io.netty.util.concurrent;
import io.netty.util.concurrent.GenericFutureListener;
import io.netty.util.concurrent.ProgressiveFuture;
import io.netty.util.concurrent.Promise;
public interface ProgressivePromise<V> extends io.netty.util.concurrent.ProgressiveFuture<V>, io.netty.util.concurrent.Promise<V>
{
ProgressivePromise<V> addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> p0);
ProgressivePromise<V> addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... p0);
ProgressivePromise<V> await();
ProgressivePromise<V> awaitUninterruptibly();
ProgressivePromise<V> removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> p0);
ProgressivePromise<V> removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... p0);
ProgressivePromise<V> setFailure(Throwable p0);
ProgressivePromise<V> setProgress(long p0, long p1);
ProgressivePromise<V> setSuccess(V p0);
ProgressivePromise<V> sync();
ProgressivePromise<V> syncUninterruptibly();
boolean tryProgress(long p0, long p1);
}

View File

@@ -0,0 +1,22 @@
// Generated automatically from io.netty.util.concurrent.Promise for testing purposes
package io.netty.util.concurrent;
import io.netty.util.concurrent.GenericFutureListener;
public interface Promise<V> extends io.netty.util.concurrent.Future<V>
{
Promise<V> addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> p0);
Promise<V> addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... p0);
Promise<V> await();
Promise<V> awaitUninterruptibly();
Promise<V> removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> p0);
Promise<V> removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... p0);
Promise<V> setFailure(Throwable p0);
Promise<V> setSuccess(V p0);
Promise<V> sync();
Promise<V> syncUninterruptibly();
boolean setUncancellable();
boolean tryFailure(Throwable p0);
boolean trySuccess(V p0);
}

View File

@@ -0,0 +1,8 @@
// Generated automatically from io.netty.util.concurrent.ScheduledFuture for testing purposes
package io.netty.util.concurrent;
public interface ScheduledFuture<V> extends io.netty.util.concurrent.Future<V>, java.util.concurrent.ScheduledFuture<V>
{
}