-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from utastudents/_SaadsBranch
Added GameTest.java
- Loading branch information
Showing
27 changed files
with
396 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[31morigin/HEAD[m -> origin/main | ||
[31morigin/_SaadsBranch[m | ||
[31morigin/backupbranch1[m | ||
[31morigin/backupbranch2[m | ||
[31morigin/backupbranch3[m | ||
[31morigin/backupleaderboard[m | ||
[31morigin/branchRecover[m | ||
[31morigin/branch_for_css[m | ||
[31morigin/leaderboard[m | ||
[31morigin/main[m | ||
[31morigin/mainBackup[m | ||
[31morigin/new[m | ||
[31morigin/new2[m | ||
[31morigin/saads_branch_backup[m | ||
[31morigin/working_on_game_check[m |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package uta.cse3310; | ||
|
||
import junit.framework.Test; | ||
import junit.framework.TestCase; | ||
import junit.framework.TestSuite; | ||
|
||
public class AppTest | ||
extends TestCase | ||
{ | ||
/** | ||
* Create the test case | ||
* | ||
* @param testName name of the test case | ||
*/ | ||
public AppTest( String testName ) | ||
{ | ||
super( testName ); | ||
} | ||
|
||
/** | ||
* @return the suite of tests being tested | ||
*/ | ||
public static Test suite() | ||
{ | ||
return new TestSuite( AppTest.class ); | ||
} | ||
|
||
public void testApp() | ||
{ | ||
|
||
|
||
} | ||
} |
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,72 @@ | ||
package uta.cse3310; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import junit.framework.Test; | ||
import junit.framework.TestCase; | ||
import junit.framework.TestSuite; | ||
|
||
/** | ||
* Unit test for simple App. | ||
*/ | ||
public class GameTest | ||
extends TestCase { | ||
/** | ||
* Create the test case | ||
* | ||
* @param testName name of the test case | ||
*/ | ||
public GameTest(String testName) { | ||
super(testName); | ||
} | ||
|
||
/** | ||
* @return the suite of tests being tested | ||
*/ | ||
public static Test suite() { | ||
return new TestSuite(GameTest.class); | ||
} | ||
|
||
public void testCase(){ | ||
|
||
Game g = new Game("TestLobby", "TestRoom"); // New test Room | ||
Player p1 = new Player("josh", null); // new player named josh | ||
Player p2 = new Player("adam", null); // new player named adam | ||
|
||
//adding players to game | ||
g.addPlayer(p1); | ||
g.addPlayer(p1); | ||
g.setPlayer1(p1); | ||
g.setPlayer2(p2); | ||
|
||
//checkking to see if game is full, adn ready to start | ||
assertTrue(g.isReadyToStart()); | ||
assertEquals(g.getCurrentNumberOfPlayers(),"2"); | ||
|
||
//insert 3 word into the words placed function | ||
List<String> wordList = new ArrayList<>(); | ||
for (String word : g.getWordsPlaced().keySet()) { | ||
// Add each word to the list | ||
wordList.add(word); | ||
} | ||
|
||
|
||
//check to see if words can be correctly chosen by players | ||
assertTrue(g.checkWord(p1.getUsername(), wordList.get(0)));// test to see if player josh can find first word in grid | ||
g.checkWord(p1.getUsername(),wordList.get(0)); // josh finds first word | ||
g.checkWord(p2.getUsername(), wordList.get(1)); // adam finds second word | ||
g.checkWord(p2.getUsername(), wordList.get(2)); // adam finds third word | ||
|
||
|
||
// retrieve player scores | ||
String string = String.valueOf(g.getPlayerScores()); | ||
assertEquals(string, "{adam=2, josh=1}"); // check player scores. | ||
|
||
// reset game and kick players out | ||
g.reset(); | ||
|
||
//make sure there are no players left in the lobby | ||
assertEquals(g.getCurrentNumberOfPlayers(),"0"); | ||
|
||
} | ||
} |
Binary file not shown.
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,9 @@ | ||
<archetype> | ||
<id>WordSearch</id> | ||
<sources> | ||
<source>src/main/java/App.java</source> | ||
</sources> | ||
<testSources> | ||
<source>src/test/java/AppTest.java</source> | ||
</testSources> | ||
</archetype> |
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,15 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>$org.example</groupId> | ||
<artifactId>$WordSearch</artifactId> | ||
<version>$1.0-SNAPSHOT</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>3.8.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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,13 @@ | ||
package $org.example; | ||
|
||
/** | ||
* Hello world! | ||
* | ||
*/ | ||
public class App | ||
{ | ||
public static void main( String[] args ) | ||
{ | ||
System.out.println( "Hello World!" ); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
target/classes/archetype-resources/src/test/java/AppTest.java
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,38 @@ | ||
package $org.example; | ||
|
||
import junit.framework.Test; | ||
import junit.framework.TestCase; | ||
import junit.framework.TestSuite; | ||
|
||
/** | ||
* Unit test for simple App. | ||
*/ | ||
public class AppTest | ||
extends TestCase | ||
{ | ||
/** | ||
* Create the test case | ||
* | ||
* @param testName name of the test case | ||
*/ | ||
public AppTest( String testName ) | ||
{ | ||
super( testName ); | ||
} | ||
|
||
/** | ||
* @return the suite of tests being tested | ||
*/ | ||
public static Test suite() | ||
{ | ||
return new TestSuite( AppTest.class ); | ||
} | ||
|
||
/** | ||
* Rigourous Test :-) | ||
*/ | ||
public void testApp() | ||
{ | ||
assertTrue( true ); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,5 @@ | ||
#Generated by Maven | ||
#Thu Apr 25 11:30:25 CDT 2024 | ||
groupId=org.example | ||
artifactId=WordSearch | ||
version=1.0-SNAPSHOT |
6 changes: 6 additions & 0 deletions
6
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
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,6 @@ | ||
uta/cse3310/App.class | ||
uta/cse3310/Player.class | ||
uta/cse3310/HttpServer.class | ||
uta/cse3310/Chat.class | ||
uta/cse3310/HttpServer$1.class | ||
uta/cse3310/Game.class |
5 changes: 5 additions & 0 deletions
5
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
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,5 @@ | ||
/home/vboxuser/cse3310_sp24_group_18/src/main/java/uta/cse3310/App.java | ||
/home/vboxuser/cse3310_sp24_group_18/src/main/java/uta/cse3310/HttpServer.java | ||
/home/vboxuser/cse3310_sp24_group_18/src/main/java/uta/cse3310/Game.java | ||
/home/vboxuser/cse3310_sp24_group_18/src/main/java/uta/cse3310/Chat.java | ||
/home/vboxuser/cse3310_sp24_group_18/src/main/java/uta/cse3310/Player.java |
2 changes: 2 additions & 0 deletions
2
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
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,2 @@ | ||
uta/cse3310/AppTest.class | ||
uta/cse3310/GameTest.class |
2 changes: 2 additions & 0 deletions
2
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
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,2 @@ | ||
/home/vboxuser/cse3310_sp24_group_18/src/test/java/uta/cse3310/AppTest.java | ||
/home/vboxuser/cse3310_sp24_group_18/src/test/java/uta/cse3310/GameTest.java |
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,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd" version="3.0" name="uta.cse3310.AppTest" time="0.02" tests="1" errors="0" skipped="0" failures="0"> | ||
<properties> | ||
<property name="java.specification.version" value="17"/> | ||
<property name="sun.jnu.encoding" value="UTF-8"/> | ||
<property name="java.class.path" value="/home/vboxuser/cse3310_sp24_group_18/target/test-classes:/home/vboxuser/cse3310_sp24_group_18/target/classes:/home/vboxuser/.m2/repository/net/freeutils/jlhttp/2.6/jlhttp-2.6.jar:/home/vboxuser/.m2/repository/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar:/home/vboxuser/.m2/repository/org/java-websocket/Java-WebSocket/1.5.4/Java-WebSocket-1.5.4.jar:/home/vboxuser/.m2/repository/org/slf4j/slf4j-api/2.0.6/slf4j-api-2.0.6.jar:/home/vboxuser/.m2/repository/junit/junit/4.12/junit-4.12.jar:/home/vboxuser/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:"/> | ||
<property name="java.vm.vendor" value="Private Build"/> | ||
<property name="sun.arch.data.model" value="64"/> | ||
<property name="java.vendor.url" value="Unknown"/> | ||
<property name="os.name" value="Linux"/> | ||
<property name="java.vm.specification.version" value="17"/> | ||
<property name="sun.java.launcher" value="SUN_STANDARD"/> | ||
<property name="user.country" value="US"/> | ||
<property name="sun.boot.library.path" value="/usr/lib/jvm/java-17-openjdk-amd64/lib"/> | ||
<property name="sun.java.command" value="/home/vboxuser/cse3310_sp24_group_18/target/surefire/surefirebooter4273243482372522469.jar /home/vboxuser/cse3310_sp24_group_18/target/surefire 2024-04-25T11-30-21_685-jvmRun1 surefire14035829568187834566tmp surefire_04664733525063810608tmp"/> | ||
<property name="jdk.debug" value="release"/> | ||
<property name="surefire.test.class.path" value="/home/vboxuser/cse3310_sp24_group_18/target/test-classes:/home/vboxuser/cse3310_sp24_group_18/target/classes:/home/vboxuser/.m2/repository/net/freeutils/jlhttp/2.6/jlhttp-2.6.jar:/home/vboxuser/.m2/repository/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar:/home/vboxuser/.m2/repository/org/java-websocket/Java-WebSocket/1.5.4/Java-WebSocket-1.5.4.jar:/home/vboxuser/.m2/repository/org/slf4j/slf4j-api/2.0.6/slf4j-api-2.0.6.jar:/home/vboxuser/.m2/repository/junit/junit/4.12/junit-4.12.jar:/home/vboxuser/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:"/> | ||
<property name="sun.cpu.endian" value="little"/> | ||
<property name="user.home" value="/home/vboxuser"/> | ||
<property name="user.language" value="en"/> | ||
<property name="java.specification.vendor" value="Oracle Corporation"/> | ||
<property name="java.version.date" value="2023-10-17"/> | ||
<property name="java.home" value="/usr/lib/jvm/java-17-openjdk-amd64"/> | ||
<property name="file.separator" value="/"/> | ||
<property name="basedir" value="/home/vboxuser/cse3310_sp24_group_18"/> | ||
<property name="java.vm.compressedOopsMode" value="Zero based"/> | ||
<property name="line.separator" value=" "/> | ||
<property name="java.vm.specification.vendor" value="Oracle Corporation"/> | ||
<property name="java.specification.name" value="Java Platform API Specification"/> | ||
<property name="surefire.real.class.path" value="/home/vboxuser/cse3310_sp24_group_18/target/surefire/surefirebooter4273243482372522469.jar"/> | ||
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/> | ||
<property name="java.runtime.version" value="17.0.9+9-Ubuntu-122.04"/> | ||
<property name="user.name" value="vboxuser"/> | ||
<property name="path.separator" value=":"/> | ||
<property name="os.version" value="6.5.0-17-generic"/> | ||
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/> | ||
<property name="file.encoding" value="UTF-8"/> | ||
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/> | ||
<property name="localRepository" value="/home/vboxuser/.m2/repository"/> | ||
<property name="java.vendor.url.bug" value="Unknown"/> | ||
<property name="java.io.tmpdir" value="/tmp"/> | ||
<property name="java.version" value="17.0.9"/> | ||
<property name="user.dir" value="/home/vboxuser/cse3310_sp24_group_18"/> | ||
<property name="os.arch" value="amd64"/> | ||
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/> | ||
<property name="native.encoding" value="UTF-8"/> | ||
<property name="java.library.path" value="/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/> | ||
<property name="java.vm.info" value="mixed mode, sharing"/> | ||
<property name="java.vendor" value="Private Build"/> | ||
<property name="java.vm.version" value="17.0.9+9-Ubuntu-122.04"/> | ||
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/> | ||
<property name="java.class.version" value="61.0"/> | ||
</properties> | ||
<testcase name="testApp" classname="uta.cse3310.AppTest" time="0"/> | ||
</testsuite> |
Oops, something went wrong.