Music Example


In this example we will use ActionFixture to test manipulations of a music library and use RowFixture to examine the query results that appear in the course of manipulation. You can run this example on the c2.com server.

The music browser starts up looking at the whole library of songs. We specify the library (an advanced feature) so that we know what we are talking about in this document.

fit.ActionFixture
start eg.music.Browser  
enter library eg/music/Music.txt
check total songs 37

This is a the file that library reads. It is tab separated text. Try downloading it and looking at it with a spreadsheet. Expected results are easily "computed" using the spreadsheet's data manipulations.

We can pick songs and see details of our selection as we go.

fit.ActionFixture
enter select 1
check title Akila
check artist Toure Kunda
enter select 2
check title American Tango
check artist Weather Report
check album Mysterious Traveller
check year 1974
check time 3.70
check track 2 of 7

There are buttons on the browser to find more songs like the one we have picked.

fit.ActionFixture
press same album  
check selected songs 2

The selected songs are displayed in a table.

eg.music.Display
title artist album year time() track()
Scarlet Woman Weather Report Mysterious Traveller 1974 5.72 6 of 7
American Tango Weather Report Mysterious Traveller 1974 3.70 2 of 7

We can find songs related in different ways. Each new way produces a (possibly) different list of songs. Show all restores the display to the initial conditions.

fit.ActionFixture
press show all  
check selected songs 37
enter select 3
check artist James Taylor
press same artist  
check selected songs 5

Yielding the display:

eg.music.Display
title artist album year time() track()
Handy Man James Taylor JT 1977 3.30 7 of 12
Scarlet Woman missing Weather Report Mysterious Traveller 1974 5.72 6 of 7
Sailing To Philadelphia James Taylor October Rose 2000 expected
2001 actual
5.47 3 of 3
Ananas James Taylor Hourglass 1997 5.73 5 of 13
Another Gray Morning missing James Taylor JT 1977 2.73 4 of 12
Copperline surplus James Taylor New Moon Shine 1991 4.3700000000000001 1 of 12
Another Grey Morning surplus James Taylor JT 1977 2.73 4 of 12

Other fields can be desplayed as this version shows.

eg.music.Display
title album genre size date
Another Grey Morning JT Pop 3284199 9/7/02 11:32 PM
Ananas Hourglass Pop 6897450 9/7/02 11:47 PM
Copperline Newe Moon Shine expected
New Moon Shine actual
Pop 5248087 9/7/02 9:52 PM
Handy Man JT Pop 3976956 9/7/02 11:36 PM
Sailing To Philadelphia surplus October Rose Pop 6581911 9/7/02 10:45 PM


See the fixtures.

See the application.

 

Last edited September 27, 2002
Return to WelcomeVisitors