Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Thermocontroller/src/testing/DatabaseTest.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
116 lines (87 sloc)
2.51 KB
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
package testing; | |
import java.io.Serializable; | |
import java.util.Hashtable; | |
import InputOutput.*; | |
import static org.junit.Assert.assertEquals; | |
import org.junit.Test; | |
import org.junit.Ignore; | |
import org.junit.runner.RunWith; | |
import org.junit.runners.JUnit4; | |
public class DatabaseTest implements Thermostatable, Serializable{ | |
/** | |
* @param args | |
*/ | |
public DatabaseTest(){ | |
Database testbase =new Database(this); | |
testbase.createUser("herp@derp.com", "herpderp", "123456789.0", "testthermo1"); | |
Hashtable<String, String> testuser = testbase.getUserFromEmail("herp@derp.com"); | |
testbase.createThermostat("testthermo1", "testthemo", "123456789.1", "80", "90"); | |
if(testuser.get("email").equals("herp@derp.com")){ | |
System.out.println("email pass"); | |
} | |
else{ | |
System.out.println("user email fail"); | |
} | |
if(testuser.get("ipaddress").equals("123456789.0")){ | |
System.out.println("user ip pass"); | |
} | |
else{ | |
System.out.println("user ip fail"); | |
} | |
if(testuser.get("devices").equals("testthermo1")){ | |
System.out.println("devices permissions pass"); | |
} | |
else{ | |
System.out.println("devices permissions fail"); | |
} | |
//if(testuser.get())) | |
} | |
@Override | |
public boolean createUser(String email, String password, String ip, String serialpermission) { | |
// TODO Auto-generated method stub | |
return false; | |
} | |
@Override | |
public boolean createThermostat(String serial, String name, | |
String desiredTemp) { | |
// TODO Auto-generated method stub | |
return false; | |
} | |
@Override | |
public Hashtable<String, String> getUserFromEmail(String email) { | |
// TODO Auto-generated method stub | |
return null; | |
} | |
@Override | |
public Hashtable<String, String> getDeviceFromSerial(String serialnumber) { | |
// TODO Auto-generated method stub | |
return null; | |
} | |
@Override | |
public String getCurrentTempFromSerialNumber(String serialnumber) { | |
// TODO Auto-generated method stub | |
return null; | |
} | |
@Override | |
public void setCurrentTempForSerialNumber(String serialNumber, | |
String currtemp) { | |
// TODO Auto-generated method stub | |
} | |
@Override | |
public void setDesiredTempForSerialNumber(String serialnumber, | |
String desiredtemp) { | |
// TODO Auto-generated method stub | |
} | |
@Override | |
public String getDevicesFromEmail(String email) { | |
// TODO Auto-generated method stub | |
return null; | |
} | |
@Override | |
public void datastructureLogEvent(String query) { | |
// TODO Auto-generated method stub | |
} | |
public static void main(String[] args) { | |
new DatabaseTest(); | |
} | |
} |