This commit is contained in:
Zoltan Haindrich 2024-06-18 15:43:46 +00:00
parent e725df7110
commit 475f5b5830
1 changed files with 0 additions and 49 deletions

View File

@ -19,21 +19,9 @@
package org.apache.druid.quidem; package org.apache.druid.quidem;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import org.apache.druid.sql.calcite.util.SqlTestFramework.QueryComponentSupplier;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.reflections.Reflections;
import org.reflections.scanners.SubTypesScanner;
import org.reflections.util.ConfigurationBuilder;
import org.reflections.util.FilterBuilder;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assertions.fail;
@ -61,41 +49,4 @@ public class QTest extends DruidQuidemTestBase
} }
} }
} }
@Test
public void testQTest() throws Exception
{
LoadingCache<String, Set<Class<? extends QueryComponentSupplier>>> componentSupplierClassCache = CacheBuilder
.newBuilder()
.build(new CacheLoader<String, Set<Class<? extends QueryComponentSupplier>>>()
{
@Override
public Set<Class<? extends QueryComponentSupplier>> load(String pkg) throws MalformedURLException
{
return new Reflections(
new ConfigurationBuilder()
// .addUrls(ClasspathHelper.forPackage(pkg,
// getClass().getClassLoader()))
// .addClassLoaders(getClass().getClassLoader().getParent())
.setScanners(
new SubTypesScanner(true)
)
.filterInputsBy(
new FilterBuilder().includePackage(pkg).and(
s -> s.contains("ComponentSupplier")
)
)
.setUrls(org.reflections.util.ClasspathHelper.forJavaClassPath())
)
.getSubTypesOf(QueryComponentSupplier.class);
}
});
Set<Class<? extends QueryComponentSupplier>> a = componentSupplierClassCache.get("");
throw new RuntimeException("X" + a);
}
} }