service_kiosk 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/kiosk +6 -0
- data/examples/kiosk_mall/Gemfile +2 -0
- data/examples/kiosk_mall/Vagrantfile +25 -0
- data/examples/kiosk_mall/mall/Kioskfile.json +14 -0
- data/examples/kiosk_mall/mall/Rakefile +1 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/9901} +0 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/Gemfile +4 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/Gemfile.lock +32 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/Procfile +0 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/Rakefile +17 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/features/basic-remote.feature +40 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/features/step_definitions/kiosk.rb +1 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/features/step_definitions/kiosk_steps.rb +45 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/lib/hello_world_kiosk.rb +38 -0
- data/examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/output +48 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/Procfile +0 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/Rakefile +7 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/classes/com/countabout/yodlee/kiosk/YodleeUserKiosk.class +0 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/classes/sample/JavaHello.class +0 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/classes/sample/work/JavaHello.class +0 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/features/basic-remote.feature +28 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/features/step_definitions/kiosk.rb +1 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/features/step_definitions/kiosk_steps.rb +45 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/lib/JavaHello.jar +0 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/lib/json-simple-1.1.1.jar +0 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/src/com/countabout/yodlee/kiosk/YodleeUserKiosk.java +47 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/src/sample/JavaHello.java +47 -0
- data/examples/kiosk_mall/mall/kiosks/JavaHello/src/sample/work/JavaHello.java +43 -0
- data/examples/kiosk_mall/mall/log/foreman.log +20 -0
- metadata +29 -1
data/bin/kiosk
CHANGED
@@ -53,6 +53,12 @@ when 'kiosk:run', 'run'
|
|
53
53
|
jruby = `which jruby`.strip
|
54
54
|
exec(env, "#{jruby} #{mall}", :chdir => dir, :unsetenv_others => true)
|
55
55
|
|
56
|
+
when 'create'
|
57
|
+
if ARGV[1]=='mall'
|
58
|
+
require 'fileutils'
|
59
|
+
FileUtils.cp_r gem_dir+"examples/kiosk_mall", "."
|
60
|
+
end
|
61
|
+
|
56
62
|
else
|
57
63
|
puts "Usage: $0 {plaza:init|plaza:up|plaza:down|plaza:ssh|mall:open|mall:close|mall:log}"
|
58
64
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
Vagrant::Config.run do |config|
|
5
|
+
config.vm.box = "precise32"
|
6
|
+
|
7
|
+
#forward kiosk ports
|
8
|
+
|
9
|
+
config.vm.forward_port 9901, 9901
|
10
|
+
config.vm.forward_port 9902, 9902
|
11
|
+
config.vm.forward_port 9903, 9903
|
12
|
+
config.vm.forward_port 9904, 9904
|
13
|
+
config.vm.forward_port 9905, 9905
|
14
|
+
config.vm.forward_port 9906, 9906
|
15
|
+
config.vm.forward_port 9907, 9907
|
16
|
+
config.vm.forward_port 9908, 9908
|
17
|
+
config.vm.forward_port 9909, 9909
|
18
|
+
config.vm.forward_port 9910, 9910
|
19
|
+
|
20
|
+
config.vm.provision :puppet, :module_path => ENV['KIOSK_GEM_DIR'] + "provision/modules" do |puppet|
|
21
|
+
puppet.manifests_path = ENV['KIOSK_GEM_DIR'] + "provision/manifests"
|
22
|
+
puppet.manifest_file = "default.pp"
|
23
|
+
end
|
24
|
+
config.vm.provision :shell, :path => ENV['KIOSK_GEM_DIR'] + "provision/bootstrap.sh"
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'kiosk'
|
File without changes
|
@@ -0,0 +1,32 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
builder (3.2.0)
|
5
|
+
cucumber (1.2.5)
|
6
|
+
builder (>= 2.1.2)
|
7
|
+
diff-lcs (>= 1.1.3)
|
8
|
+
gherkin (~> 2.11.7)
|
9
|
+
multi_json (~> 1.3)
|
10
|
+
diff-lcs (1.2.3)
|
11
|
+
gherkin (2.11.8-java)
|
12
|
+
multi_json (~> 1.3)
|
13
|
+
mime-types (1.22)
|
14
|
+
multi_json (1.7.2)
|
15
|
+
rack (1.5.2)
|
16
|
+
rack-protection (1.5.0)
|
17
|
+
rack
|
18
|
+
rest-client (1.6.7)
|
19
|
+
mime-types (>= 1.16)
|
20
|
+
sinatra (1.4.2)
|
21
|
+
rack (~> 1.5, >= 1.5.2)
|
22
|
+
rack-protection (~> 1.4)
|
23
|
+
tilt (~> 1.3, >= 1.3.4)
|
24
|
+
tilt (1.3.7)
|
25
|
+
|
26
|
+
PLATFORMS
|
27
|
+
java
|
28
|
+
|
29
|
+
DEPENDENCIES
|
30
|
+
cucumber
|
31
|
+
rest-client
|
32
|
+
sinatra
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Dir[File.join("lib", "**/*.rb")].each do |f|
|
2
|
+
require './' + f
|
3
|
+
end
|
4
|
+
|
5
|
+
task :default => [:cucumber]
|
6
|
+
|
7
|
+
task :bundle do
|
8
|
+
system "jruby -S bundle install"
|
9
|
+
end
|
10
|
+
|
11
|
+
task :run do
|
12
|
+
system "jruby -S foreman start"
|
13
|
+
end
|
14
|
+
|
15
|
+
task :remote do
|
16
|
+
exec 'ruby ./lib/hello_world_sinatra.rb'
|
17
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
Feature: Basic Kiosk Resource Operations
|
2
|
+
In order to test and validate the basic operations of a resource in a kiosk
|
3
|
+
As a kiosk client developer
|
4
|
+
I want to be able to call a kiosk and get responses
|
5
|
+
|
6
|
+
Note: Kiosk resource service calls always return a JSON map.
|
7
|
+
Any exceptions thrown come from the infrastructure not working properly.
|
8
|
+
|
9
|
+
Background:
|
10
|
+
Given the kiosk found at 'http://localhost:9901/Toolshed'
|
11
|
+
And the resource 'HelloWorldKiosk' in the kiosk
|
12
|
+
|
13
|
+
Scenario: Basic List Call
|
14
|
+
When the resource's list method is called
|
15
|
+
Then the results include 'greeting' with value 'Hello World'
|
16
|
+
|
17
|
+
Scenario: Error List Call
|
18
|
+
When the resource's list method is called with input '{"attempt": "fail"}'
|
19
|
+
Then the results include '_ERROR_' with value 'TEST ERROR'
|
20
|
+
|
21
|
+
Scenario: Basic Read Call
|
22
|
+
When the resource's read method is called with input '{"id": "4"}'
|
23
|
+
Then the results include 'greeting' with value 'Hello Reader 4'
|
24
|
+
|
25
|
+
Scenario: Basic Create Call
|
26
|
+
When the resource's create method is called with input '{"box": "Top"}'
|
27
|
+
Then the results include 'greeting' with value 'Hello Top'
|
28
|
+
|
29
|
+
Scenario: Basic Update Call
|
30
|
+
When the resource's update method is called with input '{"id": "4", "box": "Lambs"}'
|
31
|
+
Then the results include 'greeting' with value 'Hello Lambs'
|
32
|
+
|
33
|
+
Scenario: Basic Delete Call
|
34
|
+
When the resource's delete method is called with input '{"id": "6"}'
|
35
|
+
Then the results include 'status' with value 'ok'
|
36
|
+
|
37
|
+
Scenario: Basic Custom Call
|
38
|
+
When the resource's fix method is called with input '{"name": "Marty"}'
|
39
|
+
Then the results include 'greeting' with value 'Hello Marty'
|
40
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
require '../../lib/kiosk.rb'
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require '../../lib/kiosk.rb'
|
2
|
+
|
3
|
+
def location(url)
|
4
|
+
endpoint = host + ":" + port(stall)
|
5
|
+
url.sub(":///", "://" + endpoint + '/')
|
6
|
+
end
|
7
|
+
|
8
|
+
def stall
|
9
|
+
/\/([^\/]+)$/.match(`pwd`.rstrip)[1]
|
10
|
+
end
|
11
|
+
|
12
|
+
def host
|
13
|
+
/inet addr:(\S+)/m.match(`ifconfig eth0`)[1]
|
14
|
+
end
|
15
|
+
|
16
|
+
def port(input)
|
17
|
+
File.read('../../Procfile').split("\n").each do |line|
|
18
|
+
if(line.match(input))
|
19
|
+
result = /PORT=(\d+)/.match(line)
|
20
|
+
return result[1]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
return ''
|
24
|
+
end
|
25
|
+
|
26
|
+
Given(/^the kiosk found at '(.*?)'$/) do |url|
|
27
|
+
ServiceKiosk::Kiosk.register('the_kiosk', location(url))
|
28
|
+
@kiosk = ServiceKiosk::Kiosk.open('the_kiosk')
|
29
|
+
end
|
30
|
+
|
31
|
+
Given(/^the resource '(.*?)' in the kiosk$/) do |name|
|
32
|
+
@resource = @kiosk.service(name)
|
33
|
+
end
|
34
|
+
|
35
|
+
When(/^the resource's (\S+) method is called$/) do |action|
|
36
|
+
@result = @resource.call(action, {})
|
37
|
+
end
|
38
|
+
|
39
|
+
When(/^the resource's (\S+) method is called with input '(.*?)'$/) do |action, input|
|
40
|
+
@result = @resource.call(action, JSON.parse(input))
|
41
|
+
end
|
42
|
+
|
43
|
+
Then(/^the results include '(.*?)' with value '(.*?)'$/) do |key, value|
|
44
|
+
@result[key].should == value
|
45
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Toolshed
|
2
|
+
class HelloWorldKiosk
|
3
|
+
def fix(input={})
|
4
|
+
puts ">>> hwk.fix: #{input.inspect}"
|
5
|
+
{'greeting' => 'Hello ' + input['name'] }
|
6
|
+
end
|
7
|
+
|
8
|
+
def list(input=nil)
|
9
|
+
puts ">>> hwk.list: #{input.inspect}"
|
10
|
+
if input.nil? || input.empty?
|
11
|
+
{'greeting' => 'Hello World'}
|
12
|
+
elsif input['q']
|
13
|
+
{'greeting' => 'Hello ' + input['q']}
|
14
|
+
elsif input['attempt']
|
15
|
+
raise 'TEST ERROR'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def read(input={})
|
20
|
+
id = input['id']
|
21
|
+
puts ">>>>hwk: id=#{id}, input=#{input.inspect}"
|
22
|
+
{'greeting' => 'Hello Reader ' + id}
|
23
|
+
end
|
24
|
+
|
25
|
+
def create(input={})
|
26
|
+
puts ">>> helloworld create input " + input.inspect
|
27
|
+
{'greeting' => 'Hello ' + input['box'] }
|
28
|
+
end
|
29
|
+
|
30
|
+
def update(input={})
|
31
|
+
{'greeting' => 'Hello ' + input['box'] }
|
32
|
+
end
|
33
|
+
|
34
|
+
def delete(input={})
|
35
|
+
{'status' => 'ok'}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
Feature: Basic Kiosk Resource Operations
|
2
|
+
In order to test and validate the basic operations of a resource in a kiosk
|
3
|
+
As a kiosk client developer
|
4
|
+
I want to be able to call a kiosk and get responses
|
5
|
+
|
6
|
+
Note: Kiosk resource service calls always return a JSON map.
|
7
|
+
Any exceptions thrown come from the infrastructure not working properly.
|
8
|
+
|
9
|
+
Background:
|
10
|
+
Given the kiosk found at 'http://localhost:9901/Toolshed'
|
11
|
+
And the resource 'HelloWorldKiosk' in the kiosk
|
12
|
+
|
13
|
+
Scenario: Basic List Call
|
14
|
+
>>> url: http://10.0.2.15:9901/Toolshed/HelloWorldKiosk
|
15
|
+
When the resource's list method is called
|
16
|
+
Then the results include 'greeting' with value 'Hello World'
|
17
|
+
|
18
|
+
Scenario: Error List Call
|
19
|
+
>>> url: http://10.0.2.15:9901/Toolshed/HelloWorldKiosk?data=%7B%22attempt%22%3A%22fail%22%7D
|
20
|
+
When the resource's list method is called with input '{"attempt": "fail"}'
|
21
|
+
Then the results include '_ERROR_' with value 'TEST ERROR'
|
22
|
+
|
23
|
+
Scenario: Basic Read Call
|
24
|
+
When the resource's read resource '4' method is called
|
25
|
+
Then the results include 'greeting' with value 'Hello Reader 4'
|
26
|
+
|
27
|
+
Scenario: Basic Create Call
|
28
|
+
When the resource's create method is called with input '{"box": "Top"}'
|
29
|
+
Then the results include 'greeting' with value 'Hello Top'
|
30
|
+
expected: "Hello Top"
|
31
|
+
got: nil (using ==) (RSpec::Expectations::ExpectationNotMetError)
|
32
|
+
./features/step_definitions/kiosk_steps.rb:60:in `/^the results include '(.*?)' with value '(.*?)'$/'
|
33
|
+
features/basic-remote.feature:27:in `Then the results include 'greeting' with value 'Hello Top''
|
34
|
+
|
35
|
+
Scenario: Basic Update Call
|
36
|
+
When the resource's update resource '4' method is called with input '{"box": "Lambs"}'
|
37
|
+
Then the results include 'greeting' with value 'Hello Lambs'
|
38
|
+
|
39
|
+
Scenario: Basic Delete Call
|
40
|
+
When the resource's delete resource '6' method is called
|
41
|
+
Then the results include 'status' with value 'ok'
|
42
|
+
|
43
|
+
Failing Scenarios:
|
44
|
+
cucumber features/basic-remote.feature:25
|
45
|
+
|
46
|
+
6 scenarios (1 failed, 5 passed)
|
47
|
+
24 steps (1 failed, 23 passed)
|
48
|
+
0m0.663s
|
File without changes
|
@@ -0,0 +1,7 @@
|
|
1
|
+
task :cc do
|
2
|
+
system "javac -sourcepath src -d classes src/com/countabout/yodlee/kiosk/YodleeUserKiosk.java src/sample/JavaHello.java src/sample/work/JavaHello.java"
|
3
|
+
end
|
4
|
+
|
5
|
+
task :jar do
|
6
|
+
system "cd classes; jar cf ../lib/JavaHello.jar com/countabout/yodlee/kiosk/YodleeUserKiosk.class sample/JavaHello.class sample/work/JavaHello.class"
|
7
|
+
end
|
Binary file
|
Binary file
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Feature: Hello Worlds
|
2
|
+
In order to see the kiosk system work with a remote kiosk
|
3
|
+
As a kiosk client developer
|
4
|
+
I want to be able to call a remote kiosk and get a response
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given the kiosk found at 'http:///com.countabout.yodlee.kiosk'
|
8
|
+
And the resource 'YodleeUserKiosk' in the kiosk
|
9
|
+
|
10
|
+
Scenario: Basic Remote List Call
|
11
|
+
When the resource's list method is called
|
12
|
+
Then the results include 'greeting' with value 'Hello World'
|
13
|
+
|
14
|
+
Scenario: Basic Remote Read Call
|
15
|
+
When the resource's read method is called with input '{"id": "4"}'
|
16
|
+
Then the results include 'greeting' with value 'Hello Reader 4'
|
17
|
+
|
18
|
+
Scenario: Basic Remote Create Call
|
19
|
+
When the resource's create method is called with input '{"box": "Top"}'
|
20
|
+
Then the results include 'greeting' with value 'Hello Top'
|
21
|
+
|
22
|
+
Scenario: Basic Remote Update Call
|
23
|
+
When the resource's update method is called with input '{"id": "4", "box": "Lambs"}'
|
24
|
+
Then the results include 'greeting' with value 'Hello Lambs'
|
25
|
+
|
26
|
+
Scenario: Basic Delete Call
|
27
|
+
When the resource's delete method is called with input '{"id": "6"}'
|
28
|
+
Then the results include 'status' with value 'ok'
|
@@ -0,0 +1 @@
|
|
1
|
+
require '../../lib/kiosk.rb'
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require '../../lib/kiosk.rb'
|
2
|
+
|
3
|
+
def location(url)
|
4
|
+
endpoint = host + ":" + port(stall)
|
5
|
+
url.sub(":///", "://" + endpoint + '/')
|
6
|
+
end
|
7
|
+
|
8
|
+
def stall
|
9
|
+
/\/([^\/]+)$/.match(`pwd`.rstrip)[1]
|
10
|
+
end
|
11
|
+
|
12
|
+
def host
|
13
|
+
/inet addr:(\S+)/m.match(`ifconfig eth0`)[1]
|
14
|
+
end
|
15
|
+
|
16
|
+
def port(input)
|
17
|
+
File.read('../../Procfile').split("\n").each do |line|
|
18
|
+
if(line.match(input))
|
19
|
+
result = /PORT=(\d+)/.match(line)
|
20
|
+
return result[1]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
return ''
|
24
|
+
end
|
25
|
+
|
26
|
+
Given(/^the kiosk found at '(.*?)'$/) do |url|
|
27
|
+
ServiceKiosk::Kiosk.register('the_kiosk', location(url))
|
28
|
+
@kiosk = ServiceKiosk::Kiosk.open('the_kiosk')
|
29
|
+
end
|
30
|
+
|
31
|
+
Given(/^the resource '(.*?)' in the kiosk$/) do |name|
|
32
|
+
@resource = @kiosk.service(name)
|
33
|
+
end
|
34
|
+
|
35
|
+
When(/^the resource's (\S+) method is called$/) do |action|
|
36
|
+
@result = @resource.call(action, {})
|
37
|
+
end
|
38
|
+
|
39
|
+
When(/^the resource's (\S+) method is called with input '(.*?)'$/) do |action, input|
|
40
|
+
@result = @resource.call(action, JSON.parse(input))
|
41
|
+
end
|
42
|
+
|
43
|
+
Then(/^the results include '(.*?)' with value '(.*?)'$/) do |key, value|
|
44
|
+
@result[key].should == value
|
45
|
+
end
|
Binary file
|
Binary file
|
data/examples/kiosk_mall/mall/kiosks/JavaHello/src/com/countabout/yodlee/kiosk/YodleeUserKiosk.java
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
package com.countabout.yodlee.kiosk;
|
2
|
+
|
3
|
+
import java.util.LinkedHashMap;
|
4
|
+
import java.util.Map;
|
5
|
+
|
6
|
+
public class YodleeUserKiosk {
|
7
|
+
public Map list(Map input) {
|
8
|
+
System.out.println(">>> jh.list: " );
|
9
|
+
Map result = new LinkedHashMap();
|
10
|
+
if(input!=null && input.containsKey("q")) {
|
11
|
+
result.put("greeting", "Hello " + input.get("q"));
|
12
|
+
} else {
|
13
|
+
result.put("greeting", "Hello World");
|
14
|
+
}
|
15
|
+
return result;
|
16
|
+
}
|
17
|
+
|
18
|
+
public Map read(Map input) {
|
19
|
+
Map result = new LinkedHashMap();
|
20
|
+
String id = (String) input.get("id");
|
21
|
+
result.put("greeting", "Hello Reader " + id);
|
22
|
+
return result;
|
23
|
+
}
|
24
|
+
|
25
|
+
public Map create(Map input) {
|
26
|
+
Map result = new LinkedHashMap();
|
27
|
+
result.put("greeting", "Hello " + input.get("box"));
|
28
|
+
return result;
|
29
|
+
}
|
30
|
+
|
31
|
+
public Map update(Map input) {
|
32
|
+
Map result = new LinkedHashMap();
|
33
|
+
String id = (String) input.get("id");
|
34
|
+
result.put("greeting", "Hello " + input.get("box"));
|
35
|
+
return result;
|
36
|
+
}
|
37
|
+
|
38
|
+
public Map delete(Map input) {
|
39
|
+
Map result = new LinkedHashMap();
|
40
|
+
String id = (String) input.get("id");
|
41
|
+
result.put("status", "ok");
|
42
|
+
return result;
|
43
|
+
}
|
44
|
+
|
45
|
+
public static void main(String args[]) {
|
46
|
+
}
|
47
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
package sample;
|
2
|
+
|
3
|
+
import java.util.LinkedHashMap;
|
4
|
+
import java.util.Map;
|
5
|
+
|
6
|
+
public class JavaHello {
|
7
|
+
public Map list(Map input) {
|
8
|
+
System.out.println(">>> jh.list: " );
|
9
|
+
Map result = new LinkedHashMap();
|
10
|
+
if(input!=null && input.containsKey("q")) {
|
11
|
+
result.put("greeting", "Hello " + input.get("q"));
|
12
|
+
} else {
|
13
|
+
result.put("greeting", "Hello World");
|
14
|
+
}
|
15
|
+
return result;
|
16
|
+
}
|
17
|
+
|
18
|
+
public Map read(Map input) {
|
19
|
+
Map result = new LinkedHashMap();
|
20
|
+
String id = (String) input.get("id");
|
21
|
+
result.put("greeting", "Hello Reader " + id);
|
22
|
+
return result;
|
23
|
+
}
|
24
|
+
|
25
|
+
public Map create(Map input) {
|
26
|
+
Map result = new LinkedHashMap();
|
27
|
+
result.put("greeting", "Hello " + input.get("box"));
|
28
|
+
return result;
|
29
|
+
}
|
30
|
+
|
31
|
+
public Map update(Map input) {
|
32
|
+
Map result = new LinkedHashMap();
|
33
|
+
String id = (String) input.get("id");
|
34
|
+
result.put("greeting", "Hello " + input.get("box"));
|
35
|
+
return result;
|
36
|
+
}
|
37
|
+
|
38
|
+
public Map delete(Map input) {
|
39
|
+
Map result = new LinkedHashMap();
|
40
|
+
String id = (String) input.get("id");
|
41
|
+
result.put("status", "ok");
|
42
|
+
return result;
|
43
|
+
}
|
44
|
+
|
45
|
+
public static void main(String args[]) {
|
46
|
+
}
|
47
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
package sample.work;
|
2
|
+
|
3
|
+
import java.util.LinkedHashMap;
|
4
|
+
import java.util.Map;
|
5
|
+
|
6
|
+
public class JavaHello {
|
7
|
+
public Map list(Map input) {
|
8
|
+
Map result = new LinkedHashMap();
|
9
|
+
if(input!=null && input.containsKey("q")) {
|
10
|
+
result.put("greeting", "Hello " + input.get("q"));
|
11
|
+
} else {
|
12
|
+
result.put("greeting", "Hello World");
|
13
|
+
}
|
14
|
+
return result;
|
15
|
+
}
|
16
|
+
|
17
|
+
public Map read(String id, Map input) {
|
18
|
+
Map result = new LinkedHashMap();
|
19
|
+
result.put("greeting", "Hello Reader " + id);
|
20
|
+
return result;
|
21
|
+
}
|
22
|
+
|
23
|
+
public Map create(Map input) {
|
24
|
+
Map result = new LinkedHashMap();
|
25
|
+
result.put("greeting", "Hello " + input.get("box"));
|
26
|
+
return result;
|
27
|
+
}
|
28
|
+
|
29
|
+
public Map update(String id, Map input) {
|
30
|
+
Map result = new LinkedHashMap();
|
31
|
+
result.put("greeting", "Hello " + input.get("box"));
|
32
|
+
return result;
|
33
|
+
}
|
34
|
+
|
35
|
+
public Map delete(String id) {
|
36
|
+
Map result = new LinkedHashMap();
|
37
|
+
result.put("status", "ok");
|
38
|
+
return result;
|
39
|
+
}
|
40
|
+
|
41
|
+
public static void main(String args[]) {
|
42
|
+
}
|
43
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
22:06:15 HelloWorldKiosk.1 | started with pid 16255
|
2
|
+
22:06:15 JavaHello.1 | started with pid 16257
|
3
|
+
22:06:16 JavaHello.1 | env: {"KIOSK_PORT"=>"8002"}
|
4
|
+
22:06:16 JavaHello.1 | mall: /var/lib/gems/1.9.1/gems/service_kiosk-0.2.0/lib/mall.rb
|
5
|
+
22:06:16 JavaHello.1 | dir: /vagrant/mall/kiosks/JavaHello
|
6
|
+
22:06:16 HelloWorldKiosk.1 | env: {"KIOSK_PORT"=>"8001"}
|
7
|
+
22:06:16 HelloWorldKiosk.1 | mall: /var/lib/gems/1.9.1/gems/service_kiosk-0.2.0/lib/mall.rb
|
8
|
+
22:06:16 HelloWorldKiosk.1 | dir: /vagrant/mall/kiosks/HelloWorldKiosk
|
9
|
+
22:06:27 JavaHello.1 | [2013-06-11 22:06:27] INFO WEBrick 1.3.1
|
10
|
+
22:06:27 JavaHello.1 | [2013-06-11 22:06:27] INFO ruby 1.9.3 (2013-02-21) [java]
|
11
|
+
22:06:27 JavaHello.1 | == Sinatra/1.4.2 has taken the stage on 8002 for development with backup from WEBrick
|
12
|
+
22:06:27 JavaHello.1 | [2013-06-11 22:06:27] INFO WEBrick::HTTPServer#start: pid=16261 port=8002
|
13
|
+
22:06:28 HelloWorldKiosk.1 | [2013-06-11 22:06:28] INFO WEBrick 1.3.1
|
14
|
+
22:06:28 HelloWorldKiosk.1 | [2013-06-11 22:06:28] INFO ruby 1.9.3 (2013-02-21) [java]
|
15
|
+
22:06:28 HelloWorldKiosk.1 | == Sinatra/1.4.2 has taken the stage on 8001 for development with backup from WEBrick
|
16
|
+
22:06:28 HelloWorldKiosk.1 | [2013-06-11 22:06:28] INFO WEBrick::HTTPServer#start: pid=16260 port=8001
|
17
|
+
SIGTERM received
|
18
|
+
22:07:28 system | sending SIGTERM to all processes
|
19
|
+
22:07:28 JavaHello.1 | terminated by SIGTERM
|
20
|
+
22:07:28 HelloWorldKiosk.1 | terminated by SIGTERM
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: service_kiosk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -278,6 +278,34 @@ files:
|
|
278
278
|
- provision/modules/stdlib/tests/has_ip_address.pp
|
279
279
|
- provision/modules/stdlib/tests/has_ip_network.pp
|
280
280
|
- provision/modules/stdlib/tests/init.pp
|
281
|
+
- examples/kiosk_mall/Gemfile
|
282
|
+
- examples/kiosk_mall/mall/Kioskfile.json
|
283
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/9901}
|
284
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/features/basic-remote.feature
|
285
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/features/step_definitions/kiosk.rb
|
286
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/features/step_definitions/kiosk_steps.rb
|
287
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/Gemfile
|
288
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/Gemfile.lock
|
289
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/lib/hello_world_kiosk.rb
|
290
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/output
|
291
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/Procfile
|
292
|
+
- examples/kiosk_mall/mall/kiosks/HelloWorldKiosk/Rakefile
|
293
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/classes/com/countabout/yodlee/kiosk/YodleeUserKiosk.class
|
294
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/classes/sample/JavaHello.class
|
295
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/classes/sample/work/JavaHello.class
|
296
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/features/basic-remote.feature
|
297
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/features/step_definitions/kiosk.rb
|
298
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/features/step_definitions/kiosk_steps.rb
|
299
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/lib/JavaHello.jar
|
300
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/lib/json-simple-1.1.1.jar
|
301
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/Procfile
|
302
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/Rakefile
|
303
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/src/com/countabout/yodlee/kiosk/YodleeUserKiosk.java
|
304
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/src/sample/JavaHello.java
|
305
|
+
- examples/kiosk_mall/mall/kiosks/JavaHello/src/sample/work/JavaHello.java
|
306
|
+
- examples/kiosk_mall/mall/log/foreman.log
|
307
|
+
- examples/kiosk_mall/mall/Rakefile
|
308
|
+
- examples/kiosk_mall/Vagrantfile
|
281
309
|
- Vagrantfile
|
282
310
|
- lib/tasks/local_mall.rake
|
283
311
|
homepage: http://github.com/akw/service_kiosk
|