[dna-issues] [JBoss JIRA] Created: (DNA-461) new item in source doesn't appear in federated source projection

Luiz Fernando Teston (JIRA) jira-events at lists.jboss.org
Mon Jun 15 15:46:56 EDT 2009


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("Vechicles");
		
		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