### Question:
JcrDriver implements java.sql.Driver { protected ConnectionInfo createConnectionInfo( String url, Properties info ) throws SQLException { return RepositoryDelegateFactory.createRepositoryDelegate(url, info, this.contextFactory).getConnectionInfo(); } JcrDriver(); static JcrDriver getInstance(); @Override boolean acceptsURL( String url ); @Override DriverPropertyInfo[] getPropertyInfo( String url,
                                                 Properties info ); @Override Connection connect( String url,
                               Properties info ); @Override int getMajorVersion(); @Override int getMinorVersion(); String getVendorName(); String getVendorUrl(); String getVersion(); @Override boolean jdbcCompliant(); void setContextFactory( JcrContextFactory factory ); static final String WORKSPACE_PROPERTY_NAME; static final String REPOSITORY_PROPERTY_NAME; static final String USERNAME_PROPERTY_NAME; static final String PASSWORD_PROPERTY_NAME; static final String TEIID_SUPPORT_PROPERTY_NAME; static final String JNDI_URL_PREFIX; static final String HTTP_URL_PREFIX; public JcrContextFactory contextFactory; }### Answer:
@Test public void shouldCreateConnectionInfoForUrlWithEscapedCharacters() throws SQLException{ validUrl = JcrDriver.JNDI_URL_PREFIX + "java:nameInJndi?workspace=My%20Workspace&user=j%20smith&password=secret&repositoryName=My%20Repository&teiidsupport=true"; ConnectionInfo info = driver.createConnectionInfo(validUrl, validProperties); assertThat(info.getWorkspaceName(), is("My Workspace")); assertThat(info.getUsername(), is("j smith")); assertThat(info.getPassword(), is("secret".toCharArray())); assertThat(info.getRepositoryName(), is("My Repository")); assertThat(info.isTeiidSupport(), is(Boolean.TRUE.booleanValue())); }
@Test public void shouldCreateConnectionInfoButIndicateNoTeiidSupport() throws SQLException{ validUrl = JcrDriver.JNDI_URL_PREFIX + "java:nameInJndi?workspace=My%20Workspace&user=j%20smith&password=secret&repositoryName=My%20Repository"; ConnectionInfo info = driver.createConnectionInfo(validUrl, validProperties); assertThat(info.isTeiidSupport(), is(Boolean.FALSE.booleanValue())); }