Search in sources :

Example 31 with FileSystemCacheProvider

use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.

the class MatchListTest method testMatchlistAllLazy.

@Test
public void testMatchlistAllLazy() {
    DataCall.setCacheProvider(new FileSystemCacheProvider());
    DataCall.getCacheProvider().clear(URLEndpoint.V3_MATCHLIST);
    for (int i = 0; i < Constants.TEST_ACCOUNT_IDS.length; i++) {
        List<MatchReference> list = new MatchListBuilder().withAccountId(Constants.TEST_ACCOUNT_IDS[i]).withPlatform(Constants.TEST_PLATFORM[i]).getLazy();
        Assert.assertTrue("LazyList loaded data?!", list.isEmpty());
        list.get(51);
        Assert.assertTrue("LazyList didnt load data?!", !list.isEmpty());
    }
}
Also used : FileSystemCacheProvider(no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider)

Example 32 with FileSystemCacheProvider

use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider 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();
    }
}
Also used : Summoner(no.stelar7.api.l4j8.pojo.summoner.Summoner) SummonerBuilder(no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder) FileSystemCacheProvider(no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider)

Example 33 with FileSystemCacheProvider

use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.

the class StaticTest method testLanguageStrings.

@Test
public void testLanguageStrings() {
    DataCall.setCacheProvider(new FileSystemCacheProvider());
    DataCall.setLogLevel(LogLevel.DEBUG);
    Map<String, String> strings = api.getLanguageStrings(Platform.EUW1, null, null);
}
Also used : FileSystemCacheProvider(no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider)

Example 34 with FileSystemCacheProvider

use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.

the class StaticTest method testRuneSingle.

@Test
public void testRuneSingle() {
    DataCall.setCacheProvider(new FileSystemCacheProvider());
    DataCall.setLogLevel(LogLevel.DEBUG);
    EnumSet<RuneDataFlags> dataFlags = EnumSet.of(RuneDataFlags.ALL, RuneDataFlags.IMAGE);
    StaticRune rune = api.getRune(Platform.EUW1, 5023, dataFlags, null, null);
    Assert.assertTrue("missing id?", rune.getId() == 5023);
    Assert.assertTrue("missing stats?", rune.getStats() != null);
    Assert.assertTrue("missing desc?", rune.getDescription() != null);
    Assert.assertTrue("missing tags?", rune.getTags() != null);
    Assert.assertTrue("missing image?", rune.getImage() != null);
    Assert.assertTrue("missing sandesc?", rune.getSanitizedDescription() != null);
    Assert.assertTrue("missing rune?", rune.getRune() != null);
    Assert.assertTrue("missing name?", rune.getName() != null);
}
Also used : StaticRune(no.stelar7.api.l4j8.pojo.staticdata.rune.StaticRune) FileSystemCacheProvider(no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider)

Example 35 with FileSystemCacheProvider

use of no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider in project L4J8 by stelar7.

the class StaticTest method testSummonerSpellList.

@Test
public void testSummonerSpellList() {
    DataCall.setCacheProvider(new FileSystemCacheProvider());
    DataCall.setLogLevel(LogLevel.DEBUG);
    EnumSet<SpellDataFlags> dataFlags = EnumSet.of(SpellDataFlags.ALL, SpellDataFlags.IMAGE);
    Map<Integer, StaticSummonerSpell> list = api.getSummonerSpells(Platform.EUN1, dataFlags, null, null);
}
Also used : FileSystemCacheProvider(no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider) StaticSummonerSpell(no.stelar7.api.l4j8.pojo.staticdata.summonerspell.StaticSummonerSpell)

Aggregations

FileSystemCacheProvider (no.stelar7.api.l4j8.basic.cache.impl.FileSystemCacheProvider)28 FileSystemCacheProvider (no.stelar7.api.r4j.basic.cache.impl.FileSystemCacheProvider)27 StaticMastery (no.stelar7.api.l4j8.pojo.staticdata.mastery.StaticMastery)5 Summoner (no.stelar7.api.r4j.pojo.lol.summoner.Summoner)5 SummonerBuilder (no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder)4 StaticChampion (no.stelar7.api.l4j8.pojo.staticdata.champion.StaticChampion)4 java.util (java.util)3 StaticRune (no.stelar7.api.l4j8.pojo.staticdata.rune.StaticRune)3 Summoner (no.stelar7.api.l4j8.pojo.summoner.Summoner)3 R4J (no.stelar7.api.r4j.impl.R4J)3 Item (no.stelar7.api.r4j.pojo.lol.staticdata.item.Item)3 StaticMastery (no.stelar7.api.r4j.pojo.lol.staticdata.mastery.StaticMastery)3 StaticRune (no.stelar7.api.r4j.pojo.lol.staticdata.rune.StaticRune)3 java.awt (java.awt)2 AffineTransform (java.awt.geom.AffineTransform)2 java.awt.image (java.awt.image)2 java.io (java.io)2 URL (java.net.URL)2 List (java.util.List)2 Predicate (java.util.function.Predicate)2