Skip to content

Commit

Permalink
Merge branch 'MODE-1212' of https://github.com/bcarothers/modeshape i…
Browse files Browse the repository at this point in the history
…nto bcarothers-MODE-1212
  • Loading branch information
rhauch committed Jul 9, 2011
2 parents cd6369f + 93ee324 commit a53b8d6
Show file tree
Hide file tree
Showing 26 changed files with 289 additions and 517 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
import org.modeshape.common.util.FileUtil;
import org.modeshape.graph.ExecutionContext;
import org.modeshape.graph.Graph;
import org.modeshape.graph.Subgraph;
import org.modeshape.graph.connector.RepositoryConnectionFactory;
import org.modeshape.graph.connector.RepositoryContext;
import org.modeshape.graph.observe.Observer;
import org.modeshape.graph.connector.MockRepositoryContext;

public class DiskConnectorDiscoverWorkspacesTest {

Expand All @@ -39,29 +36,7 @@ private Graph graphForNewSource() throws Exception {
source.setName("Disk Source");
source.setLargeValueSizeInBytes(LARGE_VALUE_THRESHOLD);
source.setRepositoryRootPath(REPO_ROOT_PATH);
source.initialize(new RepositoryContext() {

@Override
public Subgraph getConfiguration( int depth ) {
return null;
}

@Override
public ExecutionContext getExecutionContext() {
return context;
}

@Override
public Observer getObserver() {
return null;
}

@Override
public RepositoryConnectionFactory getRepositoryConnectionFactory() {
return null;
}

});
source.initialize(new MockRepositoryContext(context));

return Graph.create(source, context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
import org.modeshape.graph.ExecutionContext;
import org.modeshape.graph.Graph;
import org.modeshape.graph.Node;
import org.modeshape.graph.Subgraph;
import org.modeshape.graph.connector.RepositoryConnectionFactory;
import org.modeshape.graph.connector.RepositoryContext;
import org.modeshape.graph.observe.Observer;
import org.modeshape.graph.connector.MockRepositoryContext;
import org.modeshape.graph.property.Binary;
import org.modeshape.graph.property.BinaryFactory;
import org.modeshape.graph.property.basic.FileSystemBinary;
Expand Down Expand Up @@ -55,29 +52,7 @@ public void beforeEach() {
source.setName("Disk Source");
source.setLargeValueSizeInBytes(LARGE_VALUE_THRESHOLD);
source.setRepositoryRootPath(REPO_ROOT_PATH);
source.initialize(new RepositoryContext() {

@Override
public Subgraph getConfiguration( int depth ) {
return null;
}

@Override
public ExecutionContext getExecutionContext() {
return context;
}

@Override
public Observer getObserver() {
return null;
}

@Override
public RepositoryConnectionFactory getRepositoryConnectionFactory() {
return null;
}

});
source.initialize(new MockRepositoryContext(context));

largeValuePath = new File(repoRootPath, source.getLargeValuePath());

Expand Down Expand Up @@ -401,30 +376,7 @@ public void shouldAllowNestedLargeValuesPath() {
source.setLargeValueSizeInBytes(LARGE_VALUE_THRESHOLD);
source.setRepositoryRootPath(REPO_ROOT_PATH);
source.setLargeValuePath("large/values");

source.initialize(new RepositoryContext() {

@Override
public Subgraph getConfiguration( int depth ) {
return null;
}

@Override
public ExecutionContext getExecutionContext() {
return context;
}

@Override
public Observer getObserver() {
return null;
}

@Override
public RepositoryConnectionFactory getRepositoryConnectionFactory() {
return null;
}

});
source.initialize(new MockRepositoryContext(context));

graph = Graph.create(source, context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@
import org.junit.Before;
import org.junit.Test;
import org.modeshape.graph.ExecutionContext;
import org.modeshape.graph.Subgraph;
import org.modeshape.graph.connector.MockRepositoryContext;
import org.modeshape.graph.connector.RepositoryConnection;
import org.modeshape.graph.connector.RepositoryConnectionFactory;
import org.modeshape.graph.connector.RepositoryContext;
import org.modeshape.graph.connector.RepositorySourceException;
import org.modeshape.graph.observe.Observer;

/**
* @author Randall Hauch
Expand All @@ -55,37 +52,7 @@ public void beforeEach() throws Exception {
// Set the mandatory properties ...
this.source.setName("Test Repository");
this.source.setWorkspaceRootPath("target");
this.source.initialize(new RepositoryContext() {

@Override
public Subgraph getConfiguration( int depth ) {
return null;
}

@Override
public ExecutionContext getExecutionContext() {
return context;
}

@Override
public Observer getObserver() {
return null;
}

@Override
public RepositoryConnectionFactory getRepositoryConnectionFactory() {
return new RepositoryConnectionFactory() {

@Override
@SuppressWarnings( "synthetic-access" )
public RepositoryConnection createConnection( String sourceName ) throws RepositorySourceException {
return source.getConnection();
}

};
}

});
this.source.initialize(new MockRepositoryContext(context, source));
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@
import org.modeshape.graph.ExecutionContext;
import org.modeshape.graph.Graph;
import org.modeshape.graph.Node;
import org.modeshape.graph.Subgraph;
import org.modeshape.graph.Workspace;
import org.modeshape.graph.connector.RepositoryConnection;
import org.modeshape.graph.connector.RepositoryConnectionFactory;
import org.modeshape.graph.connector.MockRepositoryContext;
import org.modeshape.graph.connector.RepositoryContext;
import org.modeshape.graph.connector.RepositorySource;
import org.modeshape.graph.connector.RepositorySourceException;
import org.modeshape.graph.observe.Observer;
import org.modeshape.graph.property.PathNotFoundException;

/*
Expand Down Expand Up @@ -214,36 +210,6 @@ public void shouldDistributeGraphNodesUsingDynamicallyCreatedWorkspaces() {
}

private final RepositoryContext repositoryContextFor( final RepositorySource source ) {
return new RepositoryContext() {

@Override
public Subgraph getConfiguration( int depth ) {
return null;
}

@SuppressWarnings( "synthetic-access" )
@Override
public ExecutionContext getExecutionContext() {
return context;
}

@Override
public Observer getObserver() {
return null;
}

@Override
public RepositoryConnectionFactory getRepositoryConnectionFactory() {
return new RepositoryConnectionFactory() {

@Override
public RepositoryConnection createConnection( String sourceName ) throws RepositorySourceException {
return source.getConnection();
}

};
}

};
return new MockRepositoryContext(context, source);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.modeshape.graph.ExecutionContext;
import org.modeshape.graph.Subgraph;
import org.modeshape.graph.connector.MockRepositoryContext;
import org.modeshape.graph.connector.RepositoryConnection;
import org.modeshape.graph.connector.RepositoryConnectionFactory;
import org.modeshape.graph.connector.RepositoryContext;
import org.modeshape.graph.connector.RepositorySourceException;
import org.modeshape.graph.observe.Observer;

public class JcrRepositorySourceTest {

Expand Down Expand Up @@ -71,37 +68,7 @@ public void beforeEach() throws Exception {
this.source.setRepositoryJndiName(validRepositoryJndiName);

// Initialize ...
this.source.initialize(new RepositoryContext() {

@Override
public Subgraph getConfiguration( int depth ) {
return null;
}

@Override
public ExecutionContext getExecutionContext() {
return context;
}

@Override
public Observer getObserver() {
return null;
}

@Override
public RepositoryConnectionFactory getRepositoryConnectionFactory() {
return new RepositoryConnectionFactory() {

@Override
@SuppressWarnings( "synthetic-access" )
public RepositoryConnection createConnection( String sourceName ) throws RepositorySourceException {
return source.getConnection();
}

};
}

});
this.source.initialize(new MockRepositoryContext(context, source));
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@
import org.junit.Before;
import org.junit.Test;
import org.modeshape.connector.store.jpa.JpaSource;
import org.modeshape.graph.ExecutionContext;
import org.modeshape.graph.Subgraph;
import org.modeshape.graph.connector.MockRepositoryContext;
import org.modeshape.graph.connector.RepositoryConnection;
import org.modeshape.graph.connector.RepositoryConnectionFactory;
import org.modeshape.graph.connector.RepositoryContext;
import org.modeshape.graph.observe.Observer;

public class SimpleJpaSourceTest {

Expand All @@ -53,31 +49,7 @@ public void beforeEach() {
source.setShowSql(false);
source.setAutoGenerateSchema("create");

source.initialize(new RepositoryContext() {

private final ExecutionContext context = new ExecutionContext();

@Override
public Subgraph getConfiguration( int depth ) {
return null;
}

@Override
public ExecutionContext getExecutionContext() {
return context;
}

@Override
public Observer getObserver() {
return null;
}

@Override
public RepositoryConnectionFactory getRepositoryConnectionFactory() {
return null;
}

});
source.initialize(new MockRepositoryContext());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@
import org.modeshape.graph.Graph;
import org.modeshape.graph.Location;
import org.modeshape.graph.Node;
import org.modeshape.graph.Subgraph;
import org.modeshape.graph.connector.RepositoryConnection;
import org.modeshape.graph.connector.RepositoryConnectionFactory;
import org.modeshape.graph.connector.RepositoryContext;
import org.modeshape.graph.connector.RepositorySourceException;
import org.modeshape.graph.observe.Observer;
import org.modeshape.graph.connector.MockRepositoryContext;
import org.modeshape.graph.property.Name;
import org.modeshape.graph.property.Property;

Expand Down Expand Up @@ -79,37 +74,7 @@ public void beforeEach() {
source.setPassword("");
}

source.initialize(new RepositoryContext() {

@Override
public Subgraph getConfiguration( int depth ) {
return null;
}

@Override
@SuppressWarnings( "synthetic-access" )
public ExecutionContext getExecutionContext() {
return context;
}

@Override
public Observer getObserver() {
return null;
}

@Override
public RepositoryConnectionFactory getRepositoryConnectionFactory() {
return new RepositoryConnectionFactory() {

@Override
public RepositoryConnection createConnection( String sourceName ) throws RepositorySourceException {
return null;
}

};
}

});
source.initialize(new MockRepositoryContext(context));
}

@Test
Expand Down
Loading

0 comments on commit a53b8d6

Please sign in to comment.