Search in sources :

Example 1 with TestListenerAdapter

use of org.testng.TestListenerAdapter in project pinot by linkedin.

the class HybridScanBasedCommandLineTestRunner method main.

public static void main(String[] args) throws Exception {
    if (args.length == 0) {
        usage();
    }
    int expectedArgsLen = 5;
    int ix = 0;
    // Parse optional arguments first.
    while (args[ix].startsWith("-")) {
        if (args[ix].equals("--record")) {
            CustomHybridClusterScanComparisonIntegrationTest._recordScanResponses = true;
        } else if (args[ix].equals("--llc")) {
            CustomHybridClusterScanComparisonIntegrationTest._useLlc = true;
        } else {
            usage();
        }
        ix++;
        expectedArgsLen++;
    }
    if (args.length != expectedArgsLen) {
        usage();
    }
    final String tableName = args[ix++];
    final String schemaFilePath = args[ix++];
    // we expect a dir called 'avro-files' and files called 'queries.txt' and 'scan-responses.txt' in here
    final String segQueryDirPath = args[ix++];
    final String invIndexCols = args[ix++];
    final String sortedCol = args[ix++];
    CustomHybridClusterScanComparisonIntegrationTest.setParams(tableName, schemaFilePath, segQueryDirPath, invIndexCols, sortedCol);
    TestListenerAdapter tla = new TestListenerAdapter();
    TestNG testng = new TestNG();
    testng.setTestClasses(new Class[] { CustomHybridClusterScanComparisonIntegrationTest.class });
    testng.addListener(tla);
    testng.run();
    System.out.println("Passed tests: " + tla.getPassedTests());
    if (!tla.getSkippedTests().isEmpty()) {
        System.out.println("Skipped tests: " + tla.getSkippedTests());
    }
    System.out.println(tla.toString());
    if (!tla.getFailedTests().isEmpty()) {
        System.err.println("Failed tests:" + tla.getFailedTests());
        System.exit(1);
    }
    System.exit(0);
}
Also used : TestNG(org.testng.TestNG) TestListenerAdapter(org.testng.TestListenerAdapter)

Example 2 with TestListenerAdapter

use of org.testng.TestListenerAdapter in project incubator-atlas by apache.

the class SecureEmbeddedServerTestBase method runOtherSuitesAgainstSecureServer.

/**
     * Runs the existing webapp test cases, this time against the initiated secure server instance.
     * @throws Exception
     */
@Test
public void runOtherSuitesAgainstSecureServer() throws Exception {
    final PropertiesConfiguration configuration = new PropertiesConfiguration();
    configuration.setProperty(CERT_STORES_CREDENTIAL_PROVIDER_PATH, providerUrl);
    // setup the credential provider
    setupCredentials();
    try {
        secureEmbeddedServer = new SecureEmbeddedServer(securePort, TestUtils.getWarPath()) {

            @Override
            protected PropertiesConfiguration getConfiguration() {
                return configuration;
            }
        };
        secureEmbeddedServer.server.start();
        TestListenerAdapter tla = new TestListenerAdapter();
        TestNG testng = new TestNG();
        testng.setTestClasses(new Class[] { AdminJerseyResourceIT.class, EntityJerseyResourceIT.class, MetadataDiscoveryJerseyResourceIT.class, TypesJerseyResourceIT.class });
        testng.addListener(tla);
        testng.run();
    } finally {
        secureEmbeddedServer.server.stop();
    }
}
Also used : TestNG(org.testng.TestNG) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) TestListenerAdapter(org.testng.TestListenerAdapter) Test(org.testng.annotations.Test)

Aggregations

TestListenerAdapter (org.testng.TestListenerAdapter)2 TestNG (org.testng.TestNG)2 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)1 Test (org.testng.annotations.Test)1