本文整理了Java中org.modeshape.jcr.RepositoryConfiguration.<init>
方法的一些代码示例,展示了RepositoryConfiguration.<init>
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RepositoryConfiguration.<init>
方法的具体详情如下:
包路径:org.modeshape.jcr.RepositoryConfiguration
类名称:RepositoryConfiguration
方法名:<init>
暂无
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Create a copy of this configuration that uses the supplied environment.
*
* @param environment the environment that should be used for the repository; may be null
* @return the new configuration; never null
*/
public RepositoryConfiguration with( Environment environment ) {
return new RepositoryConfiguration(doc.clone(), docName, environment);
}
代码示例来源:origin: org.fcrepo/modeshape-jcr
/**
* Create a copy of this configuration that uses the supplied document name.
*
* @param docName the new document name; may be null
* @return the new configuration; never null
*/
public RepositoryConfiguration withName( String docName ) {
return new RepositoryConfiguration(doc.clone(), docName, environment);
}
代码示例来源:origin: ModeShape/modeshape
/**
* Create a copy of this configuration that uses the supplied environment.
*
* @param environment the environment that should be used for the repository; may be null
* @return the new configuration; never null
*/
public RepositoryConfiguration with( Environment environment ) {
return new RepositoryConfiguration(doc.clone(), docName, environment);
}
代码示例来源:origin: ModeShape/modeshape
/**
* Create a copy of this configuration that uses the supplied document name.
*
* @param docName the new document name; may be null
* @return the new configuration; never null
*/
public RepositoryConfiguration withName( String docName ) {
return new RepositoryConfiguration(doc.clone(), docName, environment);
}
代码示例来源:origin: ModeShape/modeshape
/**
* Resolve the supplied URL to a JSON document, read the contents, and parse into a {@link RepositoryConfiguration}.
*
* @param url the URL; may not be null
* @return the parsed repository configuration; never null
* @throws ParsingException if the content could not be parsed as a valid JSON document
*/
public static RepositoryConfiguration read( URL url ) throws ParsingException {
CheckArg.isNotNull(url, "url");
Document doc = Json.read(url);
return new RepositoryConfiguration(doc, withoutExtension(url.getFile()));
}
代码示例来源:origin: ModeShape/modeshape
public static JcrRepository startClusteredRepositoryWithConfig(String configFile, String clusterNodeId) throws Exception {
URL configUrl = TestingUtil.class.getClassLoader().getResource(configFile);
Assert.assertNotNull(configFile + " not found", configFile);
Properties properties = new Properties();
properties.put("clusterNode", clusterNodeId);
Document configDoc = Json.read(configUrl).withVariablesReplaced(properties);
JcrRepository repository = new JcrRepository(new RepositoryConfiguration(configDoc, configFile));
repository.start();
Thread.sleep(200);
return repository;
}
代码示例来源:origin: ModeShape/modeshape
@Before
public void beforeEach() throws Exception {
repository = new JcrRepository(new RepositoryConfiguration("repoName", new TestingEnvironment()));
repository.start();
print = false;
}
代码示例来源:origin: ModeShape/modeshape
@Test
public void shouldAlwaysReturnNonNullSecurityComponent() {
RepositoryConfiguration config = new RepositoryConfiguration("repoName");
assertThat(config.getSecurity(), is(notNullValue()));
}
代码示例来源:origin: ModeShape/modeshape
protected static void startRepository( RepositoryConfiguration configuration ) throws Exception {
TestingEnvironment environment = new TestingEnvironment();
RepositoryConfiguration config = configuration != null ?
new RepositoryConfiguration(configuration.getDocument(), configuration.getName(),
environment) :
new RepositoryConfiguration(REPO_NAME, environment);
repository = new JcrRepository(config);
repository.start();
session = repository.login();
}
代码示例来源:origin: ModeShape/modeshape
@Test
public void shouldAlwaysReturnNonNullSequencingComponent() {
RepositoryConfiguration config = new RepositoryConfiguration("repoName");
assertThat(config.getSequencing(), is(notNullValue()));
}
代码示例来源:origin: ModeShape/modeshape
@Test
public void shouldNotConfigureJaasByDefault() {
RepositoryConfiguration config = new RepositoryConfiguration("repoName");
Security security = config.getSecurity();
JaasSecurity jaas = security.getJaas();
assertThat(jaas, is(nullValue()));
}
代码示例来源:origin: ModeShape/modeshape
@FixFor( "MODE-2160" )
@Test
public void shouldAlwaysReturnNonNullIndexesComponentForNoIndexes() {
RepositoryConfiguration config = new RepositoryConfiguration("repoName");
assertThat(config.getIndexes(), is(notNullValue()));
}
代码示例来源:origin: ModeShape/modeshape
@Test
public void shouldConfigureAnonymousByDefault() {
RepositoryConfiguration config = new RepositoryConfiguration("repoName");
Security security = config.getSecurity();
AnonymousSecurity anon = security.getAnonymous();
assertThat(anon, is(notNullValue()));
assertThat(anon.getAnonymousUsername(), is(RepositoryConfiguration.Default.ANONYMOUS_USERNAME));
assertThat(anon.getAnonymousRoles(), is(RepositoryConfiguration.Default.ANONYMOUS_ROLES));
}
代码示例来源:origin: ModeShape/modeshape
@Test( expected = ConfigurationException.class )
public void shouldFailToDeployRepositoryConfigurationWithoutName() throws Throwable {
config = new RepositoryConfiguration(); // without a name!
assertThat(config.validate().hasErrors(), is(true));
engine.start();
engine.deploy(config);
}
代码示例来源:origin: ModeShape/modeshape
@FixFor( "MODE-1988" )
@Test
public void shouldEnableDocumentOptimizationWithEmptyDocumentOptimizationField() {
Document doc = Schematic.newDocument(FieldName.NAME, "repoName", FieldName.STORAGE,
Schematic.newDocument(FieldName.DOCUMENT_OPTIMIZATION, Schematic.newDocument()));
RepositoryConfiguration config = new RepositoryConfiguration(doc, "repoName");
DocumentOptimization opt = config.getDocumentOptimization();
assertThat(opt, is(notNullValue()));
assertThat(opt.isEnabled(), is(false));
}
代码示例来源:origin: ModeShape/modeshape
@FixFor( "MODE-1988" )
@Test
public void shouldDisableDocumentOptimizationWithoutValidChildCountTargetValue() {
Document docOpt = Schematic.newDocument(FieldName.OPTIMIZATION_CHILD_COUNT_TOLERANCE, 10);
Document doc = Schematic.newDocument(FieldName.NAME, "repoName", FieldName.STORAGE,
Schematic.newDocument(FieldName.DOCUMENT_OPTIMIZATION, docOpt));
RepositoryConfiguration config = new RepositoryConfiguration(doc, "repoName");
DocumentOptimization opt = config.getDocumentOptimization();
assertThat(opt, is(notNullValue()));
assertThat(opt.isEnabled(), is(false));
}
代码示例来源:origin: ModeShape/modeshape
@Test
@FixFor( "MODE-2556" )
public void journalShouldBeDisabledIfConfigurationSectionIsMissing() {
Document doc = Schematic.newDocument(FieldName.NAME, "repoName");
RepositoryConfiguration config = new RepositoryConfiguration(doc, "repoName");
assertFalse(config.getJournaling().isEnabled());
}
代码示例来源:origin: ModeShape/modeshape
@Override
protected void startRepositoryWithConfiguration( Document doc ) throws Exception {
stopRepository();
RepositoryConfiguration config = new RepositoryConfiguration(doc, REPO_NAME).with(new TestingEnvironment());
repository = new JcrRepository(config);
repository.start();
session = repository.login();
rootNode = session.getRootNode();
addSequencingListeners(session);
}
代码示例来源:origin: ModeShape/modeshape
@Before
public void beforeEach() throws Exception {
config = new RepositoryConfiguration("repoName").with(new TestingEnvironment());
repository = new JcrRepository(config);
repository.start();
SessionCache systemCache = repository.createSystemSession(repository.runningState().context(), false);
system = new SystemContent(systemCache);
}
代码示例来源:origin: ModeShape/modeshape
@Before
public void beforeEach() throws Exception {
config = new RepositoryConfiguration("repoName").with(new TestingEnvironment());
repository = new JcrRepository(config);
repository.start();
context = repository.runningState().context();
repoTypeManager = repository.nodeTypeManager();
session = repository.login();
}
内容来源于网络,如有侵权,请联系作者删除!