You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by ha...@apache.org on 2010/01/27 12:22:14 UTC

svn commit: r903610 - in /incubator/clerezza/issues/CLEREZZA-70: org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/ org.apache.clerezza.rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/

Author: hasan
Date: Wed Jan 27 11:22:13 2010
New Revision: 903610

URL: http://svn.apache.org/viewvc?rev=903610&view=rev
Log:
CLEREZZA-70: used java annotation for scr Reference in Editor.java and improved coding in test

Modified:
    incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/Editor.java
    incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/MGraphUtilsTest.java

Modified: incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/Editor.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/Editor.java?rev=903610&r1=903609&r2=903610&view=diff
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/Editor.java (original)
+++ incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.platform.content/src/main/java/org/apache/clerezza/platform/content/Editor.java Wed Jan 27 11:22:13 2010
@@ -41,6 +41,7 @@
 import org.osgi.service.component.ComponentContext;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -68,15 +69,11 @@
 @Property(name="javax.ws.rs", boolValue=true)
 @Path("tools/editor")
 public class Editor {
-	
-	/**
-	 * @scr.reference
-	 */
+
+	@Reference
 	private ContentGraphProvider cgProvider;
 
-	/**
-	 * @scr.reference
-	 */
+	@Reference
 	private TcManager tcManager;
 
 	

Modified: incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/MGraphUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/MGraphUtilsTest.java?rev=903610&r1=903609&r2=903610&view=diff
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/MGraphUtilsTest.java (original)
+++ incubator/clerezza/issues/CLEREZZA-70/org.apache.clerezza.rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/MGraphUtilsTest.java Wed Jan 27 11:22:13 2010
@@ -40,15 +40,7 @@
 
 	@Test
 	public void removeSubGraph() throws NoSuchSubGraphException {
-		MGraph baseGraph = new SimpleMGraph();
-		{
-			BNode bNode1 = new BNode();
-			BNode bNode2 = new BNode();
-			baseGraph.add(new TripleImpl(u1, u2, bNode2));
-			baseGraph.add(new TripleImpl(bNode2, u2, bNode2));
-			baseGraph.add(new TripleImpl(bNode2, u2, bNode1));
-			baseGraph.add(new TripleImpl(u3, u2, u1));
-		}
+		MGraph baseGraph = createBaseGraph();
 
 		MGraph subGraph = new SimpleMGraph();
 		{
@@ -61,13 +53,8 @@
 		MGraphUtils.removeSubGraph(baseGraph, subGraph);
 		Assert.assertEquals(1, baseGraph.size());
 	}
-	
-	/** It is required that the subgraph comprises the whole context of the Bnodes it ioncludes
-	 * 
-	 * @throws org.apache.clerezza.rdf.utils.MGraphUtils.NoSuchSubGraphException
-	 */
-	@Test(expected=NoSuchSubGraphException.class)
-	public void removeIncompleteSubGraph() throws NoSuchSubGraphException {
+
+	private MGraph createBaseGraph() {
 		MGraph baseGraph = new SimpleMGraph();
 		{
 			BNode bNode1 = new BNode();
@@ -77,6 +64,16 @@
 			baseGraph.add(new TripleImpl(bNode2, u2, bNode1));
 			baseGraph.add(new TripleImpl(u3, u2, u1));
 		}
+		return baseGraph;
+	}
+	
+	/** It is required that the subgraph comprises the whole context of the Bnodes it ioncludes
+	 * 
+	 * @throws org.apache.clerezza.rdf.utils.MGraphUtils.NoSuchSubGraphException
+	 */
+	@Test(expected=NoSuchSubGraphException.class)
+	public void removeIncompleteSubGraph() throws NoSuchSubGraphException {
+		MGraph baseGraph = createBaseGraph();
 
 		MGraph subGraph = new SimpleMGraph();
 		{
@@ -90,15 +87,7 @@
 
 	@Test(expected=NoSuchSubGraphException.class)
 	public void removeInvalidSubGraph() throws NoSuchSubGraphException {
-		MGraph baseGraph = new SimpleMGraph();
-		{
-			BNode bNode1 = new BNode();
-			BNode bNode2 = new BNode();
-			baseGraph.add(new TripleImpl(u1, u2, bNode2));
-			baseGraph.add(new TripleImpl(bNode2, u2, bNode2));
-			baseGraph.add(new TripleImpl(bNode2, u2, bNode1));
-			baseGraph.add(new TripleImpl(u3, u2, u1));
-		}
+		MGraph baseGraph = createBaseGraph();
 
 		MGraph subGraph = new SimpleMGraph();
 		{
@@ -111,5 +100,5 @@
 		}
 		MGraphUtils.removeSubGraph(baseGraph, subGraph);
 	}
-
 }
+