DbToolContextComponentFactory extends AbstractComponentFactory { static final String getMSSQLCatalog(final String jdbcUrl) { if (!jdbcUrl.contains(MSSQL_DB_PROP)) { throw new OpenGammaRuntimeException(String.format("MSSQL url must contain %s: %s", MSSQL_DB_PROP, jdbcUrl)); } String[] fragments = jdbcUrl.split(MSSQL_DELIMITER); String catalog = null; for (String fragment : fragments) { if (fragment.startsWith(MSSQL_DB_PROP)) { catalog = fragment.substring(fragment.indexOf(MSSQL_DB_PROP) + MSSQL_DB_PROP.length()); } } if (catalog == null || catalog.isEmpty()) { throw new OpenGammaRuntimeException(String.format("%s is null: %s", MSSQL_DB_PROP, jdbcUrl)); } return catalog; }  @Override void init(ComponentRepository repo, LinkedHashMap<String, String> configuration); static DbToolContextComponentFactory.Meta meta(); @Override DbToolContextComponentFactory.Meta metaBean(); String getClassifier(); void setClassifier(String classifier); final Property<String> classifier(); DbConnector getDbConnector(); void setDbConnector(DbConnector dbConnector); final Property<DbConnector> dbConnector(); String getJdbcUrl(); void setJdbcUrl(String jdbcUrl); final Property<String> jdbcUrl(); String getSchema(); void setSchema(String schema); final Property<String> schema(); DbManagement getDbManagement(); void setDbManagement(DbManagement dbManagement); final Property<DbManagement> dbManagement(); String getSchemaNamesList(); void setSchemaNamesList(String schemaNamesList); final Property<String> schemaNamesList(); @Override DbToolContextComponentFactory clone(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test(expectedExceptions = OpenGammaRuntimeException.class) public void test_noInvalidSlash() { getMSSQLCatalog(MSSQL_BAD_INVALID_SLASH); }
@Test(expectedExceptions = OpenGammaRuntimeException.class) public void test_noDbName() { getMSSQLCatalog(MSSQL_BAD_NO_DB_NAME); }
@Test(expectedExceptions = OpenGammaRuntimeException.class) public void test_noDbAtAll() { getMSSQLCatalog(MSSQL_BAD_NO_DB_ATALL); }