Skip to content

Commit

Permalink
fixed serializable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dep11007 committed Apr 17, 2015
1 parent eaafe55 commit 368bcb3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
Binary file removed datastruct.txt
Binary file not shown.
6 changes: 3 additions & 3 deletions src/InputOutput/DataStructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class DataStructure extends Hashtable<String, Hashtable<String, Hashtable
/**
*
*/
private static final long serialVersionUID = -4390469670958795848L;
//private static final long serialVersionUID = 1105146094425728795L;
//private static final long serialVersionUID = -4390469670958795848L;
private static final long serialVersionUID = 1105146094425728795L;
//private Hashtable<String, Hashtable<String, String>> internalStructure;
private final String FILE_NAME = "datastruct.txt";
private Thermostatable owner;
Expand All @@ -35,7 +35,7 @@ public void updateTable(String tableName, String key, String subKey, String valu

String query = "Inserting Value: "+value + " FOR KEY: "+subKey+" FOR Object: "+key+" INTO: "+tableName;

System.out.println(query);
// System.out.println(query);

Hashtable<String, String> tempObject;
Hashtable<String, Hashtable<String, String>> tempTable;
Expand Down
3 changes: 2 additions & 1 deletion src/testing/DataStructureTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package testing;
import java.io.Serializable;
import java.util.Hashtable;

import InputOutput.*;

public class DataStructureTest implements Thermostatable{
public class DataStructureTest implements Thermostatable, Serializable{

public DataStructureTest(){
DataStructure struct = new DataStructure(this);
Expand Down
17 changes: 12 additions & 5 deletions src/testing/DatabaseTest.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package testing;
import java.io.Serializable;
import java.util.Hashtable;

import InputOutput.*;
Expand All @@ -10,17 +11,23 @@
import org.junit.runners.JUnit4;


public class DatabaseTest implements Thermostatable{
public class DatabaseTest implements Thermostatable, Serializable{

/**
* @param args
*/
public DatabaseTest(){
Database testbase =new Database(this);
assert(testbase.createUser("herp@derp.com", "herpderp", "123456789.0")== true);
//Hashtable<String, String> testuser = testbase.getUserFromEmail("herp@derp.com");
//assert(testuser.get("email")=="herp@derp.com");
//assert(testuser.get("ip")=="123456789.0");

testbase.createUser("herp@derp.com", "herpderp", "123456789.0");
Hashtable<String, String> testuser = testbase.getUserFromEmail("herp@derp.com");

if(testuser.get("email").equals("herp@derp.com")){
System.out.println("email pass");
}
if(testuser.get("ipaddress").equals("123456789.0")){
System.out.println("ip pass");
}

}

Expand Down

0 comments on commit 368bcb3

Please sign in to comment.