pione 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.s3cfg +42 -0
- data/.travis.yml +18 -4
- data/.yardopts +1 -0
- data/Gemfile +3 -0
- data/History.txt +14 -0
- data/Procfile +7 -0
- data/Rakefile +25 -0
- data/bin/pione-interactive +6 -0
- data/bin/{pione-compiler → pione-notification-listener} +1 -1
- data/bin/{pione-broker → pione-task-worker-broker} +1 -1
- data/doc/man/pione-list-param.md +36 -0
- data/example/ActionError/ActionError.pione +9 -0
- data/example/ActionError/pione-package.json +15 -0
- data/example/CountChar/CountChar.pione +1 -1
- data/example/ScoreAggregation/ScoreAggregation.pione +1 -1
- data/example/Touch/pione-package.json +15 -0
- data/lib/pione.rb +12 -0
- data/lib/pione/agent.rb +3 -3
- data/lib/pione/agent/basic-agent.rb +10 -4
- data/lib/pione/agent/input-generator.rb +3 -3
- data/lib/pione/agent/{process-manager.rb → job-manager.rb} +10 -7
- data/lib/pione/agent/job-terminator.rb +2 -2
- data/lib/pione/agent/logger.rb +3 -3
- data/lib/pione/agent/messenger.rb +20 -9
- data/lib/pione/agent/notification-listener.rb +88 -0
- data/lib/pione/agent/task-worker-broker.rb +84 -0
- data/lib/pione/agent/task-worker.rb +3 -2
- data/lib/pione/agent/tuple-space-client.rb +1 -0
- data/lib/pione/agent/tuple-space-provider.rb +17 -35
- data/lib/pione/command.rb +33 -15
- data/lib/pione/command/action.rb +105 -0
- data/lib/pione/command/basic-command.rb +34 -376
- data/lib/pione/command/command-exception.rb +12 -11
- data/lib/pione/command/common.rb +198 -0
- data/lib/pione/command/option.rb +159 -204
- data/lib/pione/command/pione-action-exec.rb +85 -0
- data/lib/pione/command/pione-action-list.rb +43 -19
- data/lib/pione/command/pione-action-print.rb +79 -0
- data/lib/pione/command/pione-action.rb +8 -67
- data/lib/pione/command/pione-clean.rb +88 -68
- data/lib/pione/command/pione-client.rb +475 -332
- data/lib/pione/command/pione-command.rb +14 -31
- data/lib/pione/command/pione-compile.rb +90 -0
- data/lib/pione/command/pione-config-get.rb +53 -0
- data/lib/pione/command/pione-config-list.rb +64 -0
- data/lib/pione/command/pione-config-set.rb +59 -0
- data/lib/pione/command/pione-config-unset.rb +50 -0
- data/lib/pione/command/pione-config.rb +61 -0
- data/lib/pione/command/pione-diagnosis-notification.rb +235 -0
- data/lib/pione/command/pione-diagnosis.rb +21 -0
- data/lib/pione/command/pione-interactive.rb +188 -0
- data/lib/pione/command/pione-lang-check-syntax.rb +163 -0
- data/lib/pione/command/pione-lang-interactive.rb +146 -0
- data/lib/pione/command/pione-lang.rb +22 -0
- data/lib/pione/command/pione-log-format.rb +163 -0
- data/lib/pione/command/pione-log-list-id.rb +48 -0
- data/lib/pione/command/pione-log.rb +19 -101
- data/lib/pione/command/pione-notification-listener.rb +95 -0
- data/lib/pione/command/pione-package-add.rb +137 -0
- data/lib/pione/command/pione-package-build.rb +122 -0
- data/lib/pione/command/pione-package-show.rb +96 -0
- data/lib/pione/command/pione-package-update.rb +59 -0
- data/lib/pione/command/pione-package.rb +11 -139
- data/lib/pione/command/pione-task-worker-broker.rb +88 -0
- data/lib/pione/command/pione-task-worker.rb +148 -98
- data/lib/pione/command/pione-tuple-space-provider.rb +62 -54
- data/lib/pione/command/pione-tuple-space-viewer.rb +105 -83
- data/lib/pione/command/pione-val.rb +39 -39
- data/lib/pione/command/spawner.rb +34 -27
- data/lib/pione/front.rb +4 -2
- data/lib/pione/front/basic-front.rb +86 -23
- data/lib/pione/front/client-front.rb +2 -2
- data/lib/pione/front/diagnosis-notification-front.rb +40 -0
- data/lib/pione/front/front-exception.rb +7 -1
- data/lib/pione/front/notification-listener-front.rb +36 -0
- data/lib/pione/front/notification-recipient-interface.rb +19 -0
- data/lib/pione/front/relay-front.rb +4 -4
- data/lib/pione/front/task-worker-broker-front.rb +19 -0
- data/lib/pione/front/task-worker-front.rb +2 -2
- data/lib/pione/front/tuple-space-provider-front.rb +3 -2
- data/lib/pione/global.rb +3 -1
- data/lib/pione/global/client-variable.rb +1 -1
- data/lib/pione/global/config.rb +63 -7
- data/lib/pione/global/diagnosis-variable.rb +26 -0
- data/lib/pione/global/item.rb +28 -5
- data/lib/pione/global/log-variable.rb +6 -5
- data/lib/pione/global/network-variable.rb +75 -4
- data/lib/pione/global/path-variable.rb +1 -1
- data/lib/pione/global/system-variable.rb +12 -12
- data/lib/pione/global/task-worker-broker-variable.rb +43 -0
- data/lib/pione/global/tuple-space-notifier-variable.rb +3 -55
- data/lib/pione/lang/boolean.rb +4 -0
- data/lib/pione/lang/data-expr.rb +1 -1
- data/lib/pione/lang/integer.rb +1 -1
- data/lib/pione/lang/string.rb +4 -0
- data/lib/pione/lang/type.rb +1 -1
- data/lib/pione/location.rb +1 -0
- data/lib/pione/location/data-location.rb +41 -13
- data/lib/pione/location/dropbox-location.rb +175 -56
- data/lib/pione/location/ftp-location.rb +4 -1
- data/lib/pione/location/http-location.rb +5 -3
- data/lib/pione/location/https-location.rb +4 -2
- data/lib/pione/location/local-location.rb +6 -3
- data/lib/pione/location/location-exception.rb +12 -0
- data/lib/pione/location/notification-scheme.rb +46 -0
- data/lib/pione/log.rb +8 -7
- data/lib/pione/log/debug.rb +9 -9
- data/lib/pione/log/domain-log.rb +6 -1
- data/lib/pione/log/message-log-receiver.rb +32 -0
- data/lib/pione/log/system-log.rb +62 -141
- data/lib/pione/model.rb +7 -0
- data/lib/pione/model/notification-listener-model.rb +29 -0
- data/lib/pione/model/task-worker-broker-model.rb +129 -0
- data/lib/pione/notification.rb +13 -0
- data/lib/pione/notification/address.rb +104 -0
- data/lib/pione/notification/exception.rb +10 -0
- data/lib/pione/notification/message.rb +109 -0
- data/lib/pione/notification/receiver.rb +90 -0
- data/lib/pione/notification/recipient.rb +68 -0
- data/lib/pione/notification/task-worker-broker-recipient.rb +85 -0
- data/lib/pione/notification/transmitter.rb +84 -0
- data/lib/pione/pnml.rb +35 -0
- data/lib/pione/pnml/annotation-extractor.rb +47 -0
- data/lib/pione/pnml/compiler.rb +176 -0
- data/lib/pione/pnml/input-merge-complement.rb +78 -0
- data/lib/pione/pnml/input-parallelization-complement.rb +75 -0
- data/lib/pione/pnml/input-reduction.rb +80 -0
- data/lib/pione/pnml/invalid-arc-elimination.rb +41 -0
- data/lib/pione/pnml/io-expansion.rb +88 -0
- data/lib/pione/pnml/isolated-element-elimination.rb +32 -0
- data/lib/pione/pnml/net-rewriter.rb +44 -0
- data/lib/pione/pnml/output-decomposition-complement.rb +77 -0
- data/lib/pione/pnml/output-reduction.rb +86 -0
- data/lib/pione/pnml/output-synchronization-complement.rb +77 -0
- data/lib/pione/pnml/pione-model.rb +417 -0
- data/lib/pione/pnml/pnml-exception.rb +23 -0
- data/lib/pione/pnml/pnml-model.rb +368 -0
- data/lib/pione/pnml/reader.rb +51 -0
- data/lib/pione/rule-engine/action-handler.rb +8 -6
- data/lib/pione/rule-engine/basic-handler.rb +5 -5
- data/lib/pione/rule-engine/engine-exception.rb +7 -6
- data/lib/pione/rule-engine/flow-handler.rb +27 -18
- data/lib/pione/system.rb +3 -1
- data/lib/pione/system/domain-dump.rb +34 -0
- data/lib/pione/system/file-cache.rb +92 -13
- data/lib/pione/system/init.rb +3 -0
- data/lib/pione/system/normalizer.rb +40 -0
- data/lib/pione/system/status.rb +5 -5
- data/lib/pione/system/system-exception.rb +14 -1
- data/lib/pione/task-worker-broker.rb +7 -0
- data/lib/pione/task-worker-broker/basic-provider.rb +20 -0
- data/lib/pione/task-worker-broker/easy-provider.rb +65 -0
- data/lib/pione/test-helper.rb +27 -0
- data/lib/pione/test-helper/command-helper.rb +9 -101
- data/lib/pione/tuple-space/basic-tuple.rb +1 -1
- data/lib/pione/tuple-space/tuple-definition.yml +4 -6
- data/lib/pione/tuple-space/tuple-space-interface.rb +3 -45
- data/lib/pione/tuple-space/tuple-space-server.rb +45 -0
- data/lib/pione/util.rb +1 -2
- data/lib/pione/util/boolean-value.rb +62 -0
- data/lib/pione/util/completion.rb +111 -0
- data/lib/pione/util/evaluatable.rb +13 -27
- data/lib/pione/util/package-parameters-list.rb +15 -27
- data/lib/pione/util/zip.rb +8 -3
- data/lib/pione/version.rb +1 -1
- data/lib/rootage.rb +20 -0
- data/lib/rootage/action.rb +114 -0
- data/lib/rootage/argument.rb +46 -0
- data/lib/rootage/command.rb +218 -0
- data/lib/rootage/core.rb +532 -0
- data/lib/rootage/exception.rb +107 -0
- data/lib/rootage/help.rb +148 -0
- data/lib/rootage/help.txt.erb +31 -0
- data/lib/rootage/log.rb +226 -0
- data/lib/rootage/normalizer.rb +184 -0
- data/lib/rootage/option.rb +152 -0
- data/lib/rootage/scenario-test-result.erb +39 -0
- data/lib/rootage/scenario.rb +362 -0
- data/lib/rootage/test-helper.rb +115 -0
- data/man/pione-list-param.1 +44 -0
- data/misc/clock.rb +9 -0
- data/misc/machine-info.sh +21 -0
- data/misc/pione-completion.bash +238 -0
- data/misc/pione-completion.erb +53 -0
- data/misc/pione-completion.zsh +238 -0
- data/misc/pione.god +22 -0
- data/misc/ui.xml +23 -0
- data/pione.gemspec +3 -1
- data/test/agent/spec_basic-agent.rb +1 -1
- data/test/agent/spec_input-generator.rb +2 -2
- data/test/agent/spec_messenger.rb +6 -9
- data/test/agent/spec_notification-listener.rb +80 -0
- data/test/agent/{spec_broker.rb → spec_task-worker-broker.rb} +13 -10
- data/test/agent/spec_tuple-space-provider.rb +10 -6
- data/test/command/command-behavior.rb +3 -11
- data/test/command/data/pione-list-param/AdvancedParameters.pione +12 -0
- data/test/command/data/pione-list-param/BasicParameters.pione +12 -0
- data/test/command/spec_pione-action-exec.rb +16 -0
- data/test/command/spec_pione-action-list.rb +15 -10
- data/test/command/spec_pione-action-print.rb +14 -0
- data/test/command/spec_pione-action.rb +6 -19
- data/test/command/spec_pione-clean.rb +29 -46
- data/test/command/spec_pione-client.rb +29 -36
- data/test/command/spec_pione-command.rb +6 -6
- data/test/command/{spec_pione-compiler.rb → spec_pione-compile.rb} +11 -13
- data/test/command/spec_pione-config-get.rb +47 -0
- data/test/command/spec_pione-config-list.rb +42 -0
- data/test/command/spec_pione-config-set.rb +38 -0
- data/test/command/spec_pione-config-unset.rb +44 -0
- data/test/command/spec_pione-config.rb +11 -0
- data/test/command/spec_pione-diagnosis-notification.rb +23 -0
- data/test/command/spec_pione-diagnosis.rb +11 -0
- data/test/command/spec_pione-lang-check-syntax.rb +12 -0
- data/test/command/spec_pione-lang.rb +11 -0
- data/test/command/spec_pione-log-format.rb +29 -0
- data/test/command/spec_pione-log-list-id.rb +17 -0
- data/test/command/spec_pione-log.rb +6 -20
- data/test/command/spec_pione-package-add.rb +55 -0
- data/test/command/spec_pione-package-build.rb +57 -0
- data/test/command/spec_pione-package-show.rb +72 -0
- data/test/command/{spec_pione-update-package-info.rb → spec_pione-package-update.rb} +12 -13
- data/test/command/spec_pione-package.rb +4 -104
- data/test/command/spec_pione-val.rb +10 -7
- data/test/global/spec_config.rb +50 -0
- data/test/global/spec_item.rb +1 -1
- data/test/literate-action/data/HelloWorld.md +1 -1
- data/test/location/location-behavior.rb +1 -1
- data/test/location/spec_dropbox-location.rb +39 -0
- data/test/location/spec_notification-scheme.rb +37 -0
- data/test/log/spec_debug.rb +5 -4
- data/test/log/spec_message-log-receiver.rb +13 -0
- data/test/log/spec_message-log.rb +6 -9
- data/test/log/spec_system-log.rb +5 -3
- data/test/notification/spec_address.rb +229 -0
- data/test/notification/spec_message.rb +30 -0
- data/test/notification/spec_receiver.rb +36 -0
- data/test/notification/spec_transmitter.rb +37 -0
- data/test/pnml/data/ConditionalBranchIf.pnml +270 -0
- data/test/pnml/data/ConditionalBranchIfElse.pnml +309 -0
- data/test/pnml/data/IOExpansionComplex.pnml +363 -0
- data/test/pnml/data/IOExpansionSimple.pnml +140 -0
- data/test/pnml/data/InputMergeComplementComplex.pnml +381 -0
- data/test/pnml/data/InputMergeComplementSimple.pnml +248 -0
- data/test/pnml/data/InputParallelizationComplementComplex.pnml +433 -0
- data/test/pnml/data/InputParallelizationComplementSimple.pnml +288 -0
- data/test/pnml/data/InputReductionComplex.pnml +192 -0
- data/test/pnml/data/InputReductionLong.pnml +344 -0
- data/test/pnml/data/InputReductionSimple.pnml +140 -0
- data/test/pnml/data/IsolatedElementElimination.pnml +171 -0
- data/test/pnml/data/OutputDecompositionComplementComplex.pnml +381 -0
- data/test/pnml/data/OutputDecompositionComplementSimple.pnml +242 -0
- data/test/pnml/data/OutputReductionComplex.pnml +186 -0
- data/test/pnml/data/OutputReductionLong.pnml +344 -0
- data/test/pnml/data/OutputReductionSimple.pnml +140 -0
- data/test/pnml/data/OutputSynchronizationComplementComplex.pnml +498 -0
- data/test/pnml/data/OutputSynchronizationComplementSimple.pnml +347 -0
- data/test/pnml/data/SampleNet.pnml +238 -0
- data/test/pnml/spec_input-merge-complement.rb +40 -0
- data/test/pnml/spec_input-parallelization-complement.rb +50 -0
- data/test/pnml/spec_input-reduction.rb +113 -0
- data/test/pnml/spec_invalid-arc-elimination.rb +33 -0
- data/test/pnml/spec_io-expansion.rb +126 -0
- data/test/pnml/spec_isolated-element-elimination.rb +25 -0
- data/test/pnml/spec_output-decomposition-complement.rb +40 -0
- data/test/pnml/spec_output-reduction.rb +114 -0
- data/test/pnml/spec_output-synchronization-complement.rb +62 -0
- data/test/pnml/spec_pione-element.rb +144 -0
- data/test/pnml/spec_pnml-element.rb +373 -0
- data/test/pnml/spec_reader.rb +16 -0
- data/test/rootage/spec_argument.rb +18 -0
- data/test/rootage/spec_command.rb +239 -0
- data/test/rootage/spec_core.rb +198 -0
- data/test/rootage/spec_scenario.rb +149 -0
- data/test/system/{spec_domain-info.rb → spec_domain-dump.rb} +6 -6
- data/test/system/spec_file-cache.rb +6 -9
- data/test/tuple-space/spec_finished-tuple.rb +1 -1
- data/test/util/{spec_package-parameters-list_1.pione → data/package-parameters-list/Param1.pione} +0 -0
- data/test/util/{spec_package-parameters-list_2.pione → data/package-parameters-list/Param2.pione} +0 -0
- data/test/util/{spec_package-parameters-list_3.pione → data/package-parameters-list/Param3.pione} +0 -0
- data/test/util/{spec_package-parameters-list_4.pione → data/package-parameters-list/Param4.pione} +0 -0
- data/test/util/spec_boolean-value.rb +32 -0
- data/test/util/spec_completion.rb +22 -0
- data/test/util/spec_package-parameters-list.rb +39 -52
- data/test/util/spec_zip.rb +28 -1
- metadata +288 -47
- data/bin/pione-tuple-space-receiver +0 -5
- data/lib/pione/agent/broker.rb +0 -304
- data/lib/pione/agent/tuple-space-receiver.rb +0 -137
- data/lib/pione/command/pione-broker.rb +0 -104
- data/lib/pione/command/pione-compiler.rb +0 -57
- data/lib/pione/command/pione-relay-account-db.rb +0 -141
- data/lib/pione/command/pione-relay-client-db.rb +0 -118
- data/lib/pione/command/pione-relay.rb +0 -59
- data/lib/pione/command/pione-syntax-checker.rb +0 -214
- data/lib/pione/command/pione-tuple-space-receiver.rb +0 -111
- data/lib/pione/command/pione-update-package-info.rb +0 -53
- data/lib/pione/front/broker-front.rb +0 -22
- data/lib/pione/front/tuple-space-receiver-front.rb +0 -11
- data/lib/pione/global/broker-variable.rb +0 -33
- data/lib/pione/system/domain-info.rb +0 -25
- data/lib/pione/util/pnml-compiler.rb +0 -168
- data/test/agent/spec_tuple-space-receiver.rb +0 -47
- data/test/util/spec_pnml-compiler.rb +0 -32
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'pione/test-helper'
|
2
|
+
|
3
|
+
TestHelper.scope do |this|
|
4
|
+
this::P1 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP1"
|
5
|
+
this::P2 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP2"
|
6
|
+
this::P3 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP3"
|
7
|
+
this::P4 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP4"
|
8
|
+
|
9
|
+
describe Pione::Command::PionePackageBuild do
|
10
|
+
before do
|
11
|
+
@cmd = Pione::Command::PionePackageBuild
|
12
|
+
@orig_database = Global.package_database_location
|
13
|
+
Global.package_database_location = Location[Temppath.create]
|
14
|
+
end
|
15
|
+
|
16
|
+
after do
|
17
|
+
Global.package_database_location = @orig_database
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should build PIONE package with the package name" do
|
21
|
+
output_location = Location[Temppath.mkdir]
|
22
|
+
cmd = @cmd.new(["-o", output_location.path.to_s, this::P1.path.to_s])
|
23
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
24
|
+
pkg = output_location + "P1.ppg"
|
25
|
+
pkg.should.exist
|
26
|
+
pkg.size.should > 0
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should build PIONE package with the tag" do
|
30
|
+
output_location = Location[Temppath.mkdir]
|
31
|
+
cmd = @cmd.new(["-o", output_location.path.to_s, this::P2.path.to_s])
|
32
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
33
|
+
pkg = output_location + "P2+v0.1.0.ppg"
|
34
|
+
pkg.should.exist
|
35
|
+
pkg.size.should > 0
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should build PIONE package with the editor" do
|
39
|
+
output_location = Location[Temppath.mkdir]
|
40
|
+
cmd = @cmd.new(["-o", output_location.path.to_s, this::P3.path.to_s])
|
41
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
42
|
+
pkg = output_location + "P3(keita.yamaguchi@gmail.com).ppg"
|
43
|
+
pkg.should.exist
|
44
|
+
pkg.size.should > 0
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should build PIONE package with full name" do
|
48
|
+
output_location = Location[Temppath.mkdir]
|
49
|
+
cmd = @cmd.new(["-o", output_location.path.to_s, this::P4.path.to_s])
|
50
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
51
|
+
pkg = output_location + "P4(keita.yamaguchi@gmail.com)+v0.1.0.ppg"
|
52
|
+
pkg.should.exist
|
53
|
+
pkg.size.should > 0
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'pione/test-helper'
|
2
|
+
|
3
|
+
TestHelper.scope do |this|
|
4
|
+
this::P1 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP1"
|
5
|
+
this::P2 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP2"
|
6
|
+
this::P3 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP3"
|
7
|
+
this::P4 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP4"
|
8
|
+
this::DIR = Location[File.dirname(__FILE__)] + "data" + "pione-list-param"
|
9
|
+
|
10
|
+
describe Pione::Command::PionePackage do
|
11
|
+
before do
|
12
|
+
@cmd = Pione::Command::PionePackageShow
|
13
|
+
@orig_database = Global.package_database_location
|
14
|
+
Global.package_database_location = Location[Temppath.create]
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
Global.package_database_location = @orig_database
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should show parameters list of the package" do
|
22
|
+
res = Rootage::ScenarioTest.succeed(@cmd.new(["example/HelloWorld/HelloWorld.pione"]))
|
23
|
+
res.stdout.string.size.should > 0
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should show basic parameters" do
|
27
|
+
cmd = @cmd.new([(this::DIR + "BasicParameters.pione").path.to_s])
|
28
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
29
|
+
out = res.stdout.string
|
30
|
+
out.should.include "B1"
|
31
|
+
out.should.include "B2"
|
32
|
+
out.should.include "B3"
|
33
|
+
out.should.include "I1"
|
34
|
+
out.should.include "I2"
|
35
|
+
out.should.include "S1"
|
36
|
+
out.should.include "S2"
|
37
|
+
out.should.include "D1"
|
38
|
+
out.should.include "D2"
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should show basic parameters only without `--advanced` option" do
|
42
|
+
cmd = @cmd.new([(this::DIR + "AdvancedParameters.pione").path.to_s])
|
43
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
44
|
+
out = res.stdout.string
|
45
|
+
out.should.include "B1"
|
46
|
+
out.should.not.include "B2"
|
47
|
+
out.should.not.include "B3"
|
48
|
+
out.should.include "I1"
|
49
|
+
out.should.not.include "I2"
|
50
|
+
out.should.include "S1"
|
51
|
+
out.should.not.include "S2"
|
52
|
+
out.should.include "D1"
|
53
|
+
out.should.not.include "D2"
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should show advanced parameters with `--advanced` option" do
|
57
|
+
cmd = @cmd.new([(this::DIR + "AdvancedParameters.pione").path.to_s, "--advanced"])
|
58
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
59
|
+
out = res.stdout.string
|
60
|
+
out.should.include "B1"
|
61
|
+
out.should.include "B2"
|
62
|
+
out.should.include "B3"
|
63
|
+
out.should.include "I1"
|
64
|
+
out.should.include "I2"
|
65
|
+
out.should.include "S1"
|
66
|
+
out.should.include "S2"
|
67
|
+
out.should.include "D1"
|
68
|
+
out.should.include "D2"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'pione/test-helper'
|
2
2
|
|
3
|
-
describe Pione::Command::
|
3
|
+
describe Pione::Command::PionePackageUpdate do
|
4
4
|
before do
|
5
|
+
@cmd = Pione::Command::PionePackageUpdate
|
6
|
+
|
5
7
|
# package
|
6
8
|
@location = Location[Temppath.mkdir]
|
7
9
|
|
@@ -28,10 +30,8 @@ describe Pione::Command::PioneUpdatePackageInfo do
|
|
28
30
|
end
|
29
31
|
|
30
32
|
it "should update package info files" do
|
31
|
-
|
32
|
-
|
33
|
-
Pione::Command::PioneUpdatePackageInfo.run(args)
|
34
|
-
end
|
33
|
+
cmd = @cmd.new([@location.path.to_s])
|
34
|
+
Rootage::ScenarioTest.succeed(cmd)
|
35
35
|
(@location + "pione-package.json").should.exist
|
36
36
|
(@location + "pione-package.json").size.should > 0
|
37
37
|
(@location + "scenario" + "pione-scenario.json").should.exist
|
@@ -42,10 +42,8 @@ describe Pione::Command::PioneUpdatePackageInfo do
|
|
42
42
|
ptime = (@location + "pione-package.json").write("").mtime
|
43
43
|
stime = (@location + "scenario" + "pione-scenario.json").write("").mtime
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
Pione::Command::PioneUpdatePackageInfo.run(args)
|
48
|
-
end
|
45
|
+
cmd = @cmd.new([@location.path.to_s])
|
46
|
+
Rootage::ScenarioTest.succeed(cmd)
|
49
47
|
|
50
48
|
(@location + "pione-package.json").mtime.should == ptime
|
51
49
|
(@location + "scenario" + "pione-scenario.json").mtime.should == stime
|
@@ -55,10 +53,11 @@ describe Pione::Command::PioneUpdatePackageInfo do
|
|
55
53
|
ptime = (@location + "pione-package.json").write("").mtime
|
56
54
|
stime = (@location + "scenario" + "pione-scenario.json").write("").mtime
|
57
55
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
# make sure mtime is different
|
57
|
+
sleep 1
|
58
|
+
|
59
|
+
cmd = @cmd.new([@location.path.to_s, "--force"])
|
60
|
+
Rootage::ScenarioTest.succeed(cmd)
|
62
61
|
|
63
62
|
(@location + "pione-package.json").mtime.should > ptime
|
64
63
|
(@location + "scenario" + "pione-scenario.json").mtime.should > stime
|
@@ -1,113 +1,13 @@
|
|
1
1
|
require 'pione/test-helper'
|
2
2
|
|
3
3
|
TestHelper.scope do |this|
|
4
|
-
|
5
|
-
this::P2 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP2"
|
6
|
-
this::P3 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP3"
|
7
|
-
this::P4 = Location[File.dirname(__FILE__)] + ".." + "command" + "data" + "PionePackageP4"
|
8
|
-
|
9
|
-
describe "Pione::Command::PionePackage" do
|
4
|
+
describe Pione::Command::PionePackage do
|
10
5
|
before do
|
11
|
-
@
|
12
|
-
Global.package_database_location = Location[Temppath.create]
|
13
|
-
end
|
14
|
-
|
15
|
-
after do
|
16
|
-
Global.package_database_location = @orig_database
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should build PIONE package with the package name" do
|
20
|
-
output_location = Location[Temppath.mkdir]
|
21
|
-
res = TestHelper::Command.succeed do
|
22
|
-
Command::PionePackage.run ["--build", "-o", output_location.path.to_s, this::P1.path.to_s]
|
23
|
-
end
|
24
|
-
pkg = output_location + "P1.ppg"
|
25
|
-
pkg.should.exist
|
26
|
-
pkg.size.should > 0
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should build PIONE package with the tag" do
|
30
|
-
output_location = Location[Temppath.mkdir]
|
31
|
-
res = TestHelper::Command.succeed do
|
32
|
-
Command::PionePackage.run ["--build", "-o", output_location.path.to_s, this::P2.path.to_s]
|
33
|
-
end
|
34
|
-
pkg = output_location + "P2+v0.1.0.ppg"
|
35
|
-
pkg.should.exist
|
36
|
-
pkg.size.should > 0
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should build PIONE package with the editor" do
|
40
|
-
output_location = Location[Temppath.mkdir]
|
41
|
-
res = TestHelper::Command.succeed do
|
42
|
-
Command::PionePackage.run ["--build", "-o", output_location.path.to_s, this::P3.path.to_s]
|
43
|
-
end
|
44
|
-
pkg = output_location + "P3(keita.yamaguchi@gmail.com).ppg"
|
45
|
-
pkg.should.exist
|
46
|
-
pkg.size.should > 0
|
47
|
-
end
|
48
|
-
|
49
|
-
it "should build PIONE package with full name" do
|
50
|
-
output_location = Location[Temppath.mkdir]
|
51
|
-
res = TestHelper::Command.succeed do
|
52
|
-
Command::PionePackage.run ["--build", "-o", output_location.path.to_s, this::P4.path.to_s]
|
53
|
-
end
|
54
|
-
pkg = output_location + "P4(keita.yamaguchi@gmail.com)+v0.1.0.ppg"
|
55
|
-
pkg.should.exist
|
56
|
-
pkg.size.should > 0
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should add package with name to database" do
|
60
|
-
res = TestHelper::Command.succeed do
|
61
|
-
Command::PionePackage.run ["--add", this::P1.path.to_s]
|
62
|
-
end
|
63
|
-
db = Package::Database.load
|
64
|
-
digest = db.find("P1", nil, nil)
|
65
|
-
digest.size.should > 0
|
66
|
-
end
|
67
|
-
|
68
|
-
it "should add package with tag to database" do
|
69
|
-
res = TestHelper::Command.succeed do
|
70
|
-
Command::PionePackage.run ["--add", this::P2.path.to_s]
|
71
|
-
end
|
72
|
-
db = Package::Database.load
|
73
|
-
digest = db.find("P2", nil, "v0.1.0")
|
74
|
-
digest.size.should > 0
|
75
|
-
end
|
76
|
-
|
77
|
-
it "should add package with editor to database" do
|
78
|
-
res = TestHelper::Command.succeed do
|
79
|
-
Command::PionePackage.run ["--add", this::P3.path.to_s]
|
80
|
-
end
|
81
|
-
db = Package::Database.load
|
82
|
-
digest = db.find("P3", "keita.yamaguchi@gmail.com", nil)
|
83
|
-
digest.size.should > 0
|
84
|
-
end
|
85
|
-
|
86
|
-
it "should add package with full name to database" do
|
87
|
-
TestHelper::Command.succeed do
|
88
|
-
Command::PionePackage.run ["--add", this::P4.path.to_s]
|
89
|
-
end
|
90
|
-
db = Package::Database.load
|
91
|
-
digest = db.find("P4", "keita.yamaguchi@gmail.com", "v0.1.0")
|
92
|
-
digest.size.should > 0
|
93
|
-
end
|
94
|
-
|
95
|
-
it "should add tag alias" do
|
96
|
-
TestHelper::Command.succeed do
|
97
|
-
Command::PionePackage.run ["--add", "--tag", "TEST", this::P4.path.to_s]
|
98
|
-
end
|
99
|
-
db = Package::Database.load
|
100
|
-
digest = db.find("P4", "keita.yamaguchi@gmail.com", "TEST")
|
101
|
-
digest.size.should > 0
|
6
|
+
@cmd = Pione::Command::PionePackage
|
102
7
|
end
|
103
8
|
|
104
|
-
it "should
|
105
|
-
|
106
|
-
(this::P1 + "P1.pione").copy(location + "P1.pione")
|
107
|
-
res = TestHelper::Command.succeed do
|
108
|
-
Command::PionePackage.run ["--write-info", location.path.to_s]
|
109
|
-
end
|
110
|
-
(location + "pione-package.json").should.exist
|
9
|
+
it "should abort with no subcommands" do
|
10
|
+
Rootage::ScenarioTest.fail(@cmd.new([]))
|
111
11
|
end
|
112
12
|
end
|
113
13
|
end
|
@@ -1,21 +1,24 @@
|
|
1
1
|
require 'pione/test-helper'
|
2
|
+
require 'pione/command/pione-val'
|
2
3
|
require_relative 'command-behavior'
|
3
4
|
|
4
|
-
describe
|
5
|
+
describe Pione::Command::PioneVal do
|
6
|
+
before do
|
7
|
+
@cmd = Pione::Command::PioneVal
|
8
|
+
end
|
9
|
+
|
5
10
|
behaves_like "command"
|
6
11
|
|
7
12
|
it "should get value" do
|
8
|
-
|
9
|
-
|
10
|
-
end
|
13
|
+
cmd = @cmd.new(["1 + 1"])
|
14
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
11
15
|
res.stdout.string.chomp.should == "2"
|
12
16
|
end
|
13
17
|
|
14
18
|
it "should get variable from domain info" do
|
15
19
|
domain_info = Location[File.dirname(__FILE__)] + "data" + "pione-val.domain.dump"
|
16
|
-
|
17
|
-
|
18
|
-
end
|
20
|
+
cmd = @cmd.new(["$O[1]", "--domain-dump", domain_info.path.to_s])
|
21
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
19
22
|
res.stdout.string.chomp.should == "message.txt"
|
20
23
|
end
|
21
24
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require "pione/test-helper"
|
2
|
+
|
3
|
+
describe Pione::Global::Config do
|
4
|
+
before do
|
5
|
+
Global.define_external_item(:test)
|
6
|
+
|
7
|
+
@path = Temppath.create
|
8
|
+
@config = Global::Config.new(@path)
|
9
|
+
end
|
10
|
+
|
11
|
+
after do
|
12
|
+
Global.item[:test].unregister
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should set and get a item" do
|
16
|
+
@config.set("test", "a")
|
17
|
+
@config.get("test").should == "a"
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should unset a item" do
|
21
|
+
@config.set("test", "a")
|
22
|
+
@config.unset("test")
|
23
|
+
@config.get("test").should.nil
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should save config file" do
|
27
|
+
Global.define_external_item(:test1)
|
28
|
+
Global.define_external_item(:test2)
|
29
|
+
Global.define_external_item(:test3)
|
30
|
+
|
31
|
+
# set
|
32
|
+
@config.set("test1", "a")
|
33
|
+
@config.set("test2", 1)
|
34
|
+
@config.set("test3", true)
|
35
|
+
|
36
|
+
# save
|
37
|
+
@config.save
|
38
|
+
|
39
|
+
# delete
|
40
|
+
Global.item[:test1].unregister
|
41
|
+
Global.item[:test2].unregister
|
42
|
+
Global.item[:test3].unregister
|
43
|
+
|
44
|
+
# test
|
45
|
+
table = JSON.load(@path.read)
|
46
|
+
table["test1"].should == "a"
|
47
|
+
table["test2"].should == 1
|
48
|
+
table["test3"].should.true
|
49
|
+
end
|
50
|
+
end
|
data/test/global/spec_item.rb
CHANGED
@@ -15,7 +15,7 @@ shared "location" do
|
|
15
15
|
@file.read.should == "AB"
|
16
16
|
end
|
17
17
|
|
18
|
-
it "should not raise exception when the file doesn't exist" do
|
18
|
+
it "should not raise an exception when the file doesn't exist" do
|
19
19
|
@file.should.not.exist
|
20
20
|
@file.append("A")
|
21
21
|
@file.read.should == "A"
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'pione/test-helper'
|
2
|
+
require_relative 'location-behavior'
|
3
|
+
|
4
|
+
#
|
5
|
+
# If you want to enable this test, you should set environment variable
|
6
|
+
# "DROPBOX_LOCATION_TEST".
|
7
|
+
#
|
8
|
+
# % DROPBOX_LOCATION_TEST=true bundle exec rake test
|
9
|
+
#
|
10
|
+
if ENV["DROPBOX_LOCATION_TEST"] == "true"
|
11
|
+
describe Pione::Location::DropboxLocation do
|
12
|
+
if Location::DropboxLocation.cached? and TestHelper::InternetConnectivity.ok?
|
13
|
+
before do
|
14
|
+
tuple_space = TupleSpace::TupleSpaceServer.new
|
15
|
+
Location::DropboxLocation.setup_for_cui_client(tuple_space)
|
16
|
+
|
17
|
+
path = Location["dropbox:/spec_dropbox-location/"] + Util::UUID.generate
|
18
|
+
@file = path + Util::UUID.generate
|
19
|
+
@dir = path
|
20
|
+
(@dir + "A").create("A")
|
21
|
+
(@dir + "B").create("B")
|
22
|
+
(@dir + "C").create("C")
|
23
|
+
(@dir + "D" + "X").create("X")
|
24
|
+
(@dir + "D" + "Y").create("Y")
|
25
|
+
(@dir + "D" + "Z").create("Z")
|
26
|
+
end
|
27
|
+
|
28
|
+
after do
|
29
|
+
@file.delete
|
30
|
+
@dir.delete
|
31
|
+
end
|
32
|
+
|
33
|
+
behaves_like "location"
|
34
|
+
else
|
35
|
+
puts "*** Ignored the test because the cache of Dropbox's access token doesn't exist. ***"
|
36
|
+
puts "*** Run pione-client with Dropbox location once if you want run this test. ***"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|