// create Data instance
final Data data = new Data(browsers, browserPatterns, browserTypes, patternToBrowserMap, browserToOperatingSystemMappings,
operatingSystems, operatingSystemPatterns, patternToOperatingSystemMap, robots, devices, devicePatterns,
patternToDeviceMap, version);
final UserAgentStringParser parser = new UserAgentStringParserImpl<DataStore>(new DataStore() {
@Override
public Charset getCharset() {
return DataStore.DEFAULT_CHARSET;
}
@Override
public Data getData() {
return data;
}
@Override
public DataReader getDataReader() {
return null;
}
@Override
public URL getDataUrl() {
return null;
}
@Override
public URL getVersionUrl() {
return null;
}
});
final ReadableUserAgent ua1 = parser.parse("Eudora");
assertThat(ua1.getFamily()).isEqualTo(UserAgentFamily.EUDORA);
assertThat(ua1.getVersionNumber().toVersionString()).isEqualTo("");
assertThat(ua1.getDeviceCategory()).isEqualTo(DeviceCategory.EMPTY);
final ReadableUserAgent ua2 = parser.parse("Eudora/1.0");
assertThat(ua2.getFamily()).isEqualTo(UserAgentFamily.EUDORA);
assertThat(ua2.getVersionNumber().toVersionString()).isEqualTo("");
assertThat(ua2.getDeviceCategory()).isEqualTo(DeviceCategory.EMPTY);
}