nl.hsac.fitnesse.util.RandomDomain Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hsac-fitnesse-plugin Show documentation
Show all versions of hsac-fitnesse-plugin Show documentation
Plugin to add features to a FitNesse installation
package nl.hsac.fitnesse.util;
public class RandomDomain {
private static final RandomUtil RANDOM_UTIL = new RandomUtil();
private static final String PERMITTED_NO_PERIOD = "abcdefghijklmnopqrstuvwxyz1234567890-";
private static final String PERMITTED_PERIOD = "abcdefghijklmnopqrstuvwxyz1234567890-.";
String getRandomSecondLevelDomain(int length) {
String secondLevelDomain;
if (length < 4) {
secondLevelDomain = RANDOM_UTIL.randomString(PERMITTED_NO_PERIOD, length);
} else {
secondLevelDomain = RANDOM_UTIL.randomString(PERMITTED_PERIOD, length);
while (secondLevelDomain.contains("..") ||
secondLevelDomain.endsWith(".") ||
secondLevelDomain.startsWith(".")) {
secondLevelDomain = RANDOM_UTIL.randomString(PERMITTED_PERIOD, length);
}
}
return secondLevelDomain;
}
String getRandomTld() {
return RANDOM_UTIL.randomElement(tlds.values()).toString();
}
public static String generateFullDomain(RandomDomain randomDomain, int fullDomainLength) {
if (fullDomainLength < 5) {
throw new IllegalArgumentException("Minimal possible domain length is 5 (2 character, a period, 2 characters)");
}
int domainLength = 0;
String tld = "";
while (domainLength < 2) { //a domain cannot be less than 2 characters (ignoring the handful that exist)
tld = randomDomain.getRandomTld();
domainLength = fullDomainLength - tld.length() - 1; //minus 1 for the period between second level and top level domain
}
String domain = randomDomain.getRandomSecondLevelDomain(domainLength);
return domain + "." + tld;
}
// The below list includes all top level domains registered with IANA on 26th of March 2017
// Version 2017032600, Last Updated Sun Mar 26 07:07:01 2017 UTC
// http://data.iana.org/TLD/tlds-alpha-by-domain.txt
public enum tlds {
AAA,
AARP,
ABARTH,
ABB,
ABBOTT,
ABBVIE,
ABC,
ABLE,
ABOGADO,
ABUDHABI,
AC,
ACADEMY,
ACCENTURE,
ACCOUNTANT,
ACCOUNTANTS,
ACO,
ACTI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CO,
BRIDGESTONE,
BROADWAY,
BROKER,
BROTHER,
BRUSSELS,
BS,
BT,
BUDAPEST,
BUGATTI,
BUILD,
BUILDERS,
BUSINESS,
BUY,
BUZZ,
BV,
BW,
BY,
BZ,
BZH,
CA,
CAB,
CAFE,
CAL,
CALL,
CALVINKLEIN,
CAM,
CAMERA,
CAMP,
CANCERRESEARCH,
CANON,
CAPETOWN,
CAPITAL,
CAPITALONE,
CAR,
CARAVAN,
CARDS,
CARE,
CAREER,
CAREERS,
CARS,
CARTIER,
CASA,
CASE,
CASEIH,
CASH,
CASINO,
CAT,
CATERING,
CATHOLIC,
CBA,
CBN,
CBRE,
CBS,
CC,
CD,
CEB,
CENTER,
CEO,
CERN,
CF,
CFA,
CFD,
CG,
CH,
CHANEL,
CHANNEL,
CHASE,
CHAT,
CHEAP,
CHINTAI,
CHLOE,
CHRISTMAS,
CHROME,
CHRYSLER,
CHURCH,
CI,
CIPRIANI,
CIRCLE,
CISCO,
CITADEL,
CITI,
CITIC,
CITY,
CITYEATS,
CK,
CL,
CLAIMS,
CLEANING,
CLICK,
CLINIC,
CLINIQUE,
CLOTHING,
CLOUD,
CLUB,
CLUBMED,
CM,
CN,
CO,
COACH,
CODES,
COFFEE,
COLLEGE,
COLOGNE,
COM,
COMCAST,
COMMBANK,
COMMUNITY,
COMPANY,
COMPARE,
COMPUTER,
COMSEC,
CONDOS,
CONSTRUCTION,
CONSULTING,
CONTACT,
CONTRACTORS,
COOKING,
COOKINGCHANNEL,
COOL,
COOP,
CORSICA,
COUNTRY,
COUPON,
COUPONS,
COURSES,
CR,
CREDIT,
CREDITCARD,
CREDITUNION,
CRICKET,
CROWN,
CRS,
CRUISE,
CRUISES,
CSC,
CU,
CUISINELLA,
CV,
CW,
CX,
CY,
CYMRU,
CYOU,
CZ,
DABUR,
DAD,
DANCE,
DATA,
DATE,
DATING,
DATSUN,
DAY,
DCLK,
DDS,
DE,
DEAL,
DEALER,
DEALS,
DEGREE,
DELIVERY,
DELL,
DELOITTE,
DELTA,
DEMOCRAT,
DENTAL,
DENTIST,
DESI,
DESIGN,
DEV,
DHL,
DIAMONDS,
DIET,
DIGITAL,
DIRECT,
DIRECTORY,
DISCOUNT,
DISCOVER,
DISH,
DIY,
DJ,
DK,
DM,
DNP,
DO,
DOCS,
DOCTOR,
DODGE,
DOG,
DOHA,
DOMAINS,
DOT,
DOWNLOAD,
DRIVE,
DTV,
DUBAI,
DUCK,
DUNLOP,
DUNS,
DUPONT,
DURBAN,
DVAG,
DVR,
DZ,
EARTH,
EAT,
EC,
ECO,
EDEKA,
EDU,
EDUCATION,
EE,
EG,
EMAIL,
EMERCK,
ENERGY,
ENGINEER,
ENGINEERING,
ENTERPRISES,
EPOST,
EPSON,
EQUIPMENT,
ER,
ERICSSON,
ERNI,
ES,
ESQ,
ESTATE,
ESURANCE,
ET,
EU,
EUROVISION,
EUS,
EVENTS,
EVERBANK,
EXCHANGE,
EXPERT,
EXPOSED,
EXPRESS,
EXTRASPACE,
FAGE,
FAIL,
FAIRWINDS,
FAITH,
FAMILY,
FAN,
FANS,
FARM,
FARMERS,
FASHION,
FAST,
FEDEX,
FEEDBACK,
FERRARI,
FERRERO,
FI,
FIAT,
FIDELITY,
FIDO,
FILM,
FINAL,
FINANCE,
FINANCIAL,
FIRE,
FIRESTONE,
FIRMDALE,
FISH,
FISHING,
FIT,
FITNESS,
FJ,
FK,
FLICKR,
FLIGHTS,
FLIR,
FLORIST,
FLOWERS,
FLY,
FM,
FO,
FOO,
FOOD,
FOODNETWORK,
FOOTBALL,
FORD,
FOREX,
FORSALE,
FORUM,
FOUNDATION,
FOX,
FR,
FREE,
FRESENIUS,
FRL,
FROGANS,
FRONTDOOR,
FRONTIER,
FTR,
FUJITSU,
FUJIXEROX,
FUN,
FUND,
FURNITURE,
FUTBOL,
FYI,
GA,
GAL,
GALLERY,
GALLO,
GALLUP,
GAME,
GAMES,
GAP,
GARDEN,
GB,
GBIZ,
GD,
GDN,
GE,
GEA,
GENT,
GENTING,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N,
JPRS,
JUEGOS,
JUNIPER,
KAUFEN,
KDDI,
KE,
KERRYHOTELS,
KERRYLOGISTICS,
KERRYPROPERTIES,
KFH,
KG,
KH,
KI,
KIA,
KIM,
KINDER,
KINDLE,
KITCHEN,
KIWI,
KM,
KN,
KOELN,
KOMATSU,
KOSHER,
KP,
KPMG,
KPN,
KR,
KRD,
KRED,
KUOKGROUP,
KW,
KY,
KYOTO,
KZ,
LA,
LACAIXA,
LADBROKES,
LAMBORGHINI,
LAMER,
LANCASTER,
LANCIA,
LANCOME,
LAND,
LANDROVER,
LANXESS,
LASALLE,
LAT,
LATINO,
LATROBE,
LAW,
LAWYER,
LB,
LC,
LDS,
LEASE,
LECLERC,
LEFRAK,
LEGAL,
LEGO,
LEXUS,
LGBT,
LI,
LIAISON,
LIDL,
LIFE,
LIFEINSURANCE,
LIFESTYLE,
LIGHTING,
LIKE,
LILLY,
LIMITED,
LIMO,
LINCOLN,
LINDE,
LINK,
LIPSY,
LIVE,
LIVING,
LIXIL,
LK,
LOAN,
LOANS,
LOCKER,
LOCUS,
LOFT,
LOL,
LONDON,
LOTTE,
LOTTO,
LOVE,
LPL,
LPLFINANCIAL,
LR,
LS,
LT,
LTD,
LTDA,
LU,
LUNDBECK,
LUPIN,
LUXE,
LUXURY,
LV,
LY,
MA,
MACYS,
MADRID,
MAIF,
MAISON,
MAKEUP,
MAN,
MANAGEMENT,
MANGO,
MARKET,
MARKETING,
MARKETS,
MARRIOTT,
MARSHALLS,
MASERATI,
MATTEL,
MBA,
MC,
MCD,
MCDONALDS,
MCKINSEY,
MD,
ME,
MED,
MEDIA,
MEET,
MELBOURNE,
MEME,
MEMORIAL,
MEN,
MENU,
MEO,
METLIFE,
MG,
MH,
MIAMI,
MICROSOFT,
MIL,
MINI,
MINT,
MIT,
MITSUBISHI,
MK,
ML,
MLB,
MLS,
MM,
MMA,
MN,
MO,
MOBI,
MOBILE,
MOBILY,
MODA,
MOE,
MOI,
MOM,
MONASH,
MONEY,
MONST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RODUCTIONS,
PROF,
PROGRESSIVE,
PROMO,
PROPERTIES,
PROPERTY,
PROTECTION,
PRU,
PRUDENTIAL,
PS,
PT,
PUB,
PW,
PWC,
PY,
QA,
QPON,
QUEBEC,
QUEST,
QVC,
RACING,
RADIO,
RAID,
RE,
READ,
REALESTATE,
REALTOR,
REALTY,
RECIPES,
RED,
REDSTONE,
REDUMBRELLA,
REHAB,
REISE,
REISEN,
REIT,
RELIANCE,
REN,
RENT,
RENTALS,
REPAIR,
REPORT,
REPUBLICAN,
REST,
RESTAURANT,
REVIEW,
REVIEWS,
REXROTH,
RICH,
RICHARDLI,
RICOH,
RIGHTATHOME,
RIL,
RIO,
RIP,
RMIT,
RO,
ROCHER,
ROCKS,
RODEO,
ROGERS,
ROOM,
RS,
RSVP,
RU,
RUHR,
RUN,
RW,
RWE,
RYUKYU,
SA,
SAARLAND,
SAFE,
SAFETY,
SAKURA,
SALE,
SALON,
SAMSCLUB,
SAMSUNG,
SANDVIK,
SANDVIKCOROMANT,
SANOFI,
SAP,
SAPO,
SARL,
SAS,
SAVE,
SAXO,
SB,
SBI,
SBS,
SC,
SCA,
SCB,
SCHAEFFLER,
SCHMIDT,
SCHOLARSHIPS,
SCHOOL,
SCHULE,
SCHWARZ,
SCIENCE,
SCJOHNSON,
SCOR,
SCOT,
SD,
SE,
SEAT,
SECURE,
SECURITY,
SEEK,
SELECT,
SENER,
SERVICES,
SES,
SEVEN,
SEW,
SEX,
SEXY,
SFR,
SG,
SH,
SHANGRILA,
SHARP,
SHAW,
SHELL,
SHIA,
SHIKSHA,
SHOES,
SHOP,
SHOPPING,
SHOUJI,
SHOW,
SHOWTIME,
SHRIRAM,
SI,
SILK,
SINA,
SINGLES,
SITE,
SJ,
SK,
SKI,
SKIN,
SKY,
SKYPE,
SL,
SLING,
SM,
SMART,
SMILE,
SN,
SNCF,
SO,
SOCCER,
SOCIAL,
SOFTBANK,
SOFTWARE,
SOHU,
SOLAR,
SOLUTIONS,
SONG,
SONY,
SOY,
SPACE,
SPIEGEL,
SPOT,
SPREADBETTING,
SR,
SRL,
SRT,
ST,
STADA,
STAPLES,
STAR,
STARHUB,
STATEBANK,
STATEFARM,
STATOIL,
STC,
STCGROUP,
STOCKHOLM,
STORAGE,
STORE,
STREAM,
STUDIO,
STUDY,
STYLE,
SU,
SUCKS,
SUPPLIES,
SUPPLY,
SUPPORT,
SURF,
SURGERY,
SUZUKI,
SV,
SWATCH,
SWIFTCOVER,
SWISS,
SX,
SY,
SYDNEY,
SYMANTEC,
SYSTEMS,
SZ,
TAB,
TAIPEI,
TALK,
TAOBAO,
TARGET,
TATAMOTORS,
TATAR,
TATTOO,
TAX,
TAXI,
TC,
TCI,
TD,
TDK,
TEAM,
TECH,
TECHNOLOGY,
TEL,
TELECITY,
TELEFONICA,
TEMASEK,
TENNIS,
TEVA,
TF,
TG,
TH,
THD,
THEATER,
THEATRE,
TIAA,
TICKETS,
TIENDA,
TIFFANY,
TIPS,
TIRES,
TIROL,
TJ,
TJMAXX,
TJX,
TK,
TKMAXX,
TL,
TM,
TMALL,
TN,
TO,
TODAY,
TOKYO,
TOOLS,
TOP,
TORAY,
TOSHIBA,
TOTAL,
TOURS,
TOWN,
TOYOTA,
TOYS,
TR,
TRADE,
TRADING,
TRAINING,
TRAVEL,
TRAVELCHANNEL,
TRAVELERS,
TRAVELERSINSURANCE,
TRUST,
TRV,
TT,
TUBE,
TUI,
TUNES,
TUSHU,
TV,
TVS,
TW,
TZ,
UA,
UBANK,
UBS,
UCONNECT,
UG,
UK,
UNICOM,
UNIVERSITY,
UNO,
UOL,
UPS,
US,
UY,
UZ,
VA,
VACATIONS,
VANA,
VANGUARD,
VC,
VE,
VEGAS,
VENTURES,
VERISIGN,
VERSICHERUNG,
VET,
VG,
VI,
VIAJES,
VIDEO,
VIG,
VIKING,
VILLAS,
VIN,
VIP,
VIRGIN,
VISA,
VISION,
VISTA,
VISTAPRINT,
VIVA,
VIVO,
VLAANDEREN,
VN,
VODKA,
VOLKSWAGEN,
VOLVO,
VOTE,
VOTING,
VOTO,
VOYAGE,
VU,
VUELOS,
WALES,
WALMART,
WALTER,
WANG,
WANGGOU,
WARMAN,
WATCH,
WATCHES,
WEATHER,
WEATHERCHANNEL,
WEBCAM,
WEBER,
WEBSITE,
WED,
WEDDING,
WEIBO,
WEIR,
WF,
WHOSWHO,
WIEN,
WIKI,
WILLIAMHILL,
WIN,
WINDOWS,
WINE,
WINNERS,
WME,
WOLTERSKLUWER,
WOODSIDE,
WORK,
WORKS,
WORLD,
WOW,
WS,
WTC,
WTF,
XBOX,
XEROX,
XFINITY,
XIHUAN,
XIN,
XPERIA,
XXX,
XYZ,
YACHTS,
YAHOO,
YAMAXUN,
YANDEX,
YE,
YODOBASHI,
YOGA,
YOKOHAMA,
YOU,
YOUTUBE,
YT,
YUN,
ZA,
ZAPPOS,
ZARA,
ZERO,
ZIP,
ZIPPO,
ZM,
ZONE,
ZUERICH,
ZW
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy