[dna-issues] [JBoss JIRA] Commented: (DNA-461) new item in source doesn't appear in federated source projection
Luiz Fernando Teston (JIRA)
jira-events at lists.jboss.org
Wed Jun 17 10:15:56 EDT 2009
[ https://jira.jboss.org/jira/browse/DNA-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12472522#action_12472522 ]
Luiz Fernando Teston commented on DNA-461:
------------------------------------------
I did that also and it didn't work. I did that changes:
Graph carsGraph = engine.getGraph("Cars");
carsGraph.create("/Cars"); // if I don't create this node I got an exception on next line saying that could not find Cars path.
carsGraph.create("/Cars/Honda");
assertThat(carsGraph.getNodeAt("/Cars/Honda"), is(notNullValue()));
Graph vehiclesGraph = engine.getGraph("Vehicles");
assertThat(vehiclesGraph.getNodeAt("/Vehicles/Cars/Honda"), is(notNullValue()));
On the last line I got an exception saying that this path could not be found. I also did this test with "/Cars/Honda" on assertion line.
> new item in source doesn't appear in federated source projection
> -----------------------------------------------------------------
>
> Key: DNA-461
> URL: https://jira.jboss.org/jira/browse/DNA-461
> Project: DNA
> Issue Type: Bug
> Components: Connectors, Examples, Federation
> Affects Versions: 0.5
> Environment: Mac OS 10.5.7 with JVM 1.6 and maven 2.1
> Reporter: Luiz Fernando Teston
>
> I'm not sure if it is a bug or an error in my configuration or environment. I just follow the examples without getting the CNDs and also without importing the example data. When I create some new item using the graph api this item is created in a correct way on the repository source that I'm using (example: cars) but it doesn't appears on the projection on federated source (example: vehicles/cars). I created this test case that should be used on doc/examples/repository project. I also did this same test using the JAAS configuration.
> package org.jboss.example.dna.repository;
> import static org.hamcrest.core.Is.is;
> import static org.hamcrest.core.IsNull.notNullValue;
> import static org.junit.Assert.assertThat;
> import java.net.URL;
> import org.jboss.dna.graph.Graph;
> import org.jboss.dna.jcr.JcrConfiguration;
> import org.jboss.dna.jcr.JcrEngine;
> import org.junit.Test;
> public class FederationOnDifferentSourcesTest {
> @Test
> public void shouldHaveProjectionInsideFederatedSource()
> throws Exception {
> JcrConfiguration configuration = new JcrConfiguration();
> URL configUrl = Thread.currentThread().getContextClassLoader()
> .getResource("configRepository.xml");
> assertThat(configUrl, is(notNullValue()));
> configuration.loadFrom(configUrl);
> JcrEngine engine = configuration.build();
> engine.start();
> Graph vehiclesGraph = engine.getGraph("Vehicles");
>
> assertThat(vehiclesGraph.getNodeAt("/Cars"), is(notNullValue()));
> }
> @Test
> public void shouldCreateItemOnSourceRepositoryAndShowTheSameItemOnFederatedSource()
> throws Exception {
> JcrConfiguration configuration = new JcrConfiguration();
> URL configUrl = Thread.currentThread().getContextClassLoader()
> .getResource("configRepository.xml");
> assertThat(configUrl, is(notNullValue()));
> configuration.loadFrom(configUrl);
> JcrEngine engine = configuration.build();
> engine.start();
> Graph carsGraph = engine.getGraph("Cars");
>
> carsGraph.create("/Honda");
> assertThat(carsGraph.getNodeAt("/Honda"), is(notNullValue()));
> Graph vehiclesGraph = engine.getGraph("Vehicles");
> assertThat(vehiclesGraph.getNodeAt("/Cars/Honda"), is(notNullValue()));
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the dna-issues
mailing list