You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by en...@apache.org on 2011/07/03 02:06:53 UTC

svn commit: r1142349 [5/5] - in /incubator/stanbol/trunk/demos/integritycheck: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/stanbol/ src/main/java/org/apache/stanbol/demos/ src/main/java/org/apa...

Propchange: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/jquery.rdfquery.core-1.0.js
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/jsonToTurtle.js
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/jsonToTurtle.js?rev=1142349&view=auto
==============================================================================
--- incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/jsonToTurtle.js (added)
+++ incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/jsonToTurtle.js Sun Jul  3 00:06:51 2011
@@ -0,0 +1,303 @@
+/**
+ * Constructor: ex) var json = new JsonTurtle;
+ */
+function JsonTurtle(){
+	this.rdfprop = 0;
+	return this;
+}
+
+/**
+ * Get JSON data from a field, convert it to Turtle, and put into another field
+ * @param	jfld : id of textarea that stores JSON data
+ * @param	tfld : id of textarea to put Turtle serialization
+ */
+JsonTurtle.prototype.j2t = function(jfld, tfld){
+	var j, t;
+	j = "{'safeval':" + document.getElementById(jfld).value + "}";
+	try{
+		eval('var d = ' + j);
+		document.getElementById(tfld).value = this.parsej(d.safeval,"\n",'');
+	}catch(e){
+		alert("Error. Possibly dangerous code:\n" + e);
+	}
+}
+
+/**
+ * Converts a (JSON) object to RDF/Turtle triples.
+ * @param	obj : data object
+ * @param	sep : triple separator (usually \n)
+ * @param	pre : indent string. also indicates nest level.
+ * @param	called_by : indicates whether parent 'element' is a Class.
+ * @return	RDF/Turtle triples.
+ */
+JsonTurtle.prototype.parsej = function (obj, sep, pre, called_by){
+	var res = ''; //result
+	var arg = {
+		'pfdcl' : '', // prefix decl
+		'caller': called_by,
+		's' : '', // subject of triple
+		'ctype' : '' // classtype
+	}; 
+	var s, p, o; // triple s,p,o
+	var key; // JSON object key
+	if(pre == '')
+		this.rdfprop = 0; // capture whether rdf: property is used
+
+	switch(typeof(obj)){
+	case "string":
+		return this.set_object(obj);
+	case "boolean":
+		return '"' + obj + '"';
+	case "number":
+		return obj;
+	case "undefined":
+		return '""';
+	}
+	// without abov switch, {"p":["abc"]} will be 
+	// [:p [rdf:_1 "a"; rdf:_2 "b"; rdf:_3 "c"]] .
+	// so, case object:
+	for(key in obj){
+		//-- skip RDF syntax vocab.
+		switch(key){
+		case 'rdf:resource':
+			return '<' + obj[key] + '>';
+		case 'rdf:parseType':
+			continue;
+		case 'rdf:RDF':
+			return this.parsej(obj[key],sep,'',key);
+		case 'rdf:Description':
+			return this.prepare_pfx(arg, sep) + this.parsej(obj[key],sep,'',key);
+		case '#text':
+			return '"' + obj[key] + '"';
+		}
+		
+		//-- property name to QName
+		p = this.set_qname(key);
+
+		//-- set appropriate triple according to object type
+		switch(typeof(obj[key])){
+		case "object":
+			res += this.proc_object(obj[key], p, pre, sep, arg);
+			break;
+		case "string":
+			o = this.set_object(obj[key]);
+			res += this.set_po(key, p, o, pre, sep, arg);
+			break;
+		case "number":
+		//case "boolean":
+			res += pre + p + ' ' + obj[key] + ';' + sep;
+			break;
+		default:
+			res += pre + p + ' "' + obj[key] + '";' + sep;
+		}
+	}
+
+	//-- add bNode [] or collection (), or regard as continuing p-o seqence.
+	res = res ? res.slice(0,-2) : (p ? p : ":_undefined") + ' ""';
+	res = (arg.s && pre=='') ? arg.s + res :
+		(arg.ctype == 'Collection' ? 
+			'(' + sep + res + sep + pre + ')' :
+		 	((arg.caller == 'C' || (pre == '' && arg.ctype)) ? sep + res:
+			'[' + sep + res + sep + pre + ']')
+		);
+	return pre ? res : 
+		this.prepare_pfx(arg, sep) + res + ' .';
+}
+
+
+/**
+ * processes value tyep 'object' for JSON data
+ * @param	val : JSON proprerty value (obj[key])
+ * @param	p : property QName
+ * @param	sep : triple separator (usually \n)
+ * @param	pre : indent string. also indicates nest level.
+ * @param	arg : object of pfdcl, caller, s, ctype, by reference (set val)
+ * @return	resulting triple
+ */
+JsonTurtle.prototype.proc_object = function(val, p, pre, sep, arg){
+	var res, reslist = '', triple, s, ep, pp;
+	var o = {'ctype' : ''};
+	if(val == null)
+		res = pre + p + ' "";' + sep;
+
+	// case Array: treat array as repeated property, not a container
+	else if(val instanceof Array){//val.constructor == Array
+		var i;
+		for(i=0; i<val.length; i++){
+			pp = (p == 'rdf:li') ? 'rdf:_' + (i+1) : p;
+			triple = this.proc_obj_cp(val[i], pp, pre, sep, ' ', arg.caller, o);
+			reslist += o.ctype ? 
+				pre + '[' + triple + '] ' + sep :
+				triple;
+		}
+		// Loop here in order to have repeated property for array
+		// rather than RDF container model. e.g. for
+		// {p1: [ {p2: "v1"}, {p2: "v2"}]}
+		// not [:p1 [ rdf:_1 [:p2 "v1"]; rdf:_2 [:p2 "v2"]]] . (1)
+		// but [:p1 [:p2 "v1"]; p1 [:p2 "v2"]] . (2)
+		// bellow commented code generates (1)
+		/*triple = this.proc_obj_cp(val, p, pre, sep, ' ', arg.caller, o);
+		reslist = o.ctype ? 
+			pre + '[' + triple + '] ' + sep :
+			triple;*/
+
+		// o.ctype is set 'a :Classname' by proc_obj_cp
+		if(o.ctype){// repeated Class -> Collection
+			if(pre == ''){
+				arg.s = '[]';
+				res = sep + ':has_a (' + sep + reslist + '); '
+			}else{
+				o.ctype = 'Collection';
+				//res = '(' + sep + reslist + pre + ')  ';
+				res = reslist;
+			}
+		}else
+			res = reslist;
+	
+	// case Hash object:
+	}else{
+		if(pre == ''){
+			ep = '.';
+			arg.caller = 'Root';
+		}else
+			ep = ';';
+		res = this.proc_obj_cp(val, p, pre, sep, ep, arg.caller, o);
+		if(pre == '' && o.ctype) arg.caller = 'Root';
+	}
+	arg.ctype = o.ctype;
+	return res;
+}
+
+
+/**
+ * Processes object type data as class or property. If the property name 
+ * starts with a capital letter, regard it as a Class
+ * @param	obj : a data object
+ * @param	p : property whose value is obj
+ * @param	pre : indent string. also indicates nest level.
+ * @param	sep : triple separator (usually \n)
+ * @param	ep : end point of a triple in case a Class (usually '.')
+ * @param	caller : indicates whether parent 'element' is a Class.
+ * @param	o : object of ctype (to return value)
+ * @return	composed Turle
+ */
+JsonTurtle.prototype.proc_obj_cp = function(obj, p, pre, sep, ep, caller, o){
+	var res;
+	
+	if((p.split(':')[1]).match(/^[A-Z]/) && caller != 'C'){
+		// if local name starts with a capital, regard as Class
+		// and treat nested object as p/o of the same subject
+		o.ctype = ' a ' + p + ';';
+		res = pre + o.ctype + this.parsej(obj, "\n", '  ' + pre, 'C');
+		if(caller == 'Root') 
+			// list of classes called by root will be each independent
+			res = '[' + res + sep + ']' + ep + sep;
+		else
+			res += ep + sep;
+		// (only top level can have '.' for class, i.e. parallel triples)
+	}else{
+		// else treat as bNode with predicateObjectList
+		res = pre + p + ' ' + this.parsej(obj, "\n", '  ' + pre) + ';' + sep;
+	}
+	return res;
+}
+
+
+/**
+ * set appropriate QName for property
+ * @param	key : JSON proprerty name (key in obj)
+ * @return	QName
+ */
+JsonTurtle.prototype.set_qname = function(key){
+	var p;
+	if(key.indexOf(':') > -1)
+		// if contains ':' regard it as Qname -- maybe need clean up
+		p =  key;
+	else if(key.match(/^\d+$/)){
+		// Array has 0,1,2... as key --> RDF container member prop.
+		p =  'rdf:_' + (key*1+1);
+		this.rdfprop++;
+	}else
+		// treat as default namespaced name
+		p = ':' + key; 
+		
+	// clean up property name
+	p = p.replace(/[^-:\w\d\u00c0-\ueffff]/g,'_'); // pseudo namechar
+	p = p.replace(/:([-\d])/,':_'+RegExp.$1); // local name start char
+
+	return p;
+}
+
+
+/**
+ * set appropriate object for JSON data value
+ * @param	val : JSON proprerty value (obj[key])
+ * @return	object in Turtle triple
+ */
+JsonTurtle.prototype.set_object = function(val){
+	var o;
+	// if uri ref
+	if(val.match(/^<([-_\w\n\.~\?\&\/\@=;,#%:]+)>$/))
+		o = "<" + RegExp.$1 + ">";
+	//need this ? maybe should not ?
+	else if(val.match(/^http:([-_\w\n\.~\?\&\/\@=;,#%]+)$/))
+		o = "<http:" + RegExp.$1 + ">";
+	// or bNode
+	else if(val == "[]")
+		o = "[]";
+	// or QName
+	else if(val.match(/^\w*:\w+$/))
+		o = val;
+	// or literal
+	else{
+		o = val.replace(/\n/g,"\\n");
+		o = o.replace(/\"/g,"\\\"");
+		o = '"' + o + '"';
+	}
+
+	return o;
+}
+
+
+/**
+ * set property - object, or @prefix or subject, according to object value
+ * @param	key : JSON object key (key in obj)
+ * @param	p : property QName
+ * @param	o : object
+ * @param	pre : indent string. also indicates nest level.
+ * @param	sep : triple separator (usually \n)
+ * @param	arg : object of pfdcl, caller, s, ctype (set value for pfdcl, s)
+ * @return	resulting part of triple
+ */
+JsonTurtle.prototype.set_po = function(key, p, o, pre, sep, arg){
+	var res = '', pfx;
+	if(key.match(/^(\@prefix|xmlns)/)){  // ns prefix decl
+		pfx = key.split(':')[1];
+		if(pfx == undefined) pfx = '';
+		arg.pfdcl += "@prefix " + pfx + ": " + o + " ." + sep;
+	}else if(key.match(/^(\@|rdf:)about/))  // subject node
+		arg.s = o + sep;
+	else if(p == ':a') // a (rdf:type)
+		res = pre + 'a ' + o + ";" + sep;
+	else
+		res = pre + p + ' ' + o + ";" + sep;
+	
+	return res;
+}
+
+
+/**
+ * Prepares ns prefix declarations. If no @prefix, add an default ns.
+ * If model includes constructs from RDF ns and not ns ready, add one
+ * @param	arg : object of pfdcl, caller, s, ctype
+ * @param	sep : triple separator (usually \n)
+ * @return	prepared @prefix directives
+ */
+JsonTurtle.prototype.prepare_pfx = function(arg, sep){
+	var rdfns = '<http://www.w3.org/1999/02/22-rdf-syntax-ns#>';
+	if(arg.pfdcl == '') /*&& arg.caller != 'Root'*/
+		arg.pfdcl= "@prefix : <http://purl.org/net/ns/jsonrdf/> ." + sep;
+	if(this.rdfprop && arg.pfdcl.indexOf(rdfns) == -1)
+		arg.pfdcl += "@prefix rdf: " + rdfns + " ." + sep;
+	return arg.pfdcl;
+}

Propchange: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/static/jsonToTurtle.js
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/integritycheckDescription.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/integritycheckDescription.ftl?rev=1142349&view=auto
==============================================================================
--- incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/integritycheckDescription.ftl (added)
+++ incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/integritycheckDescription.ftl Sun Jul  3 00:06:51 2011
@@ -0,0 +1,2 @@
+This is a Demo which demonstrates a usage example of the <b>/engines</b>, <b>/ontonet</b>, <b>/rules</b> and <b>/reasoners</b> REST services for checking the integrity of remote data with respect to some requirements.
+<#macro view>This is a Demo which demonstrates a usage example of the <b>/engines</b>, <b>/ontonet</b>, <b>/rules</b> and <b>/reasoners</b> REST services for checking the integrity of remote data with respect to some requirements.</#macro>
\ No newline at end of file

Added: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/outline.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/outline.ftl?rev=1142349&view=auto
==============================================================================
--- incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/outline.ftl (added)
+++ incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/outline.ftl Sun Jul  3 00:06:51 2011
@@ -0,0 +1,12 @@
+<#macro view>
+Steps of the demo:
+<p>
+<ol>
+<li>Send the text to the <b>/engines</b> service</li>
+<li>Load the data about entities in a <b>/ontonet</b> session from the <b>web</b></li>
+<li>Define rule to apply for valid content using <b>/recipe</b> and <b>/rules</b></li>
+<li>Run the classifier (<b>/reasoners/classify</b>) pointing to the ontonet session and the recipe</li>
+</ol>
+</p>
+<p>You can check more details about how to implement this process (REST calls) from the <a target="_blank" href="/static/integritycheck/integritycheck.js">Javascript sourcecode</a></p>
+</#macro>
\ No newline at end of file

Added: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step1.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step1.ftl?rev=1142349&view=auto
==============================================================================
--- incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step1.ftl (added)
+++ incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step1.ftl Sun Jul  3 00:06:51 2011
@@ -0,0 +1,17 @@
+<#macro view>
+<div id="step-1" class="step-1 step">
+<div id="step-1-before" class="step-1 before">
+<p>Type some test to start from.
+<textarea id="textInput" name="textInput" cols="70" rows="10">Sony Corporation is the electronics business unit and the parent company of the Sony Group, which is engaged in business through its eight operating segments. Consumer Products & Devices (CPD), Networked Products & Services (NPS), B2B & Disc Manufacturing (B2B & Disc), Pictures, Music, Financial Services, Sony Ericsson and All Other.These make Sony one of the most comprehensive entertainment companies in the world. Sony's principal business operations include Sony Corporation (Sony Electronics in the U.S.), Sony Pictures Entertainment, Sony Computer Entertainment, Sony Music Entertainment, Sony Ericsson, and Sony Financial. As a semiconductor maker, Sony is among the Worldwide Top 20 Semiconductor Sales Leaders.</textarea></p>
+<p>
+  <button type="button" id="step-1-start" class="start">Start</button>
+</p>
+</div>
+<div id="step-1-after" class="step-1 after">
+<h3 class="step-1">Step 1: /engines</h3>
+<p class="info">The text has been sent to the <b><a href="/engines" target="_blank">/engines</a></b> service</p>
+<p class="message"></p>
+<p><ul id="step-1-results"></ul></p>
+</div>
+</div>
+</#macro>
\ No newline at end of file

Added: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step2.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step2.ftl?rev=1142349&view=auto
==============================================================================
--- incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step2.ftl (added)
+++ incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step2.ftl Sun Jul  3 00:06:51 2011
@@ -0,0 +1,16 @@
+<#macro view>
+<div id="step-2" class="step-2 step">
+<div id="step-2-before" class="step-2 before">
+<h3 class="step-2">Step 2: /ontonet</h3>
+<p class="info">We create a new session on the <b>integritycheck</b> scope, which includes an ontology
+that defines types and attributes of dbpedia. It also contains a type <b>dbpedia:ValidContent</b>, whch we use for this demo (<a target="_blank" href="/static/integritycheck/dbpedia_demo.owl">get the ontology</a>).</p>
+<p>
+  <button type="button" id="step-2-start" class="start">Start</button>
+</p>
+</div>
+<div id="step-2-after" class="step-2 after">
+<p class="message"></p>
+<p><ul id="step-2-results"></ul></p>
+</div>
+</div>
+</#macro>
\ No newline at end of file

Added: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step3.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step3.ftl?rev=1142349&view=auto
==============================================================================
--- incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step3.ftl (added)
+++ incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step3.ftl Sun Jul  3 00:06:51 2011
@@ -0,0 +1,28 @@
+<#macro view>
+<div id="step-3" class="step-3 step">
+<div id="step-3-before" class="step-3 before">
+<h3 class="step-3">Step 3: /rules, /recipe</h3>
+<p>
+<!--
+TODO: Find a nice rule to start from...
+Why this rule does not return valid contents?
+
+dbpedia = <http://dbpedia.org/ontology/> . 
+ruleIntegrity[has(dbpedia:product, ?x, ?product) . 
+is(dbpedia:Organisation, ?x) -> is(dbpedia:ValidContent, ?x)]  
+
+-->
+  <textarea id="step-3-input"
+  >dbpedia = <http://dbpedia.org/ontology/> . 
+ruleIntegrity[ 
+is(dbpedia:Organisation, ?x) -> is(dbpedia:ValidContent, ?x)]  
+  </textarea>
+  <button type="button" id="step-3-start" class="start">Start</button>
+</p>
+</div>
+<div id="step-3-after" class="step-3 after">
+<p class="message"></p>
+<p><ul id="step-3-results"></ul></p>
+</div>
+</div>
+</#macro>
\ No newline at end of file

Added: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step4.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step4.ftl?rev=1142349&view=auto
==============================================================================
--- incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step4.ftl (added)
+++ incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/imports/steps/step4.ftl Sun Jul  3 00:06:51 2011
@@ -0,0 +1,14 @@
+<#macro view>
+<div id="step-4" class="step-4 step">
+<div id="step-4-before" class="step-4 before">
+<h3 class="step-4">Step 4: /reasoners/classify</h3>
+<p>
+  <button type="button" id="step-4-start" class="start">Start</button>
+</p>
+</div>
+<div id="step-4-after" class="step-4 after">
+<p class="message"></p>
+<p><ul id="step-4-results"></ul></p>
+</div>
+</div>
+</#macro>
\ No newline at end of file

Added: incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/org/apache/stanbol/demos/integritycheck/resources/IntegrityCheckResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/org/apache/stanbol/demos/integritycheck/resources/IntegrityCheckResource/index.ftl?rev=1142349&view=auto
==============================================================================
--- incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/org/apache/stanbol/demos/integritycheck/resources/IntegrityCheckResource/index.ftl (added)
+++ incubator/stanbol/trunk/demos/integritycheck/src/main/resources/org/apache/stanbol/demos/integritycheck/templates/org/apache/stanbol/demos/integritycheck/resources/IntegrityCheckResource/index.ftl Sun Jul  3 00:06:51 2011
@@ -0,0 +1,17 @@
+<#import "/imports/common.ftl" as common>
+<#import "/imports/integritycheckDescription.ftl" as integritycheckDescription>
+<#import "/imports/outline.ftl" as outline>
+<#import "/imports/steps/step1.ftl" as step1>
+<#import "/imports/steps/step2.ftl" as step2>
+<#import "/imports/steps/step3.ftl" as step3>
+<#import "/imports/steps/step4.ftl" as step4>
+<#escape x as x?html>
+<@common.page title="Apache Stanbol Demos: Integrity Check" hasrestapi=false>
+<@integritycheckDescription.view />
+<@outline.view />
+<@step1.view />
+<@step2.view />
+<@step3.view />
+<@step4.view />
+</...@common.page>
+</#escape>
\ No newline at end of file

Added: incubator/stanbol/trunk/demos/integritycheck/src/test/java/org/apache/stanbol/demos/integritycheck/test/IntegrityCheckFragmentTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/demos/integritycheck/src/test/java/org/apache/stanbol/demos/integritycheck/test/IntegrityCheckFragmentTest.java?rev=1142349&view=auto
==============================================================================
--- incubator/stanbol/trunk/demos/integritycheck/src/test/java/org/apache/stanbol/demos/integritycheck/test/IntegrityCheckFragmentTest.java (added)
+++ incubator/stanbol/trunk/demos/integritycheck/src/test/java/org/apache/stanbol/demos/integritycheck/test/IntegrityCheckFragmentTest.java Sun Jul  3 00:06:51 2011
@@ -0,0 +1,35 @@
+/**
+ * 
+ */
+package org.apache.stanbol.demos.integritycheck.test;
+
+import static org.junit.Assert.*;
+
+import org.apache.stanbol.demos.integritycheck.IntegrityCheckFragment;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author enridaga
+ *
+ */
+public class IntegrityCheckFragmentTest {
+
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@Before
+	public void setUp() throws Exception {
+	}
+
+	/**
+	 * TODO This is a stub test. Useful tests for WebFragments/Templates?
+	 * Test method for {@link org.apache.stanbol.demos.integritycheck.IntegrityCheckFragment#getName()}.
+	 */
+	@Test
+	public final void testGetName() {
+		IntegrityCheckFragment fragment = new IntegrityCheckFragment();
+		assertTrue(fragment.getName().equals("integritycheck"));
+	}
+
+}