Tested in big data set
This commit is contained in:
@ -9,6 +9,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
@ -21,6 +22,7 @@ import com.plannaplan.entities.User;
|
||||
import com.plannaplan.types.UserRoles;
|
||||
import com.plannaplan.types.WeekDay;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
@ -66,23 +68,28 @@ public class AssignmentServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
@DirtiesContext(methodMode = MethodMode.BEFORE_METHOD)
|
||||
public void shouldPerformAcceptAlgorythm() {
|
||||
final Random generator = new Random();
|
||||
|
||||
IntStream.range(0, 1700).forEach(i -> {
|
||||
this.userService.save(new User(null, null,
|
||||
"shouldPerformAcceptAlgorythm-" + UUID.randomUUID().toString() + "@AssignmentService.test", null,
|
||||
UserRoles.STUDENT, generator.nextInt(400) + 100));
|
||||
});
|
||||
final List<Groups> groups = new ArrayList<>();
|
||||
|
||||
IntStream.range(0, 418).forEach(i -> {
|
||||
this.groupService.save(new Groups(generator.nextInt(80) + 20, null, null,
|
||||
generator.nextInt(9) * 30 + 9 * 30, WeekDay.getDay(generator.nextInt(5)), null));
|
||||
groups.add(this.groupService.save(new Groups(generator.nextInt(80) + 20, null, null,
|
||||
generator.nextInt(9) * 30 + 9 * 30, WeekDay.getDay(generator.nextInt(5)), null)));
|
||||
});
|
||||
|
||||
IntStream.range(0, 1700).forEach(i -> {
|
||||
final User user = this.userService.save(new User(null, null,
|
||||
"shouldPerformAcceptAlgorythm-" + UUID.randomUUID().toString() + "@AssignmentService.test", null,
|
||||
UserRoles.STUDENT, generator.nextInt(400) + 100));
|
||||
final Commision com = this.comServie.save(new Commision(user));
|
||||
IntStream.range(0, 5).forEach(j -> {
|
||||
this.service.save(new Assignment(groups.get(generator.nextInt(groups.size())), com));
|
||||
});
|
||||
});
|
||||
this.service.callAcceptAlgorythm();
|
||||
System.out.println("-X_-x-x-x-_X-x-x-x-X_-x-x-x-");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user