Browse Source

changes in the Interface.

feature-pr-cdPlayerGetOptions
JPANZO 3 years ago
parent
commit
74242d1cb5
  1. 6
      src/main/java/device/Device.java
  2. 7
      src/main/java/device/cdPlayer/CDPlayer.java
  3. 5
      src/main/java/device/radioPlayer/RadioPlayer.java
  4. 5
      src/main/java/device/usbPlayer/UsbPlayer.java
  5. 2
      src/test/java/device/cdPlayer/CDPlayerTest.java

6
src/main/java/device/Device.java

@ -8,12 +8,8 @@ public interface Device {
void next();
void prev();
String getInfoText();
//returns an array with Method-Names to bee listed
String[] getOptions();
//returns an array with contents to bee played
String[] getItemList();
String chooseOption();
String play();
}

7
src/main/java/device/cdPlayer/CDPlayer.java

@ -69,15 +69,14 @@ public class CDPlayer implements Device {
@Override
public String[] getOptions() {
return new String[0];
return loadedCD.getPlayList();
}
@Override
public String[] getItemList() {
return loadedCD.getPlayList();
public String chooseOption() {
return null;
}
@Override
public String play() {
if(isCdFlapOpen()){

5
src/main/java/device/radioPlayer/RadioPlayer.java

@ -157,11 +157,10 @@ public class RadioPlayer implements Device {
}
@Override
public String[] getItemList() {
return new String[0];
public String chooseOption() {
return null;
}
@Override
public String play() {
if (regionPlaylist.contains(playedStation))

5
src/main/java/device/usbPlayer/UsbPlayer.java

@ -151,11 +151,10 @@ public class UsbPlayer implements Device {
}
@Override
public String[] getItemList() {
return new String[0];
public String chooseOption() {
return null;
}
@Override
public String play() {
String result = "USB : ";

2
src/test/java/device/cdPlayer/CDPlayerTest.java

@ -193,7 +193,7 @@ class CDPlayerTest {
return Stream.of(
Arguments.of("[getActualPlayTrack() after 1x next() starting by firstSong] => SecondSongSelected","SecondSongSelected", cdPlayer1, 1, cdPlayer1.getSongByNumber(1)),
Arguments.of("[getActualPlayTrack() after 2x next() starting by firstSong] => ThirdSongSelected","ThirdSongSelected" ,cdPlayer2,2,cdPlayer2.getSongByNumber(2)),
Arguments.of("[getActualPlayTrack() after 1x next() starting by lastSong] => FirstSongSelected","FirstSongSelected", cdPlayer3,cdPlayer3.getItemList().length,cdPlayer3.getSongByNumber(0))
Arguments.of("[getActualPlayTrack() after 1x next() starting by lastSong] => FirstSongSelected","FirstSongSelected", cdPlayer3,cdPlayer3.getOptions().length,cdPlayer3.getSongByNumber(0))
);
}

Loading…
Cancel
Save