Skip to content

Commit 777dee8

Browse files
mfellnerkaufi
authored andcommitted
Prepared Cucumber Test for merge into master
* remove unused code * add catroidCucumberTest to catroidSourceTest * fix checkstyle warnings * add missing license texts * adapt versionCode/versionName * lowered actionbarsherlock target api due to warnings * squashed commits
1 parent 9b82194 commit 777dee8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+554
-1394
lines changed

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "catroidCucumberTest/calabash-android/calabash-android"]
2-
path = catroidCucumberTest/calabash-android/calabash-android
3-
url = [email protected]:calabash/calabash-android.git

catroid/ant.properties

-22
This file was deleted.

catroid/build.xml

-92
This file was deleted.

catroid/checkstyle.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<module name="PackageDeclaration"/>
6969
<module name="ImportOrder">
7070
<property name="option" value="top"/>
71-
<property name="groups" value="android,com,edu,junit,net,org,java,javax"/>
71+
<property name="groups" value="android,com,cucumber,edu,junit,net,org,java,javax"/>
7272
<property name="ordered" value="true"/>
7373
<property name="separated" value="true"/>
7474
</module>

catroidCucumberTest/.checkstyle

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
4+
<local-check-config name="Catroid Checkstyle" location="/catroid/checkstyle.xml" type="project" description="">
5+
<additional-data name="protect-config-file" value="true"/>
6+
</local-check-config>
7+
<fileset name="all" enabled="true" check-config-name="Catroid Checkstyle" local="true">
8+
<file-match-pattern match-pattern="." include-pattern="true"/>
9+
</fileset>
10+
<filter name="FilesFromPackage" enabled="true">
11+
<filter-data value="gen"/>
12+
</filter>
13+
</fileset-config>

catroidCucumberTest/AndroidManifest.xml

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
* Catroid: An on-device visual programming system for Android devices
4+
* Copyright (C) 2010-2013 The Catrobat Team
5+
* (<http://developer.catrobat.org/credits>)
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* An additional term exception under section 7 of the GNU Affero
13+
* General Public License, version 3, is available at
14+
* http://developer.catrobat.org/license_additional_term
15+
*
16+
* This program is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
* GNU Affero General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU Affero General Public License
22+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23+
-->
224
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
325
package="org.catrobat.catroid.test.cucumber"
4-
android:versionCode="1"
5-
android:versionName="1.0">
26+
android:versionCode="11"
27+
android:versionName="0.9.4">
628

729
<application>
830
<uses-library android:name="android.test.runner"/>

catroidCucumberTest/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#### Cucumber tests for Catroid
22

3-
* Features must be placed in `assets/features/`
3+
* Features must be placed inside `assets/features/`.
44
* Run with CucumberInstrumentation instrumentation test runner.
5-
* See [cucumber-android](https://github.com/mfellner/cucumber-android) for details.
6-
5+
* See [cucumber-jvm](https://github.com/cucumber/cucumber-jvm) for details.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Feature: Broadcast brick
2+
A Broadcast brick should send a message and When scripts should react to it.
3+
4+
Background:
5+
Given I have a Program
6+
And this program has an Object 'Object'
7+
8+
Scenario: A Broadcast brick sends a message in a program with one When script
9+
10+
Given 'Object' has a Start script
11+
And this script has a Broadcast 'hello' brick
12+
And this script has a Print brick with
13+
"""
14+
I am the Start script.
15+
"""
16+
17+
Given 'Object' has a When 'hello' script
18+
And this script has a Wait 100 milliseconds brick
19+
And this script has a Print brick with
20+
"""
21+
I am the When 'hello' script.
22+
"""
23+
24+
When I start the program
25+
And I wait until the program has stopped
26+
Then I should see the printed output
27+
"""
28+
I am the Start script.
29+
I am the When 'hello' script.
30+
31+
"""
32+
33+
Scenario: A Broadcast brick sends a message in a program with two When scripts
34+
35+
Given 'Object' has a Start script
36+
And this script has a Broadcast 'hello' brick
37+
And this script has a Wait 100 milliseconds brick
38+
And this script has a Print brick with
39+
"""
40+
I am the Start script.
41+
"""
42+
43+
Given 'Object' has a When 'hello' script
44+
And this script has a Print brick with
45+
"""
46+
I am the first When 'hello' script.
47+
"""
48+
49+
Given 'Object' has a When 'hello' script
50+
And this script has a Wait 200 milliseconds brick
51+
And this script has a Print brick with
52+
"""
53+
I am the second When 'hello' script.
54+
"""
55+
56+
When I start the program
57+
And I wait until the program has stopped
58+
Then I should see the printed output
59+
"""
60+
I am the first When 'hello' script.
61+
I am the Start script.
62+
I am the second When 'hello' script.
63+
64+
"""
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,17 @@
1-
# DEPRECATED
2-
Feature: Repeat Brick
3-
A Repeat Brick repeats no brick, one brick or a sequence of bricks a given number of times.
1+
Feature: Repeat brick
2+
A Repeat brick repeats another set of bricks a given number of times.
43

54
Background:
6-
Given an empty program
7-
And an object 'cuke'
8-
And a StartScript
9-
10-
Scenario: Repeat 0 bricks 0 times.
11-
Given a RepeatBrick with 0 iterations
12-
And a RepeatEndBrick
13-
When the script is executed
14-
And the script terminates
15-
Then the elapsed time is at least 0 ms
16-
And the elapsed time is at most 1 ms
17-
18-
Scenario: Repeat 0 bricks 1 time.
19-
Given a RepeatBrick with 1 iteration
20-
And a RepeatEndBrick
21-
When the script is executed
22-
And the script terminates
23-
Then the elapsed time is at least 20 ms
24-
And the elapsed time is at most 21 ms
25-
26-
Scenario: Repeat 1 bricks 1 times.
27-
Given a RepeatBrick with 1 iterations
28-
And a ChangeYByNBrick with 10
29-
And a RepeatEndBrick
30-
When the script is executed
31-
And the script terminates
32-
Then the elapsed time is at least 20 ms
33-
And the elapsed time is at most 21 ms
34-
And the object 'cuke' has a y position of 10
35-
36-
Scenario: Repeat 2 bricks 16 times.
37-
Given a RepeatBrick with 4 iterations
38-
And a ChangeXByNBrick with 10
39-
And a ChangeYByNBrick with 10
40-
And a RepeatEndBrick
41-
When the script is executed
42-
And the script terminates
43-
Then the elapsed time is at least 80 ms
44-
And the elapsed time is at most 81 ms
45-
And the object 'cuke' has a x position of 40
46-
And the object 'cuke' has a y position of 40
47-
48-
Scenario: Repeat 0 bricks -2 times.
49-
Given a RepeatBrick with -2 iterations
50-
And a RepeatEndBrick
51-
When the script is executed
52-
And the script terminates
53-
Then the elapsed time is at least 0 ms
54-
And the elapsed time is at most 1 ms
55-
56-
Scenario: Repeat 1 SetVariableBrick 4 times.
57-
Given a SetVariableBrick with 'x' and 4
58-
And a RepeatBrick with 'x' iterations
59-
And a ChangeVariableBrick with 'x' and -1
60-
And a RepeatEndBrick
61-
When the script is executed
62-
And the script terminates
63-
Then the elapsed time is at least 80 ms
64-
And the elapsed time is at most 81 ms
65-
Then the variable 'x' is 0
66-
67-
Scenario: Repeat a shorter WaitBrick 4 times.
68-
Given a RepeatBrick with 4 iterations
69-
And a WaitBrick with 0.015 seconds
70-
And a RepeatEndBrick
71-
When the script is executed
72-
And the script terminates
73-
Then the elapsed time is at least 80 ms
74-
And the elapsed time is at most 81 ms
75-
76-
Scenario: Repeat a longer WaitBrick 4 times.
77-
Given a RepeatBrick with 4 iterations
78-
And a WaitBrick with 0.5 seconds
79-
And a RepeatEndBrick
80-
When the script is executed
81-
And the script terminates
82-
Then the elapsed time is at least 2000 ms
83-
And the elapsed time is at most 2001 ms
84-
85-
Scenario: Repeat a brick 2.99 times
86-
Given a RepeatBrick with 2.99 iterations
87-
And a ChangeYByNBrick with 10
88-
And a RepeatEndBrick
89-
When the script is executed
90-
And the script terminates
91-
Then the elapsed time is at least 40 ms
92-
And the elapsed time is at most 41 ms
93-
And the object 'cuke' has a x position of 40
5+
Given I have a Program
6+
And this program has an Object 'Object'
7+
8+
Scenario: Increment variable inside loop
9+
Given 'Object' has a Start script
10+
And this script has a set 'i' to 0 brick
11+
And this script has a Repeat 8 times brick
12+
And this script has a change 'i' by 1 brick
13+
And this script has a Repeat end brick
14+
15+
When I start the program
16+
And I wait until the program has stopped
17+
Then the variable 'i' should be equal 8

catroidCucumberTest/assets/features/bricks/RepeatBrickDelay.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Feature: Repeat brick delay
2-
Eeach iteration of a Repeat brick takes at least 20 milliseconds.
2+
Each iteration of a Repeat brick takes at least 20 milliseconds.
33

44
Background:
55
Given I have a Program
66
And this program has an Object 'Object'
77

88
Scenario: No more than 200 iterations in 2 seconds
99
Given 'Object' has a Start script
10-
And this script has a set 'i' to '0' brick
11-
And this script has a set 'k' to '0' brick
10+
And this script has a set 'i' to 0 brick
11+
And this script has a set 'k' to 0 brick
1212
And this script has a Wait 2 seconds brick
1313
And this script has a set 'k' to 'i' brick
1414

catroidCucumberTest/assets/features/bricks/ShowBrick.feature

-22
This file was deleted.

0 commit comments

Comments
 (0)