NodeFacade extends ItemFacade<N, S> implements Node { @Override public final void setPrimaryType(String nodeTypeName) throws RepositoryException { throw new ListenerReadOnlyException(); } NodeFacade(final @NotNull N delegate, final @NotNull SessionFacade<S> session); static @NotNull Node wrap(final @NotNull Node primaryItem, final @NotNull SessionFacade<?> session); static @Nullable Node unwrap(final @Nullable Node node); @Override final Node getNode(String relPath); @Override final NodeIterator getNodes(); @Override final NodeIterator getNodes(String namePattern); @Override final NodeIterator getNodes(String[] nameGlobs); @Override final Property getProperty(String relPath); @Override final PropertyIterator getProperties(); @Override final PropertyIterator getProperties(String namePattern); @Override final PropertyIterator getProperties(String[] nameGlobs); @Override final Item getPrimaryItem(); @SuppressWarnings("deprecation") @Override final String getUUID(); @Override final String getIdentifier(); @Override final int getIndex(); @Override final PropertyIterator getReferences(); @Override final PropertyIterator getReferences(String name); @Override final PropertyIterator getWeakReferences(); @Override final PropertyIterator getWeakReferences(String name); @Override final boolean hasNode(String relPath); @Override final boolean hasProperty(String relPath); @Override final boolean hasNodes(); @Override final boolean hasProperties(); @Override final NodeType getPrimaryNodeType(); @Override final NodeType[] getMixinNodeTypes(); @Override final boolean isNodeType(String nodeTypeName); @Override final boolean canAddMixin(String mixinName); @Override final NodeDefinition getDefinition(); @Override final String getCorrespondingNodePath(String workspaceName); @Override final NodeIterator getSharedSet(); @Override final boolean isCheckedOut(); @SuppressWarnings("deprecation") @Override final VersionHistory getVersionHistory(); @SuppressWarnings("deprecation") @Override final Version getBaseVersion(); @Override @SuppressWarnings("deprecation") final Lock getLock(); @SuppressWarnings("deprecation") @Override final boolean holdsLock(); @Override final boolean isLocked(); @Override final String[] getAllowedLifecycleTransistions(); @Override final Node addNode(String relPath); @Override final Node addNode(String relPath, String primaryNodeTypeName); @Override final void orderBefore(String srcChildRelPath, String destChildRelPath); @Override final Property setProperty(String name, Value value); @Override final Property setProperty(String name, Value value, int type); @Override final Property setProperty(String name, Value[] values); @Override final Property setProperty(String name, Value[] values, int type); @Override final Property setProperty(String name, String[] values); @Override final Property setProperty(String name, String[] values, int type); @Override final Property setProperty(String name, String value); @Override final Property setProperty(String name, String value, int type); @Override final Property setProperty(String name, InputStream value); @Override final Property setProperty(String name, Binary value); @Override final Property setProperty(String name, boolean value); @Override final Property setProperty(String name, double value); @Override final Property setProperty(String name, BigDecimal value); @Override final Property setProperty(String name, long value); @Override final Property setProperty(String name, Calendar value); @Override final Property setProperty(String name, Node value); @Override final void setPrimaryType(String nodeTypeName); @Override final void addMixin(String mixinName); @Override final void removeMixin(String mixinName); @Override final Version checkin(); @Override final void checkout(); @Override final void doneMerge(Version version); @Override final void cancelMerge(Version version); @Override final void update(String srcWorkspace); @Override final NodeIterator merge(String srcWorkspace, boolean bestEffort); @Override final void removeSharedSet(); @Override final void removeShare(); @Override final void restore(String versionName, boolean removeExisting); @Override final void restore(Version version, boolean removeExisting); @Override final void restore(Version version, String relPath, boolean removeExisting); @Override final void restoreByLabel(String versionLabel, boolean removeExisting); @Override final Lock lock(boolean isDeep, boolean isSessionScoped); @Override final void unlock(); @Override final void followLifecycleTransition(String transition);  }
@Test(expected = ListenerReadOnlyException.class) public void testROSetPrimaryType() throws Exception { NodeFacade<Node, Session> facade = getFacade(mock(Node.class)); facade.setPrimaryType(""); }