Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task: Automated test generation #6

Closed
joulupunikki opened this issue Apr 27, 2015 · 0 comments
Closed

Task: Automated test generation #6

joulupunikki opened this issue Apr 27, 2015 · 0 comments

Comments

@joulupunikki
Copy link
Owner

Collaborative task 2

Automated test generation

Prerequisite task: #5

Motivation

Generating tests for #5 programmatically would be tedious and time consuming.

Implementation sketch

Perhaps a component could be coded into Phoenix which when enabled would log mouse and keyboard events from a java.awt.EventQueue and convert them to a format suitable for execution by #5 implementation. Maybe a custom EventQueue could be extented with overridden dispatchEvent method that does logging prior to calling super.dispatchEvent. so ftw

Estimated work
  • Difficulty: moderate
  • Size: small

A bash/awk script to modify event coordinates in input log files.

#!/bin/bash
# moves y-coord of all "Do Combat"/"Combat Done" JButton events down by 13 in all test input files
INPUT_DIR="input" 
TMP_FILE=$(mktemp)
cd $INPUT_DIR
FILES=$(ls *.txt)
for FILE in $FILES
do
        mv $FILE $TMP_FILE
        cat $TMP_FILE | awk '/#javax.swing.JButton=Do Combat|#javax.swing.JButton=Combat Done/ { $7 = $7 + 13 }; { print }' > $FILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant