This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ReportPortal4Listener extends BaseTestNGListener { | |
public ExtendedListener() { | |
super(Injector.create( | |
new ConfigurationModule(), | |
override(new ReportPortalClientModule()).with((Module) binder -> binder.bind(Serializer.class).toProvider(() -> { | |
ObjectMapper om = new ObjectMapper(); | |
om.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")); | |
om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | |
return new JacksonSerializer(om); | |
}), new TestNGAgentModule()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyListener extends BaseTestNGListener { | |
public MyListener() { | |
super(Injector.create(Modules.combine(Modules.override(new ConfigurationModule()) | |
.with(new Module() { | |
@Override | |
public void configure(Binder binder) { | |
Properties overrides = new Properties(); | |
overrides.setProperty(ListenerProperty.UUID.getPropertyName(), "my crazy uuid"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
./run.sh "${@}" & | |
timeout 10 bash -c "until </dev/tcp/localhost/3000; do sleep 1; done" | |
curl -s -H "Content-Type: application/json" \ | |
-XPOST http://admin:admin@localhost:3000/api/datasources \ | |
-d @- <<EOF | |
{ | |
"name": "influx", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SocksExtensionModule extends AbstractModule { | |
@Override | |
protected void configure() { | |
} | |
@Provides | |
public HttpClient provideHttpClient(@ListenerPropertyValue(ListenerProperty.UUID) String uuid) throws MalformedURLException { | |
HttpClientFactory httpClientFactory; | |
List<HttpRequestInterceptor> interceptors = new ArrayList<HttpRequestInterceptor>(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Eureka = require('eureka-js-client').Eureka; | |
const client = new Eureka({ | |
// application instance information | |
instance: { | |
app: 'ui', | |
hostName: 'localhost', | |
port: { | |
"$": 8080, | |
"@enabled": "true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This is example of Docker Compose for ReportPortal | |
## Do not forget to configure data volumes for production usage | |
## Execute 'docker-compose -p reportportal up -d --force-recreate' | |
## to start all containers in daemon mode | |
## Where: | |
## '-p reportportal' -- specifies container's prefix (project name) | |
## '-d' -- enables daemon mode | |
## '--force-recreate' -- forces re-recreating of all containers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Andrei Varabyeu | |
*/ | |
public abstract class CachedModuleFactory<T extends Module> implements IModuleFactory { | |
private static final Cache<Class<? extends Module>, Injector> CACHE = | |
CacheBuilder.<Class<? extends Module>, Injector>newBuilder().build(); | |
private final Callable<Injector> INJECTOR_LOADER = new Callable<Injector>() { | |
@Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Andrei Varabyeu | |
*/ | |
public abstract class CachedModuleFactory implements IModuleFactory { | |
/* delegate creating and holding of parent injector to subclass */ | |
abstract protected Injector getParentInjector(); | |
abstract protected Module createTestModule(ITestContext context, Class<?> testClass); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Andrei Varabyeu | |
*/ | |
public abstract class CachedModuleFactory implements IModuleFactory { | |
private static volatile Injector parentInjector; | |
private static final Object LOCK = new Object(); | |
private Injector getParentInjector() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@WebFilter(urlPatterns = {"/*"}) | |
@WebListener | |
public class YourCustomFilter extends SparkFilter implements ServletContextListener { | |
@Override | |
protected SparkApplication getApplication(FilterConfig filterConfig) throws ServletException { | |
return //your SparkApplication; | |
} | |
@Override |
NewerOlder