Search in sources :

Example 41 with UserAgentAnalyzerTester

use of nl.basjes.parse.useragent.debug.UserAgentAnalyzerTester in project yauaa by nielsbasjes.

the class TestYamlBasedExpressions method runIsNullLookupTest.

@Test
void runIsNullLookupTest() {
    UserAgentAnalyzerTester uaa = createTester("IsNullLookup.yaml");
    uaa.setVerbose(true);
    assertTrue(uaa.runTests(false, true));
}
Also used : UserAgentAnalyzerTester(nl.basjes.parse.useragent.debug.UserAgentAnalyzerTester) Test(org.junit.jupiter.api.Test)

Example 42 with UserAgentAnalyzerTester

use of nl.basjes.parse.useragent.debug.UserAgentAnalyzerTester in project yauaa by nielsbasjes.

the class TestYamlBasedExpressions method runReplaceStringTest.

@Test
void runReplaceStringTest() {
    UserAgentAnalyzerTester uaa = createTester("ReplaceString-tests.yaml");
    uaa.setVerbose(true);
    assertTrue(uaa.runTests(false, true));
}
Also used : UserAgentAnalyzerTester(nl.basjes.parse.useragent.debug.UserAgentAnalyzerTester) Test(org.junit.jupiter.api.Test)

Example 43 with UserAgentAnalyzerTester

use of nl.basjes.parse.useragent.debug.UserAgentAnalyzerTester in project yauaa by nielsbasjes.

the class TestKryoSerialization method deserialize.

UserAgentAnalyzerTester deserialize(byte[] bytes) {
    Kryo kryo = new Kryo();
    UserAgentAnalyzerTester.configureKryo(kryo);
    // Now we KNOW in our code we have a custom CacheInstantiator that needs to be registered too for Kryo.
    kryo.register(TestingCacheInstantiator.class);
    ByteBufferInput byteBufferInput = new ByteBufferInput(bytes);
    return (UserAgentAnalyzerTester) kryo.readClassAndObject(byteBufferInput);
}
Also used : UserAgentAnalyzerTester(nl.basjes.parse.useragent.debug.UserAgentAnalyzerTester) ByteBufferInput(com.esotericsoftware.kryo.io.ByteBufferInput) Kryo(com.esotericsoftware.kryo.Kryo)

Aggregations

UserAgentAnalyzerTester (nl.basjes.parse.useragent.debug.UserAgentAnalyzerTester)43 Test (org.junit.jupiter.api.Test)37 ArrayList (java.util.ArrayList)3 UserAgentAnalyzerTesterBuilder (nl.basjes.parse.useragent.debug.UserAgentAnalyzerTester.UserAgentAnalyzerTesterBuilder)3 TestCase (nl.basjes.parse.useragent.config.TestCase)2 YamlUtils.getKeyAsString (nl.basjes.parse.useragent.utils.YamlUtils.getKeyAsString)2 Kryo (com.esotericsoftware.kryo.Kryo)1 ByteBufferInput (com.esotericsoftware.kryo.io.ByteBufferInput)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ObjectInput (java.io.ObjectInput)1 ObjectInputStream (java.io.ObjectInputStream)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 ImmutableUserAgent (nl.basjes.parse.useragent.UserAgent.ImmutableUserAgent)1 MutableUserAgent (nl.basjes.parse.useragent.UserAgent.MutableUserAgent)1 InvalidParserConfigurationException (nl.basjes.parse.useragent.analyze.InvalidParserConfigurationException)1 Match (nl.basjes.parse.useragent.analyze.MatchesList.Match)1 AbstractUserAgentAnalyzerTester (nl.basjes.parse.useragent.debug.AbstractUserAgentAnalyzerTester)1 Disabled (org.junit.jupiter.api.Disabled)1