JcrSession implements org.modeshape.jcr.api.Session { @Override public String getNamespaceURI( String prefix ) throws RepositoryException { checkLive(); return sessionRegistry.getURI(prefix); } protected  JcrSession( JcrRepository repository,
                          String workspaceName,
                          ExecutionContext context,
                          Map<String, Object> sessionAttributes,
                          boolean readOnly ); protected  JcrSession( JcrSession original,
                          boolean readOnly ); final boolean isReadOnly(); @Override JcrRepository getRepository(); @Override String getUserID(); boolean isAnonymous(); @Override String[] getAttributeNames(); @Override Object getAttribute( String name ); @Override JcrWorkspace getWorkspace(); @Override JcrRootNode getRootNode(); @Override Session impersonate( Credentials credentials ); @Deprecated @Override AbstractJcrNode getNodeByUUID( String uuid ); @Override AbstractJcrNode getNodeByIdentifier( String id ); AbstractJcrNode getNonSystemNodeByIdentifier( String id ); @Override AbstractJcrNode getNode( String absPath ); @Override AbstractJcrItem getItem( String absPath ); @Override Property getProperty( String absPath ); @Override boolean itemExists( String absPath ); @Override void removeItem( String absPath ); @Override boolean nodeExists( String absPath ); @Override boolean propertyExists( String absPath ); @Override void move( String srcAbsPath,
                      String destAbsPath ); @Override void save(); @Override void refresh( boolean keepChanges ); @Override boolean hasPendingChanges(); @Override JcrValueFactory getValueFactory(); @Override ValueFactory getValueFactory( String binaryStoreHint ); @Override void checkPermission( String path,
                                 String actions ); @Override boolean hasPermission( String absPath,
                                  String actions ); @Override boolean hasCapability( String methodName,
                                  Object target,
                                  Object[] arguments ); @Override ContentHandler getImportContentHandler( String parentAbsPath,
                                                   int uuidBehavior ); @Override ContentHandler getImportContentHandler( String parentAbsPath, int uuidBehavior,
                                                    String binaryStoreHint ); @Override void importXML( String parentAbsPath,
                           InputStream in,
                           int uuidBehavior ); @Override void importXML( String parentAbsPath,
                           InputStream in,
                           int uuidBehavior,
                           String binaryStoreHint ); @Override void exportSystemView( String absPath,
                                  ContentHandler contentHandler,
                                  boolean skipBinary,
                                  boolean noRecurse ); @Override void exportSystemView( String absPath,
                                  OutputStream out,
                                  boolean skipBinary,
                                  boolean noRecurse ); @Override void exportDocumentView( String absPath,
                                    ContentHandler contentHandler,
                                    boolean skipBinary,
                                    boolean noRecurse ); @Override void exportDocumentView( String absPath,
                                    OutputStream out,
                                    boolean skipBinary,
                                    boolean noRecurse ); @Override String getNamespacePrefix( String uri ); @Override String[] getNamespacePrefixes(); @Override String getNamespaceURI( String prefix ); @Override void setNamespacePrefix( String newPrefix,
                                    String existingUri ); @Override synchronized void logout(); @Override boolean isLive(); @Override @SuppressWarnings("deprecation") void addLockToken( String lockToken ); @Override @SuppressWarnings("deprecation") String[] getLockTokens(); @Override @SuppressWarnings("deprecation") void removeLockToken( String lockToken ); @Override AccessControlManager getAccessControlManager(); @Override RetentionManager getRetentionManager(); static NodeKey createNodeKeyFromIdentifier( String identifier,
                                                       NodeKey rootKey ); static boolean isForeignKey( NodeKey key,
                                        NodeKey rootKey ); static String nodeIdentifier( NodeKey key,
                                         NodeKey rootKey ); @Override boolean sequence( String sequencerName,
                             Property inputProperty,
                             Node outputNode ); @Override String toString(); @Override String decode( final String localName ); @Override String encode( final String localName );  }
@Test( expected = IllegalArgumentException.class ) public void shouldNotAllowNoNamespacePrefix() throws Exception { session.getNamespaceURI(null); }
@Test( expected = NamespaceException.class ) public void shouldNotProvideUriForUnknownPrefix() throws Exception { session.getNamespaceURI("bogus"); }
@Test public void shouldProvideNamespaceUri() throws Exception { assertThat(session.getNamespaceURI("mode"), is("http: assertThat(session.getNamespaceURI("jcr"), is("http: assertThat(session.getNamespaceURI("mix"), is("http: assertThat(session.getNamespaceURI("nt"), is("http: assertThat(session.getNamespaceURI("sv"), is("http: }