JcrRepository implements org.modeshape.jcr.api.Repository { @Override public String getDescriptor( String key ) { if (key == null) return null; if (!isSingleValueDescriptor(key)) return null; JcrValue value = (JcrValue)descriptors.get(key); try { return value.getString(); } catch (RepositoryException re) { throw new IllegalStateException(re); } } protected  JcrRepository( RepositoryConfiguration configuration ); State getState(); @Override String getName(); @Override int getActiveSessionsCount(); RepositoryStatistics getRepositoryStatistics(); Problems getStartupProblems(); Transactions transactions(); RepositoryConfiguration getConfiguration(); @Override String getDescriptor( String key ); @Override JcrValue getDescriptorValue( String key ); @Override JcrValue[] getDescriptorValues( String key ); @Override boolean isSingleValueDescriptor( String key ); @Override boolean isStandardDescriptor( String key ); @Override String[] getDescriptorKeys(); @Override synchronized JcrSession login(); @Override synchronized JcrSession login( Credentials credentials ); @Override synchronized JcrSession login( String workspaceName ); @Override synchronized JcrSession login( final Credentials credentials,
                                          String workspaceName );  }
@Test public void shouldReturnNullForNullDescriptorKey() { assertThat(repository.getDescriptor(null), is(nullValue())); }
@Test public void shouldReturnNullForEmptyDescriptorKey() { assertThat(repository.getDescriptor(""), is(nullValue())); }
@Test public void shouldReturnNullWhenDescriptorKeyIsNull() { assertThat(repository.getDescriptor(null), is(nullValue())); }
@Test public void shouldNotAllowEmptyDescriptorKey() { assertThat(repository.getDescriptor(""), is(nullValue())); }
@Test public void shouldNotProvideRepositoryWorkspaceNamesDescriptorIfOptionSetToFalse() throws Exception { assertThat(repository.getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_WORKSPACES), is(nullValue())); }