### Question:
App { protected String createLocalDbName() { StringBuilder builder = new StringBuilder(); builder.append(src_db); builder.append("-"); String cleanHost = src_host.replaceAll("\\.", "_").toLowerCase(); builder.append(cleanHost); if (src_port > 0 && src_port != 80) { builder.append("-").append(src_port); } builder.append(""); return builder.toString(); } App(String appName, String src_host, String src_db, int src_port, String src_username); void setLocalCouchManager(LocalCouch localCouchManager); void start(); String getSrcReplicationUrl(boolean includeUserDetails); CouchDbConnector getSrcConnector(); static void main(String[] args); static String[] parseUsernamePass(String arg);  }### Answer:
@Test public void createLocalDatabaseNameTest() { App app2 = new App("App Name", "choose.iriscouch.com", "choose", 80, null); String localDbName = app2.createLocalDbName(); assertEquals("choose-choose_iriscouch_com", localDbName); }
@Test public void createLocalDatabaseNameTestPort() { App app2 = new App("App Name", "choose.iriscouch.com", "choose", 5984, null); String localDbName = app2.createLocalDbName(); assertEquals("choose-choose_iriscouch_com-5984", localDbName); }
@Test public void createLocalDatabaseNameLowerCase() { App app2 = new App("App Name", "choose.irisCouch.com", "choose", 5984, null); String localDbName = app2.createLocalDbName(); assertEquals("choose-choose_iriscouch_com-5984", localDbName); }