This file contains 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
//First observer. takes 1 ms to process each element | |
integerFlux.delayElements(Duration.ofMillis(1)).subscribe(i -> System.out.println("First :: " + i)); | |
//Second observer. takes 2 ms to process each element | |
integerFlux.delayElements(Duration.ofMillis(2)).subscribe(i -> System.out.println("Second:: " + i)); |
This file contains 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
Flux<Integer> integerFlux = Flux.create((FluxSink<Integer> fluxSink) -> { | |
IntStream.range(0, 5) | |
.peek(i -> System.out.println("going to emit - " + i)) | |
.forEach(fluxSink::next); | |
}); |
This file contains 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
//our movie theatre | |
//each scene will play for 2 seconds | |
Flux<String> movieTheatre = Flux.fromStream(() -> getMovie()) | |
.delayElements(Duration.ofSeconds(2)) | |
.share(); | |
// you start watching the movie | |
movieTheatre.subscribe(scene -> System.out.println("You are watching " + scene)); | |
//I join after sometime |
This file contains 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
//our NetFlux streamer | |
//each scene will play for 2 seconds | |
Flux<String> netFlux = Flux.fromStream(() -> getMovie()) | |
.delayElements(Duration.ofSeconds(2)); | |
// you start watching the movie | |
netFlux.subscribe(scene -> System.out.println("You are watching " + scene)); | |
//I join after sometime | |
Thread.sleep(5000); |
This file contains 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
private Stream<String> getMovie(){ | |
System.out.println("Got the movie streaming request"); | |
return Stream.of( | |
"scene 1", | |
"scene 2", | |
"scene 3", | |
"scene 4", | |
"scene 5" | |
); | |
} |
This file contains 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
private int getDataToBePublished(){ | |
System.out.println("getDataToBePublished was called"); | |
return 1; | |
} |
This file contains 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
<suite name="TesTautomationGuru"> | |
<test name="Testcase Description 1"> | |
<parameter name="Data" value="data1" /> | |
<classes> | |
<class name="com.testautomationguru.test.Test1" /> | |
<class name="com.testautomationguru.test.Test2" /> | |
</classes> | |
</test> | |
<test name="Testcase Description 2"> | |
<parameter name="Data" value="data2" /> |
This file contains 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
XLSReader suite = new XLSReader("tests.xls"); | |
suite.getTests("select * from TestCase where module='Order'"); |
This file contains 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 XLSReader { | |
private final Fillo fillo; | |
private final String filePath; | |
private Connection connection; | |
public XLSReader(String filePath) { | |
fillo = new Fillo(); | |
this.filePath = filePath; |
This file contains 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
@JacksonXmlRootElement(localName = "suite") | |
public class Suite { | |
@JacksonXmlProperty(isAttribute = true) | |
private String name; | |
@JacksonXmlProperty(localName = "test") | |
@JacksonXmlElementWrapper(useWrapping = false) | |
private List < Test > tests; |
NewerOlder