use of org.testng.TestNG 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);
}
use of org.testng.TestNG in project powermock by powermock.
the class GitHub647 method testSkipTest.
@Test
public void testSkipTest() throws Exception {
final TestNG tng = createTestNG();
runTest(tng);
assertOneTestSkipped();
}
use of org.testng.TestNG in project powermock by powermock.
the class SimpleBaseTest method create.
public static TestNG create() {
TestNG result = new TestNG();
result.setUseDefaultListeners(false);
result.setVerbose(0);
return result;
}
use of org.testng.TestNG in project mockito by mockito.
the class TestNGShouldFailWhenMockitoListenerFailsTest method report_failure_on_incorrect_stubbing_syntax_with_matchers_in_test_methods.
@Test
public void report_failure_on_incorrect_stubbing_syntax_with_matchers_in_test_methods() throws Exception {
TestNG testNG = new_TestNG_with_failure_recorder_for(FailingOnPurposeBecauseIncorrectStubbingSyntax.class);
testNG.run();
assertTrue(testNG.hasFailure());
assertThat(failureRecorder.lastThrowable()).isInstanceOf(InvalidUseOfMatchersException.class);
}
use of org.testng.TestNG in project spring-framework by spring-projects.
the class FailingBeforeAndAfterMethodsTestNGTests method runTestAndAssertCounters.
@Test
@Ignore("Fails against TestNG 6.11")
public void runTestAndAssertCounters() throws Exception {
TrackingTestNGTestListener listener = new TrackingTestNGTestListener();
TestNG testNG = new TestNG();
testNG.addListener((ITestNGListener) listener);
testNG.setTestClasses(new Class<?>[] { this.clazz });
testNG.setVerbose(0);
testNG.run();
String name = this.clazz.getSimpleName();
assertEquals("tests started for [" + name + "] ==> ", this.expectedTestStartCount, listener.testStartCount);
assertEquals("successful tests for [" + name + "] ==> ", this.expectedTestSuccessCount, listener.testSuccessCount);
assertEquals("failed tests for [" + name + "] ==> ", this.expectedFailureCount, listener.testFailureCount);
assertEquals("failed configurations for [" + name + "] ==> ", this.expectedFailedConfigurationsCount, listener.failedConfigurationsCount);
}
Aggregations