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
@@ -3,23 +3,27 @@ require 'pione/test-helper'
|
|
3
3
|
describe 'Pione::Agent::TupleSpaceProvider' do
|
4
4
|
before do
|
5
5
|
@tuple_space = TestHelper::TupleSpace.create(self)
|
6
|
-
@
|
7
|
-
@
|
6
|
+
@cmd = Command::BasicCommand.new([])
|
7
|
+
@cmd.model[:parent_front] = Front::ClientFront.new(@cmd)
|
8
|
+
@cmd.model[:parent_front].set_tuple_space(@tuple_space)
|
9
|
+
@front = Front::TupleSpaceProviderFront.new(@cmd)
|
10
|
+
@orig = Global.notification_targets
|
8
11
|
end
|
9
12
|
|
10
13
|
after do
|
14
|
+
@cmd.model[:parent_front].terminate
|
11
15
|
@front.terminate
|
12
|
-
Global.
|
16
|
+
Global.notification_targets = @orig
|
13
17
|
end
|
14
18
|
|
15
19
|
it 'should start activity' do
|
16
|
-
provider = Agent::TupleSpaceProvider.start(@front)
|
17
|
-
provider.wait_until_after(:
|
20
|
+
provider = Agent::TupleSpaceProvider.start(@front, [URI.parse("pnu://127.0.0.1:3456")])
|
21
|
+
provider.wait_until_after(:send_message, 10)
|
18
22
|
provider.should.not.terminated
|
19
23
|
end
|
20
24
|
|
21
25
|
it 'should terminate' do
|
22
|
-
provider = Agent::TupleSpaceProvider.start(@front)
|
26
|
+
provider = Agent::TupleSpaceProvider.start(@front, [URI.parse("pnu://127.0.0.1:3456")])
|
23
27
|
should.not.raise { provider.terminate }
|
24
28
|
provider.should.terminated
|
25
29
|
end
|
@@ -1,15 +1,7 @@
|
|
1
1
|
shared "command" do
|
2
2
|
it "should show a help message" do
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
res.stdout.string.should.start_with "Usage"
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should show a version message" do
|
10
|
-
res = TestHelper::Command.succeed do
|
11
|
-
Command::PioneVal.run ["--version"]
|
12
|
-
end
|
13
|
-
res.stdout.string.should.include Pione::VERSION
|
3
|
+
cmd = @cmd.new(["--help"])
|
4
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
5
|
+
res.stdout.string.size.should > 0
|
14
6
|
end
|
15
7
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
param $B1 := true
|
2
|
+
advanced param $B2 := false
|
3
|
+
advanced param $B3 := true | false
|
4
|
+
|
5
|
+
param $I1 := 1
|
6
|
+
advanced param $I2 := 1 | 2 | 3
|
7
|
+
|
8
|
+
param $S1 := "test"
|
9
|
+
advanced param $S2 := "test1" | "test2" | "test3"
|
10
|
+
|
11
|
+
param $D1 := 'test.txt'
|
12
|
+
advanced param $D2 := 'test1.txt' | 'test2.txt' | 'test3.txt'
|
@@ -0,0 +1,12 @@
|
|
1
|
+
param $B1 := true
|
2
|
+
param $B2 := false
|
3
|
+
param $B3 := true | false
|
4
|
+
|
5
|
+
param $I1 := 1
|
6
|
+
param $I2 := 1 | 2 | 3
|
7
|
+
|
8
|
+
param $S1 := "test"
|
9
|
+
param $S2 := "test1" | "test2" | "test3"
|
10
|
+
|
11
|
+
param $D1 := 'test.txt'
|
12
|
+
param $D2 := 'test1.txt' | 'test2.txt' | 'test3.txt'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'pione/test-helper'
|
2
|
+
|
3
|
+
describe Pione::Command::PioneActionExec do
|
4
|
+
before do
|
5
|
+
@cmd = Pione::Command::PioneActionExec
|
6
|
+
@dir = Location[File.dirname(__FILE__)] + ".." + "literate-action" + "data"
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should execute action" do
|
10
|
+
base = Location[Temppath.mkdir]
|
11
|
+
args = [(@dir + "HelloWorld.md").path.to_s, "SayHello", "-d", base.path.to_s]
|
12
|
+
cmd = @cmd.new(args)
|
13
|
+
Rootage::ScenarioTest.succeed(cmd)
|
14
|
+
(base + "message.txt").read.chomp.should == "Hello, world!"
|
15
|
+
end
|
16
|
+
end
|
@@ -1,15 +1,20 @@
|
|
1
1
|
require 'pione/test-helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
describe Pione::Command::PioneActionList do
|
4
|
+
before do
|
5
|
+
@cmd = Pione::Command::PioneActionList
|
6
|
+
@dir = Location[File.dirname(__FILE__)] + ".." + "literate-action" + "data"
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should show action names" do
|
10
|
+
cmd = @cmd.new([(@dir + "D1.md").path.to_s])
|
11
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
12
|
+
res.stdout.string.chomp.should == "Name1\nName2"
|
13
|
+
end
|
5
14
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
Pione::Command::PioneActionList.run(args)
|
11
|
-
end
|
12
|
-
res.stdout.string.chomp.should == "Name1\nName2"
|
13
|
-
end
|
15
|
+
it "should show action names in compact form" do
|
16
|
+
cmd = @cmd.new(["--compact", (@dir + "D1.md").path.to_s])
|
17
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
18
|
+
res.stdout.string.chomp.should == "Name1 Name2"
|
14
19
|
end
|
15
20
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'pione/test-helper'
|
2
|
+
|
3
|
+
describe Pione::Command::PioneActionPrint do
|
4
|
+
before do
|
5
|
+
@cmd = Pione::Command::PioneActionPrint
|
6
|
+
@dir = Location[File.dirname(__FILE__)] + ".." + "literate-action" + "data"
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should print action contents" do
|
10
|
+
cmd = @cmd.new([(@dir + "HelloWorld.md").path.to_s, "SayHello"])
|
11
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
12
|
+
res.stdout.string.chomp.should == "echo \"Hello, world!\" > message.txt"
|
13
|
+
end
|
14
|
+
end
|
@@ -1,24 +1,11 @@
|
|
1
1
|
require 'pione/test-helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
it "should execute action" do
|
8
|
-
base = Location[Temppath.mkdir]
|
9
|
-
args = [(this::DIR + "HelloWorld.md").path.to_s, "SayHello", "-d", base.path.to_s]
|
10
|
-
TestHelper::Command.succeed do
|
11
|
-
Pione::Command::PioneAction.run(args)
|
12
|
-
end
|
13
|
-
(base + "message.txt").read.chomp.should == "Hello, world!"
|
14
|
-
end
|
3
|
+
describe Pione::Command::PioneAction do
|
4
|
+
before do
|
5
|
+
@cmd = Pione::Command::PioneAction
|
6
|
+
end
|
15
7
|
|
16
|
-
|
17
|
-
|
18
|
-
res = TestHelper::Command.succeed do
|
19
|
-
Pione::Command::PioneAction.run(args)
|
20
|
-
end
|
21
|
-
res.stdout.string.chomp.should == "echo \"Hello, world!\" > message.txt"
|
22
|
-
end
|
8
|
+
it "should fail with no subcommands" do
|
9
|
+
Rootage::ScenarioTest.fail(@cmd.new([]))
|
23
10
|
end
|
24
11
|
end
|
@@ -83,10 +83,9 @@ TestHelper.scope do |this|
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
describe
|
87
|
-
behaves_like "command"
|
88
|
-
|
86
|
+
describe Pione::Command::PioneClean do
|
89
87
|
before do
|
88
|
+
@cmd = Pione::Command::PioneClean
|
90
89
|
@orig_my_temporary_directory = Global.my_temporary_directory
|
91
90
|
Global.my_temporary_directory = Temppath.mkdir
|
92
91
|
@orig_file_cache_directory = Global.my_file_cache_directory
|
@@ -107,103 +106,87 @@ TestHelper.scope do |this|
|
|
107
106
|
Global.profile_report_directory = @orig_profile_report_directory
|
108
107
|
end
|
109
108
|
|
109
|
+
behaves_like "command"
|
110
|
+
|
110
111
|
it "should remove all type files" do
|
111
112
|
fset = this::FakeFileSet.new
|
112
|
-
|
113
|
-
Command::PioneClean.run([])
|
114
|
-
end
|
113
|
+
Rootage::ScenarioTest.succeed(@cmd.new([]))
|
115
114
|
fset.temporary.size.should == 0
|
116
115
|
fset.file_cache.size.should == 0
|
117
116
|
fset.package_cache.size.should == 0
|
118
117
|
fset.profile.size.should == 0
|
119
118
|
end
|
120
119
|
|
121
|
-
it "should remove
|
120
|
+
it "should remove older files than 1 days" do
|
122
121
|
fset = this::FakeFileSet.new
|
123
|
-
|
124
|
-
Command::PioneClean.run ["--older", "1"]
|
125
|
-
end
|
122
|
+
Rootage::ScenarioTest.succeed(@cmd.new(["--older", "1"]))
|
126
123
|
fset.temporary.size.should == 0
|
127
124
|
fset.file_cache.size.should == 0
|
128
125
|
fset.package_cache.size.should == 0
|
129
126
|
fset.profile.size.should == 0
|
130
127
|
end
|
131
128
|
|
132
|
-
it "should remove
|
129
|
+
it "should remove older files than 2 days" do
|
133
130
|
fset = this::FakeFileSet.new
|
134
|
-
|
135
|
-
Command::PioneClean.run ["--older", "2"]
|
136
|
-
end
|
131
|
+
Rootage::ScenarioTest.succeed(@cmd.new(["--older", "2"]))
|
137
132
|
fset.temporary.size.should == 4
|
138
133
|
fset.file_cache.size.should == 2
|
139
134
|
fset.package_cache.size.should == 2
|
140
135
|
fset.profile.size.should == 1
|
141
136
|
end
|
142
137
|
|
143
|
-
it "should remove
|
138
|
+
it "should remove older files than 30 days" do
|
144
139
|
fset = this::FakeFileSet.new
|
145
|
-
|
146
|
-
Command::PioneClean.run ["--older", "30"]
|
147
|
-
end
|
140
|
+
Rootage::ScenarioTest.succeed(@cmd.new(["--older", "30"]))
|
148
141
|
fset.temporary.size.should == 4
|
149
142
|
fset.file_cache.size.should == 2
|
150
143
|
fset.package_cache.size.should == 2
|
151
144
|
fset.profile.size.should == 1
|
152
145
|
end
|
153
146
|
|
154
|
-
it "should remove
|
147
|
+
it "should remove older files than 31 days" do
|
155
148
|
fset = this::FakeFileSet.new
|
156
|
-
|
157
|
-
Command::PioneClean.run ["--older", "31"]
|
158
|
-
end
|
149
|
+
Rootage::ScenarioTest.succeed(@cmd.new(["--older", "31"]))
|
159
150
|
fset.temporary.size.should == 8
|
160
151
|
fset.file_cache.size.should == 4
|
161
152
|
fset.package_cache.size.should == 4
|
162
153
|
fset.profile.size.should == 2
|
163
154
|
end
|
164
155
|
|
165
|
-
it "should remove older than 1 days with iso8601 format" do
|
156
|
+
it "should remove older files than 1 days with iso8601 format" do
|
166
157
|
fset = this::FakeFileSet.new
|
167
158
|
date = this.days_before(1)
|
168
|
-
|
169
|
-
Command::PioneClean.run ["--older", date.iso8601]
|
170
|
-
end
|
159
|
+
Rootage::ScenarioTest.succeed(@cmd.new(["--older", date.iso8601]))
|
171
160
|
fset.temporary.size.should == 0
|
172
161
|
fset.file_cache.size.should == 0
|
173
162
|
fset.package_cache.size.should == 0
|
174
163
|
fset.profile.size.should == 0
|
175
164
|
end
|
176
165
|
|
177
|
-
it "should remove older than 2 days with iso8601 format" do
|
166
|
+
it "should remove older files than 2 days with iso8601 format" do
|
178
167
|
fset = this::FakeFileSet.new
|
179
168
|
date = this.days_before(2)
|
180
|
-
|
181
|
-
Command::PioneClean.run ["--older", date.iso8601]
|
182
|
-
end
|
169
|
+
Rootage::ScenarioTest.succeed(@cmd.new(["--older", date.iso8601]))
|
183
170
|
fset.temporary.size.should == 4
|
184
171
|
fset.file_cache.size.should == 2
|
185
172
|
fset.package_cache.size.should == 2
|
186
173
|
fset.profile.size.should == 1
|
187
174
|
end
|
188
175
|
|
189
|
-
it "should remove older than 30 days with iso8601 format" do
|
176
|
+
it "should remove older files than 30 days with iso8601 format" do
|
190
177
|
fset = this::FakeFileSet.new
|
191
178
|
date = this.days_before(30)
|
192
|
-
|
193
|
-
Command::PioneClean.run ["--older", date.iso8601]
|
194
|
-
end
|
179
|
+
Rootage::ScenarioTest.succeed(@cmd.new(["--older", date.iso8601]))
|
195
180
|
fset.temporary.size.should == 4
|
196
181
|
fset.file_cache.size.should == 2
|
197
182
|
fset.package_cache.size.should == 2
|
198
183
|
fset.profile.size.should == 1
|
199
184
|
end
|
200
185
|
|
201
|
-
it "should remove older than 31 days with iso8601 format" do
|
186
|
+
it "should remove older files than 31 days with iso8601 format" do
|
202
187
|
fset = this::FakeFileSet.new
|
203
188
|
date = this.days_before(31)
|
204
|
-
|
205
|
-
Command::PioneClean.run ["--older", date.iso8601]
|
206
|
-
end
|
189
|
+
Rootage::ScenarioTest.succeed(@cmd.new(["--older", date.iso8601]))
|
207
190
|
fset.temporary.size.should == 8
|
208
191
|
fset.file_cache.size.should == 4
|
209
192
|
fset.package_cache.size.should == 4
|
@@ -211,9 +194,9 @@ TestHelper.scope do |this|
|
|
211
194
|
end
|
212
195
|
|
213
196
|
it "should remove temporary files" do
|
214
|
-
|
197
|
+
Rootage::ScenarioTest.succeed(@cmd, ["--type", "temporary"]) do |cmd, args|
|
215
198
|
fset = this::FakeFileSet.new
|
216
|
-
|
199
|
+
cmd.run(args)
|
217
200
|
fset.temporary.size.should == 0
|
218
201
|
fset.file_cache.size.should == 4
|
219
202
|
fset.package_cache.size.should == 4
|
@@ -222,9 +205,9 @@ TestHelper.scope do |this|
|
|
222
205
|
end
|
223
206
|
|
224
207
|
it "should remove file cache files" do
|
225
|
-
|
208
|
+
Rootage::ScenarioTest.succeed(@cmd, ["--type", "file-cache"]) do |cmd, args|
|
226
209
|
fset = this::FakeFileSet.new
|
227
|
-
|
210
|
+
cmd.run(args)
|
228
211
|
fset.temporary.size.should == 8
|
229
212
|
fset.file_cache.size.should == 0
|
230
213
|
fset.package_cache.size.should == 4
|
@@ -233,9 +216,9 @@ TestHelper.scope do |this|
|
|
233
216
|
end
|
234
217
|
|
235
218
|
it "should remove package cache files" do
|
236
|
-
|
219
|
+
Rootage::ScenarioTest.succeed(@cmd, ["--type", "package-cache"]) do |cmd, args|
|
237
220
|
fset = this::FakeFileSet.new
|
238
|
-
|
221
|
+
cmd.run(args)
|
239
222
|
fset.temporary.size.should == 8
|
240
223
|
fset.file_cache.size.should == 4
|
241
224
|
fset.package_cache.size.should == 0
|
@@ -244,9 +227,9 @@ TestHelper.scope do |this|
|
|
244
227
|
end
|
245
228
|
|
246
229
|
it "should remove profile files" do
|
247
|
-
|
230
|
+
Rootage::ScenarioTest.succeed(@cmd, ["--type", "profile"]) do |cmd, args|
|
248
231
|
fset = this::FakeFileSet.new
|
249
|
-
|
232
|
+
cmd.run(args)
|
250
233
|
fset.temporary.size.should == 8
|
251
234
|
fset.file_cache.size.should == 4
|
252
235
|
fset.package_cache.size.should == 4
|
@@ -4,45 +4,41 @@ require_relative 'command-behavior'
|
|
4
4
|
TestHelper.scope do |this|
|
5
5
|
this::DIR = Location[File.dirname(__FILE__)] + "data" + "pione-client"
|
6
6
|
|
7
|
-
describe
|
7
|
+
describe Pione::Command::PioneClient do
|
8
|
+
before do
|
9
|
+
@cmd = Command::PioneClient
|
10
|
+
end
|
11
|
+
|
8
12
|
behaves_like "command"
|
9
13
|
|
10
14
|
it "should execute a PIONE document" do
|
11
15
|
path = Temppath.create
|
12
|
-
|
13
|
-
res =
|
14
|
-
Pione::Command::PioneClient.run(args)
|
15
|
-
end
|
16
|
+
cmd = @cmd.new(["example/HelloWorld/HelloWorld.pione", "-o", path.to_s])
|
17
|
+
res = Rootage::ScenarioTest.succeed(cmd)
|
16
18
|
Location[path + "message.txt"].should.exist
|
17
19
|
Location[path + "message.txt"].read.should.start_with "Hello, world!"
|
18
20
|
end
|
19
21
|
|
20
22
|
it "should execute a PIONE document with stand alone mode" do
|
21
23
|
path = Temppath.create
|
22
|
-
|
23
|
-
|
24
|
-
Pione::Command::PioneClient.run(args)
|
25
|
-
end
|
24
|
+
cmd = @cmd.new(["example/HelloWorld/HelloWorld.pione", "-o", path.to_s, "--stand-alone"])
|
25
|
+
Rootage::ScenarioTest.succeed(cmd)
|
26
26
|
Location[path + "message.txt"].should.exist
|
27
27
|
Location[path + "message.txt"].read.should.start_with "Hello, world!"
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should execute a PIONE package" do
|
31
31
|
path = Temppath.create
|
32
|
-
|
33
|
-
|
34
|
-
Pione::Command::PioneClient.run(args)
|
35
|
-
end
|
32
|
+
cmd = @cmd.new(["example/HelloWorld/", "-o", path.to_s])
|
33
|
+
Rootage::ScenarioTest.succeed(cmd)
|
36
34
|
Location[path + "message.txt"].should.exist
|
37
35
|
Location[path + "message.txt"].read.should.start_with "Hello, world!"
|
38
36
|
end
|
39
37
|
|
40
38
|
it "should execute a PIONE package with stand alone mode" do
|
41
39
|
path = Temppath.create
|
42
|
-
|
43
|
-
|
44
|
-
Pione::Command::PioneClient.run(args)
|
45
|
-
end
|
40
|
+
cmd = @cmd.new(["example/HelloWorld/", "-o", path.to_s, "--stand-alone"])
|
41
|
+
Rootage::ScenarioTest.succeed(cmd)
|
46
42
|
Location[path + "message.txt"].should.exist
|
47
43
|
Location[path + "message.txt"].read.should.start_with "Hello, world!"
|
48
44
|
end
|
@@ -50,18 +46,8 @@ TestHelper.scope do |this|
|
|
50
46
|
it "should fail with action error" do
|
51
47
|
doc = (this::DIR + "ActionError.pione").path.to_s
|
52
48
|
path = Temppath.create
|
53
|
-
|
54
|
-
|
55
|
-
Pione::Command::PioneClient.run(args)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should show parameters list of package" do
|
60
|
-
args = ["example/HelloWorld/HelloWorld.pione", "--list-params"]
|
61
|
-
res = TestHelper::Command.succeed do
|
62
|
-
Pione::Command::PioneClient.run(args)
|
63
|
-
end
|
64
|
-
res.stdout.string.size.should > 0
|
49
|
+
cmd = @cmd.new([doc, "-o", path.to_s, "--stand-alone"])
|
50
|
+
Rootage::ScenarioTest.fail(cmd)
|
65
51
|
end
|
66
52
|
|
67
53
|
describe "example/Fib" do
|
@@ -166,13 +152,13 @@ TestHelper.scope do |this|
|
|
166
152
|
(base + "2.b").should.exist
|
167
153
|
(base + "3.b").should.exist
|
168
154
|
(base + "4.b").should.exist
|
169
|
-
(base + "1.a").mtime.should
|
170
|
-
(base + "2.a").mtime.should
|
171
|
-
(base + "3.a").mtime.should
|
172
|
-
(base + "4.a").mtime.should
|
173
|
-
(base + "1.b").mtime.should
|
174
|
-
(base + "2.b").mtime.should
|
175
|
-
(base + "3.b").mtime.should
|
155
|
+
(base + "1.a").mtime.should <= (base + "2.a").mtime
|
156
|
+
(base + "2.a").mtime.should <= (base + "3.a").mtime
|
157
|
+
(base + "3.a").mtime.should <= (base + "4.a").mtime
|
158
|
+
(base + "4.a").mtime.should <= (base + "1.b").mtime
|
159
|
+
(base + "1.b").mtime.should <= (base + "2.b").mtime
|
160
|
+
(base + "2.b").mtime.should <= (base + "3.b").mtime
|
161
|
+
(base + "3.b").mtime.should <= (base + "4.b").mtime
|
176
162
|
end
|
177
163
|
end
|
178
164
|
end
|
@@ -252,5 +238,12 @@ TestHelper.scope do |this|
|
|
252
238
|
end
|
253
239
|
end
|
254
240
|
|
241
|
+
describe "example/ActionError" do
|
242
|
+
TestHelper::PioneClientRunner.test(self) do |runner|
|
243
|
+
runner.title = "should fail in execution of example/ActionError"
|
244
|
+
runner.args = ["example/ActionError", *runner.default_arguments]
|
245
|
+
runner.fail
|
246
|
+
end
|
247
|
+
end
|
255
248
|
end
|
256
249
|
end
|