Author: bcarothers
Date: 2009-12-30 17:08:10 -0500 (Wed, 30 Dec 2009)
New Revision: 1498
Removed:
trunk/docs/examples/gettingstarted/repositories/src/test/resources/log4j.properties
Modified:
trunk/docs/examples/gettingstarted/repositories/pom.xml
trunk/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml
trunk/docs/examples/gettingstarted/repositories/src/main/resources/log4j.properties
trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java
trunk/docs/gettingstarted/src/main/docbook/en-US/content/repository_example.xml
Log:
DNA-464 Add use of file system connector to repositories example
Applied patch that also adds a JPA repository to the example to demonstrate that
connector.
Modified: trunk/docs/examples/gettingstarted/repositories/pom.xml
===================================================================
--- trunk/docs/examples/gettingstarted/repositories/pom.xml 2009-12-30 20:39:18 UTC (rev
1497)
+++ trunk/docs/examples/gettingstarted/repositories/pom.xml 2009-12-30 22:08:10 UTC (rev
1498)
@@ -39,6 +39,16 @@
<artifactId>dna-connector-filesystem</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.dna</groupId>
+ <artifactId>dna-connector-store-jpa</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.2</version>
+ </dependency>
<!--
Logging (require SLF4J API for compiling, but use Log4J and its SLF4J binding for
running)
-->
Modified:
trunk/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml
===================================================================
---
trunk/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml 2009-12-30
20:39:18 UTC (rev 1497)
+++
trunk/docs/examples/gettingstarted/repositories/src/main/resources/configRepository.xml 2009-12-30
22:08:10 UTC (rev 1498)
@@ -36,14 +36,37 @@
-->
<dna:source jcr:name="Cars"
dna:classname="org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource"
dna:retryLimit="3" dna:defaultWorkspaceName="workspace1"/>
<!--
- The 'Aircraft' repository is also an in-memory source with a single
default workspace.
+ The 'Aircraft' repository is also a JPA source (pointing to an in-memory
HSQL database with a single default workspace.
By defining a default workspace, the clients using the Graph API will by default
use that workspace,
but can easily say to use other workspaces (or create, clone, or destroy
workspaces).
+
+ If you wanted to use a JNDI datasource instead of manually specifying the
database login information, you would replace this:
+ dna:driverClassName="org.hsqldb.jdbcDriver"
+ dna:username="sa"
+ dna:password=""
+ dna:url="jdbc:hsqldb:mem:target"
+
+ With this:
+ dna:dataSourceJndiName="your JNDI name"
-->
- <dna:source jcr:name="Aircraft"
dna:classname="org.jboss.dna.graph.connector.inmemory.InMemoryRepositorySource">
- <!-- Define the name of the workspace used by default. Optional, but
convenient. -->
- <defaultWorkspaceName>workspace2</defaultWorkspaceName>
- </dna:source>
+ <dna:source jcr:name="Aircraft"
dna:classname="org.jboss.dna.connector.store.jpa.JpaSource"
+ dna:model="Simple"
+ dna:dialect="org.hibernate.dialect.HSQLDialect"
+ dna:driverClassName="org.hsqldb.jdbcDriver"
+ dna:username="sa"
+ dna:password=""
+ dna:url="jdbc:hsqldb:mem:target"
+ dna:maximumConnectionsInPool="1"
+ dna:referentialIntegrityEnforced="true"
+ dna:largeValueSizeInBytes="10000"
+ dna:retryLimit="3"
+ dna:compressData="false"
+ dna:predefinedWorkspaceNames="workspace2"
+ dna:showSql="false"
+ dna:autoGenerateSchema="create"
+ dna:creatingWorkspacesAllowed="true"
+ dna:defaultWorkspaceName="workspace2" />
+
<!--
The 'UFO' repository is a file system source with a single default
workspace. The file system connector exposes
files and folders as JCR nodes. It can save JCR nodes too, but only if they have
certain primary types.
Modified:
trunk/docs/examples/gettingstarted/repositories/src/main/resources/log4j.properties
===================================================================
---
trunk/docs/examples/gettingstarted/repositories/src/main/resources/log4j.properties 2009-12-30
20:39:18 UTC (rev 1497)
+++
trunk/docs/examples/gettingstarted/repositories/src/main/resources/log4j.properties 2009-12-30
22:08:10 UTC (rev 1498)
@@ -8,6 +8,8 @@
log4j.rootLogger=INFO, stdout
# Set up the default logging to be INFO level, then override specific units
+log4j.logger.org.hibernate=WARN
+log4j.logger.com.mchange=WARN
log4j.logger.org.jboss.dna=INFO
log4j.logger.org.jboss.example.dna=INFO
Modified:
trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java
===================================================================
---
trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java 2009-12-30
20:39:18 UTC (rev 1497)
+++
trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java 2009-12-30
22:08:10 UTC (rev 1498)
@@ -326,7 +326,17 @@
assertThat(client.getNodeInfo("Cars", "/Cars/Sports/Non Existant
Car", properties, children), is(false));
}
+ @Ignore
@Test
+ public void shouldNotFreezeIfWrongNodeEntered() throws Throwable {
+ client.startRepositories();
+
+ Map<String, Object[]> properties = new HashMap<String, Object[]>();
+ List<String> children = new ArrayList<String>();
+ client.getNodeInfo("Vehicles", "/Vehicles/foo", properties,
children);
+ }
+
+ @Test
public void shouldBeAbleToExecuteTestsRepeatedly() throws Throwable {
for (int i = 0; i != 5; ++i) {
// shouldHaveContentFromConfigurationRepository();
Deleted:
trunk/docs/examples/gettingstarted/repositories/src/test/resources/log4j.properties
===================================================================
---
trunk/docs/examples/gettingstarted/repositories/src/test/resources/log4j.properties 2009-12-30
20:39:18 UTC (rev 1497)
+++
trunk/docs/examples/gettingstarted/repositories/src/test/resources/log4j.properties 2009-12-30
22:08:10 UTC (rev 1498)
@@ -1,19 +0,0 @@
-# Direct log messages to stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %m%n
-
-# Root logger option
-log4j.rootLogger=WARNING, stdout
-
-# Set up the default logging to be INFO level, then override specific units
-log4j.logger.org.jboss.dna=ERROR
-log4j.logger.org.jboss.dna.connector.federation=TRACE
-#log4j.logger.org.jboss.dna.repository.sequencers=TRACE
-#log4j.logger.org.jboss.dna.sequencer=DEBUG
-#log4j.logger.org.jboss.dna.connector=TRACE
-#log4j.logger.org.jboss.dna.spi.connector.RepositoryConnectionPool=TRACE
-#log4j.logger.org.jboss.dna.spi=DEBUG
-#log4j.logger.org.jboss.example.dna=TRACE
-
Modified: trunk/docs/gettingstarted/src/main/docbook/en-US/content/repository_example.xml
===================================================================
---
trunk/docs/gettingstarted/src/main/docbook/en-US/content/repository_example.xml 2009-12-30
20:39:18 UTC (rev 1497)
+++
trunk/docs/gettingstarted/src/main/docbook/en-US/content/repository_example.xml 2009-12-30
22:08:10 UTC (rev 1498)
@@ -47,7 +47,8 @@
<title>Repositories used in the example client</title>
<graphic align="center" scale="60"
fileref="example-repositories.png"/>
</figure>
- The "Cars" and "Airplanes" repositories are in-memory repositories
(using the In-Memory repository connector) and the "UFOs" repository is
+ The "Cars" repository is an in-memory repository (using the In-Memory
repository connector), the "Aircraft" repository is a JPA repository
+ (although it points to an in-memory HSQL database using the JPA repository connector),
and the "UFOs" repository is
a file system repository (using the File System repository connector). The federated
"Vehicles" repository
content is federated from the other repositories and cached into the "Cache"
repository. This is shown in the following figure:
<figure id="example-federated-repository">
Show replies by date