use of no.stelar7.api.l4j8.impl.builders.match.MatchListBuilder in project L4J8 by stelar7.
the class MatchListTest method testMatchAndMatchList.
@Test
@Ignore
public void testMatchAndMatchList() {
DataCall.setCacheProvider(new FileSystemCacheProvider());
DataCall.setLogLevel(LogLevel.INFO);
// EnumSet.of(GameQueueType.TEAM_BUILDER_RANKED_SOLO);
Set<GameQueueType> queue = null;
// EnumSet.of(SeasonType.SEASON_2018);
Set<SeasonType> season = null;
// new HashSet<>(Collections.singletonList(40));
Set<Integer> champ = null;
// LocalDateTime.now().withHour(0).toEpochSecond(ZoneOffset.UTC) * 1000;//1481108400000L; // start of season 2017
Long beginTime = null;
// LocalDateTime.now().withHour(0).plusWeeks(1).toEpochSecond(ZoneOffset.UTC) * 1000; // 604800000 is one week in ms
Long endTime = null;
// 0;
Long beginIndex = null;
// 100;
Long endIndex = null;
MatchListBuilder builder = new MatchListBuilder();
Summoner sum = new SummonerBuilder().withPlatform(Platform.EUW1).withName("stelar7").get();
builder = builder.withPlatform(sum.getPlatform()).withAccountId(sum.getAccountId());
builder = builder.withBeginTime(beginTime).withEndTime(endTime);
builder = builder.withBeginIndex(beginIndex).withEndIndex(endIndex);
builder = builder.withQueues(queue).withSeasons(season).withChampions(champ);
LazyList<MatchReference> all = builder.getLazy();
MatchBuilder mb = new MatchBuilder();
TimelineBuilder tb = new TimelineBuilder();
for (MatchReference reference : all) {
Match detail = reference.getFullMatch();
}
}
use of no.stelar7.api.l4j8.impl.builders.match.MatchListBuilder in project L4J8 by stelar7.
the class AsyncTest method testAsync.
@Test
@Ignore
public void testAsync() {
List<CompletableFuture> futures = new ArrayList<>();
for (int i = 0; i < 100; i++) {
futures.add(supplyAsync(() -> new SummonerBuilder().withPlatform(Platform.EUW1).withAccountId(Constants.TEST_ACCOUNT_IDS[1]).get()).thenAccept(this::handleSummonerCallback));
}
futures.add(supplyAsync(() -> new MatchListBuilder().withPlatform(Platform.EUW1).withAccountId(Constants.TEST_ACCOUNT_IDS[1]).get()).thenAccept(this::handleMatchCallback));
CompletableFuture spinner = CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()]));
spinner.join();
}
Aggregations