added test for thesis paper

This commit is contained in:
Kevin Jahns 2014-10-20 10:04:53 +00:00
parent ee516a6271
commit 94e66af751
41 changed files with 202 additions and 139 deletions

17
.c9/.nakignore Normal file
View File

@ -0,0 +1,17 @@
*~backup-*
.c9revisions
.c9
.git
.svn
.DS_Store
.bzr
.cdv
~.dep
~.dot
~.nib
~.plst
.hg
.pc
*.min.js
.nakignore
/dev

1
.c9/metadata/tab0 Normal file
View File

@ -0,0 +1 @@
{"filter":false,"title":"bash - \"dmonad-yatta-1043270\"","tooltip":"bash - \"dmonad-yatta-1043270\"","undoManager":{"mark":0,"position":-1,"stack":[]},"terminal":{"id":"dmonad@yatta_662","cwd":"","width":1047,"height":282,"scrollTop":11769},"timestamp":1413550463273,"hash":"da39a3ee5e6b4b0d3255bfef95601890afd80709"}

View File

@ -0,0 +1 @@
{"filter":false,"title":"README.md","tooltip":"/README.md","ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":10,"column":63},"end":{"row":10,"column":63},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"hash":"40d34a88fa34dbeb76a98926a0887f2e65ab62f2","undoManager":{"mark":0,"position":-1,"stack":[]},"timestamp":1413551041000}

View File

@ -0,0 +1 @@
{"filter":false,"title":"README.md","tooltip":"/examples/README.md","ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":11,"column":15},"end":{"row":11,"column":15},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"hash":"ec67816fcfac6b45b106df24123e426664d931d9","undoManager":{"mark":0,"position":-1,"stack":[]},"timestamp":1413550889000}

View File

@ -0,0 +1 @@
{"filter":false,"title":"index.html","tooltip":"/examples/TextEditing/index.html","ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":0,"column":0},"end":{"row":0,"column":0},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"hash":"d101d1485f1eef1f6668cc63dfa948f817a705bb","undoManager":{"mark":0,"position":-1,"stack":[]},"timestamp":1413550910315}

View File

@ -0,0 +1 @@
{"filter":false,"title":"index.html","tooltip":"/examples/XmlExample/index.html","ace":{"folds":[],"scrolltop":226,"scrollleft":0,"selection":{"start":{"row":32,"column":7},"end":{"row":32,"column":7},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"hash":"434d72f542320b04a12755610ab04652409e3acf","undoManager":{"mark":0,"position":-1,"stack":[]},"timestamp":1413551392265}

View File

@ -0,0 +1 @@
{"filter":false,"title":"gulpfile.coffee","tooltip":"/gulpfile.coffee","undoManager":{"mark":-1,"position":-1,"stack":[]},"ace":{"folds":[],"scrolltop":240,"scrollleft":0,"selection":{"start":{"row":28,"column":13},"end":{"row":28,"column":13},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":15,"state":"start","mode":"ace/mode/coffee"}},"timestamp":1413791227000,"hash":"71d6cc8c00eee491529ea2e18dd1e7bf44a05623"}

View File

@ -0,0 +1 @@
{"filter":false,"title":"TestSuite.coffee","tooltip":"/test/TestSuite.coffee","undoManager":{"mark":1,"position":1,"stack":[[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":20},"end":{"row":15,"column":21}},"text":"0"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":16,"column":27},"end":{"row":16,"column":28}},"text":"0"}]}]]},"ace":{"folds":[],"scrolltop":75.5,"scrollleft":0,"selection":{"start":{"row":16,"column":27},"end":{"row":16,"column":27},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":4,"state":"start","mode":"ace/mode/coffee"}},"timestamp":1413797924177,"hash":"e07e354b8cbdee0671212bcfd7dbdbe0b84b43c4"}

File diff suppressed because one or more lines are too long

34
.c9/project.settings Normal file
View File

@ -0,0 +1,34 @@
{
"run": {
"@path": "/.c9/runners",
"configs": {
"json()": {},
"@inited": "true"
}
},
"share": {
"@preview": false,
"@app": false,
"@useOwnerSettings": false
},
"ace": {
"@newLineMode": "unix",
"@tabSize": "4",
"@useSoftTabs": "true",
"@guessTabSize": "true"
},
"find.nak": {
"@searchLimit": 100
},
"language": {
"@warnLevel": "info",
"@instanceHighlight": "true",
"@undeclaredVars": "true",
"@unusedFunctionArgs": "false"
},
"build": {
"@path": "/.c9/builders",
"@saveall": "true",
"@builder": "auto"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -258,7 +258,7 @@
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -302,7 +302,7 @@ data from the received intent.</p>
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -335,7 +335,7 @@ JsonFramework was initialized (Depending on the HistoryBuffer implementation).</
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -466,7 +466,7 @@ if (x.type === &quot;JsonType&quot;) {
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -139,7 +139,7 @@ console.log(w.newProperty == &quot;Awesome&quot;) # true!</code></pre>
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -242,7 +242,7 @@ on how to do that with urls.</p>
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -356,7 +356,7 @@ JsonFramework was initialized (Depending on the HistoryBuffer implementation).</
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -455,7 +455,7 @@ yatta.bind(textbox);</code></pre>
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -303,7 +303,7 @@ JsonFramework was initialized (Depending on the HistoryBuffer implementation).</
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -38,7 +38,7 @@
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -37,9 +37,9 @@
<h1 id="-yatta-extras-imgs-yatta_logo-png-raw-true-"><img src="./extras/imgs/Yatta_logo.png?raw=true" alt="Yatta!"></h1><p>A Real-Time web framework that manages concurrency control for arbitrary data structures.
Yatta! provides similar functionality as <a href="https://github.com/share/ShareJS">ShareJs</a> and <a href="https://github.com/opencoweb/coweb">OpenCoweb</a>,
but does not require you to understand how the internals work. The predefined data structures provide a simple API to access your shared data structures.</p><p>Predefined data structures:</p><ul>
<li>Text - <a href="http://dadamonad.github.io/Yatta/examples/TextEditing/">Collaborative Text Editing Example</a> and <a href="./examples/TextEditing/">Source</a></li>
<li>Json - <a href="./examples/PeerJs-Json/">Tutorial</a></li>
<li>XML - <a href="./XmlExample">XML Example</a> Collaboratively manipulate the dom with native dom-features and jQuery.</li>
<li>Text - <a href="http://dadamonad.github.io/Yatta/examples/TextEditing/">Collaborative Text Editing Example</a></li>
<li>Json - <a href="http://dadamonad.github.io/Yatta/examples/PeerJs-Json/">Tutorial</a></li>
<li>XML - <a href="http://dadamonad.github.io/Yatta/examples/XmlExample/">XML Example</a> Collaboratively manipulate the dom with native dom-features and jQuery.</li>
</ul><p>Unlike other frameworks, Yatta! supports P2P message propagation and is not bound to a specific communication protocol.</p><p>It is possible to add any communication protocol to Yatta. Currently it supports:</p><ul>
<li><a href="http://peerjs.com/">PeerJs</a> - A WebRTC Framework</li>
<li><a href="http://simplewebrtc.com/">SimpleWebRTC</a> - Another WebRTC Framework (coming soon)</li>
@ -76,7 +76,7 @@ But I would become really motivated if you gave me some feedback :) (<a href="ht
</ul>
<h2 id="support">Support</h2><p>Please report <em>any</em> issues to the <a href="https://github.com/DadaMonad/Yatta/issues">Github issue page</a>!
I would appreciate if developers gave me feedback on how <em>convenient</em> the framework is, and if it is easy to use. Particularly the XML-support may not support every DOM-methods - if you encounter a method that does not cause any change on other peers,
please state function name, and sample parameters. However, there are browser-specific features, that Yatta won&#39;t support.</p><h2 id="license">License</h2><p>Yatta! is licensed under the <a href="./LICENSE.txt">MIT License</a>.</p><a href="&#x6d;&#97;&#105;&#108;&#x74;&#x6f;&#x3a;&#107;&#101;&#118;&#105;&#110;&#x2e;&#106;&#x61;&#104;&#110;&#115;&#x40;&#114;&#119;&#x74;&#104;&#45;&#x61;&#x61;&#99;&#x68;&#101;&#x6e;&#46;&#100;&#101;">&#107;&#101;&#118;&#105;&#110;&#x2e;&#106;&#x61;&#104;&#110;&#115;&#x40;&#114;&#119;&#x74;&#104;&#45;&#x61;&#x61;&#99;&#x68;&#101;&#x6e;&#46;&#100;&#101;</a>
please state function name, and sample parameters. However, there are browser-specific features, that Yatta won&#39;t support.</p><h2 id="license">License</h2><p>Yatta! is licensed under the <a href="./LICENSE.txt">MIT License</a>.</p><a href="&#x6d;&#97;&#x69;&#108;&#116;&#x6f;&#x3a;&#x6b;&#101;&#118;&#105;&#110;&#46;&#x6a;&#97;&#104;&#110;&#115;&#x40;&#114;&#x77;&#x74;&#x68;&#x2d;&#x61;&#x61;&#99;&#104;&#x65;&#110;&#x2e;&#x64;&#101;">&#x6b;&#101;&#118;&#105;&#110;&#46;&#x6a;&#97;&#104;&#110;&#115;&#x40;&#114;&#x77;&#x74;&#x68;&#x2d;&#x61;&#x61;&#99;&#104;&#x65;&#110;&#x2e;&#x64;&#101;</a>
@ -85,7 +85,7 @@ please state function name, and sample parameters. However, there are browser-sp
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -100,7 +100,7 @@
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -158,7 +158,7 @@
</div>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -48,7 +48,7 @@
</dl>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -60,7 +60,7 @@
</dl>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -60,7 +60,7 @@
</dl>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -60,7 +60,7 @@
</dl>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -48,7 +48,7 @@
</dl>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -37,7 +37,7 @@
</table>
</div>
<div id='footer'>
October 17, 14 12:58:33 by
October 20, 14 09:57:05 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -1,74 +0,0 @@
## IWC + JSON Example
Here, I will give a short overview on how to use the IwcJson Framework in Role-SDK widgets.
First you have to include the following libraries in your widget file:
```
<script src="http://open-app.googlecode.com/files/openapp.js"></script>
<script src="http://dbis.rwth-aachen.de/gadgets/iwc/lib/iwc.js"></script>
<script src="http://dbis.rwth-aachen.de/~jahns/role-widgets/widgetbundles/libraries/DUIClient.js"></script>
<script src="../../build/browser/Frameworks/JsonFramework.min.js"></script>
<script src="../../build/browser/Connectors/IwcConnector.min.js"></script>
<script src="./index.js"></script>
```
A working widget implementation is [IwcJson.xml](./IwcJson.xml) and the js-file is [index.js](./index.js)
```js
function init(){
Y.createIwcConnector(function(Connector, user_id){
```
yatta is the shared json object. If you change something on this object,
it will be instantly shared with all the other collaborators.
```js
yatta = new Y.JsonYatta(user_id, Connector);
```
You may want to get the created DUI client (you must not create two DUI/IWC clients!!),
or set an IwcHandler.
```js
var duiclient = yatta.getConnector().duiclient;
function iwcHandler (intent) {
console.log("Received intent: "+JSON.stringify(intent));
}
yatta.getConnector().setIwcHandler(iwcHandler);
```
Add a integer-property like this
```js
yatta.val('x', 7);
```
Get the value of property x like this
```js
console.log(yatta.val('x') === 7); // true
```
A string property can be either mutable or immutable.
```js
yatta.val('mutable_string', "text", "mutable");
yatta.val('immutable_string', "text", "immutable");
console.log(yatta.val('immutable_string') === "text"); // true
yatta.val('mutable_string').insertText(2,"XXX"); // position, string
yatta.val('mutable_string').deleteText(0,1); // position, deletion length
console.log(yatta.val('mutable_string').val() === "eXXXxt"); // true
})
}
window.onload = init
```

View File

@ -25,7 +25,8 @@ files =
lib : ['./lib/**/*.coffee']
build : ['./build/**']
browser : ['./lib/{Connectors,Frameworks}/**/*']
test : ['./test/**/*_test.coffee']
#test : ['./test/**/*_test.coffee']
test : ['./test/TextYatta_test.coffee']
browser_test : ['./test/**/*_test_browser.coffee']
gulp : ['./gulpfile.coffee']
examples : ['./examples/**/*.js']

View File

@ -14,7 +14,7 @@ module.exports = class Test
constructor: (@name_suffix = "")->
@number_of_test_cases_multiplier = 1
@repeat_this = 1 * @number_of_test_cases_multiplier
@doSomething_amount = 20 + @number_of_test_cases_multiplier
@doSomething_amount = 100 + @number_of_test_cases_multiplier
@number_of_engines = 5 + @number_of_test_cases_multiplier - 1
@time = 0

View File

@ -38,6 +38,31 @@ describe "TextFramework", ->
u.insertText 0, "abc"
@yTest.compareAll()
expect(u.val()).to.equal("abc")
number_of_concurrent_operations = 100000
it "concurrent against #{number_of_concurrent_operations}", ->
a = @yTest.users[0]
b = @yTest.users[1]
str = ""
for i in [0...number_of_concurrent_operations]
str += "a"
countTime = (name, task)->
start = (new Date()).getTime()
task()
console.log "Time needed to complete task '#{name}': #{(new Date().getTime())-start}"
countTime "insert #{number_of_concurrent_operations} characters", ()->
a.insertText 0, str
b.insertText 0, "b"
b_hb = b.HB._encode()
b.engine.applyOps a.HB._encode()
countTime "transform one operation against #{number_of_concurrent_operations} operations", ()->
a.engine.applyOps b_hb
console.log a.val()
expect(a.val()).to.equal(b.val())
it "can handle many engines, many operations, concurrently (random)", ->
@yTest.run()