Skip to content

Instantly share code, notes, and snippets.

View nick318's full-sized avatar

Nikita nick318

View GitHub Profile
@nick318
nick318 / pom.xml
Last active February 26, 2018 10:14
Pom file of selenide, testng, allure
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>project</groupId>
<artifactId>autotests</artifactId>
<version>1.0-SNAPSHOT</version>
@nick318
nick318 / AllurePrintStream.java
Created February 26, 2018 09:57
Copy logs from rest assured to allure
package com.company;
import io.qameta.allure.Step;
import java.io.*;
/**
* Class for copy logs into Allure
*/
public class AllurePrintStream extends PrintStream
@nick318
nick318 / hasNext.java
Created February 8, 2018 17:23
hasNext method
@Test
public void correctValuesForConcurrentHasNext() throws ExecutionException, InterruptedException {
int exceptionCount = 0;
for (int i = 0; i <5000; i++) {
Iterator<Integer> syncIterator = new SyncIterator<Integer>(
Stream.iterate(0, j -> j + 1).limit(200)
.collect(toList())
.iterator());
CountDownLatch startSignal = new CountDownLatch(1);
@nick318
nick318 / next.java
Created February 8, 2018 17:21
Test for next method
@Test
public void correctValuesForConcurrentNext() throws ExecutionException, InterruptedException {
for (int i = 0; i < 5000; i++) {
final Iterator<String> syncIterator = new SyncIterator<>(
new ListOf<>("a", "b")
.iterator());
final CountDownLatch startSignal = new CountDownLatch(1);
final ExecutorService executors = Executors.newFixedThreadPool(2);
final Future<String> letter = executors.submit(() -> {
@Test
public void doubleCall() throws IOException {
Md5DigestOf md5DigestOf = new Md5DigestOf(
new InputOf(
new ResourceOf(
"org/cactoos/io/DigestEnvelope.class"
).stream()
)
);
@Test
public void correctValuesForConcurrentHasNext() throws ExecutionException, InterruptedException {
int exceptionCount = 0;
for (int i = 0; i <5000; i++) {
Iterator<Integer> syncIterator = new SyncIterator<Integer>(
Stream.iterate(0, j -> j + 1).limit(200)
.collect(toList())
.iterator());
CountDownLatch startSignal = new CountDownLatch(1);