-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Tests' of https://github.com/ucsd-cse110-fa23/cse-110-p…
…roject-team-33 into Tests
- Loading branch information
Showing
8 changed files
with
105 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package cse.gradle; | ||
|
||
import javax.sound.sampled.AudioInputStream; | ||
import javax.sound.sampled.AudioSystem; | ||
import java.io.File; | ||
|
||
public class MockAudioRecorder extends AudioRecorder { | ||
|
||
private boolean isRecordingStarted = false; | ||
|
||
@Override | ||
public void startRecording(String fileName) { | ||
if (!isRecordingStarted) { | ||
isRecordingStarted = true; | ||
// Simulate the start of recording without actual audio capture | ||
simulateRecording(fileName); | ||
} | ||
} | ||
|
||
@Override | ||
public void stopRecording() { | ||
if (isRecordingStarted) { | ||
// Simulate the stop of recording without actual audio capture | ||
isRecordingStarted = false; | ||
} | ||
} | ||
|
||
// Simulate the recording process without actual audio capture | ||
private void simulateRecording(String fileName) { | ||
try { | ||
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File(fileName)); | ||
audioInputStream.close(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cse.gradle; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.File; | ||
import java.io.FileReader; | ||
import java.io.IOException; | ||
|
||
import cse.gradle.View.UserLogin; | ||
|
||
public class MockController { | ||
public boolean loginUser(String username, String password) throws IOException { | ||
// Checks if the automic login file exists; if it does, and username matches the | ||
// one in file, do automatic login | ||
if ((new File("src/main/java/cse/gradle/local/login.txt")).exists()) { | ||
File loginFile = new File("src/main/java/cse/gradle/local/login.txt"); | ||
BufferedReader reader = new BufferedReader( | ||
new FileReader(loginFile)); | ||
if (username.equals(reader.readLine())) { | ||
reader.close(); | ||
// String postResponse = model.performLoginRequest(loginFile); | ||
// if (postResponse.equals("Error: Server down")) { | ||
// appScenes.displayServerDownConstructor(); | ||
// return false; | ||
// } | ||
// reader.close(); | ||
return true; | ||
} | ||
reader.close(); | ||
} | ||
return false; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
bob2000 | ||
2000 | ||
login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters