DocumentNodeStore implements NodeStore, RevisionContext, Observable, Clusterable, NodeStateDiffer { void setEnableConcurrentAddRemove(boolean b) { enableConcurrentAddRemove = b; } DocumentNodeStore(DocumentNodeStoreBuilder<?> builder); void dispose(); @NotNull DocumentStore getDocumentStore(); void setAsyncDelay(int delay); int getAsyncDelay(); void setMaxBackOffMillis(int time); int getMaxBackOffMillis(); int getChangeSetMaxItems(); void setChangeSetMaxItems(int changeSetMaxItems); int getChangeSetMaxDepth(); void setChangeSetMaxDepth(int changeSetMaxDepth); @NotNull ClusterNodeInfo getClusterInfo(); CacheStats getNodeCacheStats(); CacheStats getNodeChildrenCacheStats(); @NotNull Iterable<CacheStats> getDiffCacheStats(); Cache<PathRev, DocumentNodeState> getNodeCache(); Cache<NamePathRev, DocumentNodeState.Children> getNodeChildrenCache(); Predicate<Path> getNodeCachePredicate(); int getPendingWriteCount(); boolean isDisableBranches(); @NotNull PropertyState createPropertyState(String name, String value); @Nullable DocumentNodeState getNode(@NotNull final Path path,
                                     @NotNull final RevisionVector rev); BundlingConfigHandler getBundlingConfigHandler(); @Override boolean compare(@NotNull final AbstractDocumentNodeState node,
                           @NotNull final AbstractDocumentNodeState base,
                           @NotNull NodeStateDiff diff); @Override Closeable addObserver(Observer observer); @NotNull @Override DocumentNodeState getRoot(); @NotNull @Override NodeState merge(@NotNull NodeBuilder builder,
                           @NotNull CommitHook commitHook,
                           @NotNull CommitInfo info); @NotNull @Override NodeState rebase(@NotNull NodeBuilder builder); @Override NodeState reset(@NotNull NodeBuilder builder); @Override @NotNull BlobStoreBlob createBlob(InputStream inputStream); @Override Blob getBlob(@NotNull String reference); Blob getBlobFromBlobId(String blobId); @NotNull @Override String checkpoint(long lifetime, @NotNull Map<String, String> properties); @NotNull @Override String checkpoint(long lifetime); @NotNull @Override Map<String, String> checkpointInfo(@NotNull String checkpoint); @NotNull @Override Iterable<String> checkpoints(); @Nullable @Override NodeState retrieve(@NotNull String checkpoint); @Override boolean release(@NotNull String checkpoint); @Override UnmergedBranches getBranches(); @Override UnsavedModifications getPendingModifications(); @Override int getClusterId(); @Override @NotNull RevisionVector getHeadRevision(); @Override @NotNull Revision newRevision(); @Override @NotNull Clock getClock(); @Override String getCommitValue(@NotNull Revision changeRevision,
                                 @NotNull NodeDocument doc); void runBackgroundOperations(); @Nullable MarkSweepGarbageCollector createBlobGarbageCollector(long blobGcMaxAgeInSecs, String repositoryId,
        Whiteboard whiteboard, StatisticsProvider statisticsProvider); DocumentNodeStoreMBean getMBean(); BlobStore getBlobStore(); Iterator<ReferencedBlob> getReferencedBlobsIterator(); DiffCache getDiffCache(); Checkpoints getCheckpoints(); @NotNull VersionGarbageCollector getVersionGarbageCollector(); @NotNull JournalGarbageCollector getJournalGarbageCollector(); @NotNull LastRevRecoveryAgent getLastRevRecoveryAgent(); @Override String getInstanceId(); @Override String getVisibilityToken(); @Override boolean isVisible(@NotNull String visibilityToken, long maxWaitMillis); DocumentNodeStoreStatsCollector getStatsCollector(); DocumentNodeStateCache getNodeStateCache(); void setNodeStateCache(DocumentNodeStateCache nodeStateCache); JournalPropertyHandlerFactory getJournalPropertyHandlerFactory(); static final FormatVersion VERSION; static final List<String> META_PROP_NAMES; static final String SYS_PROP_DISABLE_JOURNAL; }
@Test public void mergeAddAddEmptyInternalDoc() throws Exception { final DocumentNodeStore store = builderProvider.newBuilder().getNodeStore(); store.setEnableConcurrentAddRemove(true); SingleInstanceConflictUtility.generateConflict(store, new String[]{":1", ":a"}, new String[]{}, new String[]{":2", ":b"}, new String[]{}, new String[]{":3", ":a", ":b"}, new String[]{}, true, "Add-add merge conflicts for internal docs should be resolvable"); }
@Test public void mergeAddAddNonEmptyInternalDocShouldFail() throws Exception { final DocumentNodeStore store = builderProvider.newBuilder().getNodeStore(); store.setEnableConcurrentAddRemove(true); SingleInstanceConflictUtility.generateConflict(store, new String[]{":1", ":a"}, new String[]{}, true, new String[]{":2", ":b"}, new String[]{}, true, new String[]{":3", ":a", ":b"}, new String[]{}, false, false, "Add-add merge conflicts for non empty internal docs should fail"); }
@Test public void mergeAddAddNormalDocShouldFail() throws Exception { final DocumentNodeStore store = builderProvider.newBuilder().getNodeStore(); store.setEnableConcurrentAddRemove(true); SingleInstanceConflictUtility.generateConflict(store, new String[]{":1", "a"}, new String[]{}, new String[]{":2", "b"}, new String[]{}, new String[]{":3", "a", "b"}, new String[]{}, false, "Add-add merge conflicts for normal docs should fail"); }