GithubHelp home page GithubHelp logo

onrtest's Introduction

Introduction

ONRTest is a test module to work with Maurits Lamers' OrionNodeRiak library.

ONRTest is run within a browser environment. The ONRTest directory contains:

index.html
OrionNodeRiakDataSource.js
wstest.js
sc/
  query.js
  runtime/
  foundation/
  datasource/

The parts of Sproutcore needed to simulate SC apps are contained within the sc directory. These have been modified to run within a browser environment by:

- replacing all calls of sc_super(); with the "magic" equivalent:
      arguments.callee.base.apply(this, arguments);
- including javascript dependencies in necessary order of script tags within index.html

In order to run the test, you need, of course, OrionNodeRiak, which requires node.js, and an installation of Riak.

Once you have node, ONR, and Riak installed...

OrionNodeRiak

In one terminal window...

Clone the OrionNodeRiak repository.

You may add a users file, as an authModule, adding a test user and password to users.js, such as:

exports.users = {
 'root': { passwd: 'password', isRoot: true},
 'test': { passwd: 'test', isRoot: false }
};

Add a reference to user.js in server.js, following the ONR example.

Configure a server.js file and run as:

sudo node server.js

Riak

In a second terminal window...

For running on Mac OS X, at least, edit the ../bin/riak file of Riak to add a line

ulimit -n 11360

just after the " RUNNER_USER=" line at about line 10.

This increases the number of processes, but requires sudo, so Riak is started as:

sudo ./riak console

to see output to the screen. Control-g, followed by q, will exit.

If you would like to install innostore, which we found does speed up things significantly, you would follow these steps, depending on version:

wget http://downloads.basho.com/innostore/innostore-1.0.0/innostore-1.0.0.tar.gz
tar xvfz innostore-1.0.0.tar.gz 
cd innostore-1.0.0
make
./rebar install target=/Users/geojeff/Development/riak-0.11.0-osx-x86_64/lib
cd ..
cd riak-0.11.0-osx-x86_64/
cd etc
vi app.config

    Add this within the Riak KV config session, as per Innostore README,

    {storage_backend, riak_kv_innostore_backend},

A nice thing about using Innostore is the way there are individual files for buckets.

ONRTest

In a third terminal window...

Copy OrionNodeRiakDataStore.js from your OrionNodeRiak clone to your ONRTest dir.

Edit wstest.js for developing, sometimes index.html for setting dependencies, if needed.

Browser

Use a recent Safari, Chrome, Firefox, or other websocket-capable browser, to load index.html, which contains script tags in the correct order to load dependencies. At the bottom of the head section is a call to wstest.start(). Have the javascript console open to see messages. (You will also see messages in your OrionNodeRiak terminal window).

onrtest's People

Stargazers

Maurits Lamers avatar

Watchers

Maurits Lamers avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.