Search in sources :

Example 11 with InvokedMethodNameListener

use of io.github.sskorol.listeners.InvokedMethodNameListener in project selenium_java by sergueik.

the class DataSupplierTests method arraysDataSuppliersShouldWork.

@Test
public void arraysDataSuppliersShouldWork() {
    final InvokedMethodNameListener listener = run(ArraysDataSupplierTests.class);
    assertThat(listener.getSucceedMethodNames()).hasSize(10).containsExactly("supplyCustomArrayData(User(name=username, password=password))", "supplyCustomArrayData(null)", "supplyExternalArrayData(User(name=user1, password=password1),User(name=user2, password=password2))", "supplyExtractedArrayData(data1,data2)", "supplyPrimitiveDoubleArrayData(0.1)", "supplyPrimitiveDoubleArrayData(0.3)", "supplyPrimitiveIntArrayData(5)", "supplyPrimitiveLongArrayData(2)", "supplyPrimitiveLongArrayData(6)", "supplyPrimitiveLongArrayData(100)");
}
Also used : InvokedMethodNameListener(io.github.sskorol.listeners.InvokedMethodNameListener) Test(org.testng.annotations.Test)

Example 12 with InvokedMethodNameListener

use of io.github.sskorol.listeners.InvokedMethodNameListener in project selenium_java by sergueik.

the class DataSupplierTests method nullObjectsDataSuppliersShouldWork.

@Test
public void nullObjectsDataSuppliersShouldWork() {
    final InvokedMethodNameListener listener = run(NullObjectsDataSupplierTests.class);
    assertThat(listener.getSkippedBeforeInvocationMethodNames()).hasSize(5).containsExactly("supplyExtractedNullObject()", "supplyNullArrayData()", "supplyNullCollectionData()", "supplyNullObjectData()", "supplyNullStreamData()");
    assertThat(EntryStream.of(listener.getResults()).values().toList()).extracting(ITestResult::getThrowable).extracting(Throwable::getMessage).containsExactly("java.lang.IllegalArgumentException: Nothing to return from data supplier. The following test will be skipped: NullObjectsDataSupplierTests.supplyNullCollectionData.", "java.lang.IllegalArgumentException: Nothing to return from data supplier. The following test will be skipped: NullObjectsDataSupplierTests.supplyNullStreamData.", "java.lang.IllegalArgumentException: Nothing to return from data supplier. The following test will be skipped: NullObjectsDataSupplierTests.supplyExtractedNullObject.", "java.lang.IllegalArgumentException: Nothing to return from data supplier. The following test will be skipped: NullObjectsDataSupplierTests.supplyNullArrayData.", "java.lang.IllegalArgumentException: Nothing to return from data supplier. The following test will be skipped: NullObjectsDataSupplierTests.supplyNullObjectData.");
}
Also used : InvokedMethodNameListener(io.github.sskorol.listeners.InvokedMethodNameListener) ITestResult(org.testng.ITestResult) Test(org.testng.annotations.Test)

Aggregations

InvokedMethodNameListener (io.github.sskorol.listeners.InvokedMethodNameListener)12 Test (org.testng.annotations.Test)11 Collection (java.util.Collection)3 ITestResult (org.testng.ITestResult)3 EntryStream (one.util.streamex.EntryStream)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 DataProviderTransformer (io.github.sskorol.dataprovider.DataProviderTransformer)1 TestNG (org.testng.TestNG)1