⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbtest.java

📁 著名的uncle Bob的Agile software development的代码
💻 JAVA
字号:
import junit.framework.*;
import junit.swingui.TestRunner;

public class DBTest extends TestCase
{
  public static void main(String[] args)
  {
    TestRunner.main(new String[]{"DBTest"});
  }

  public DBTest(String name)
  {
    super(name);
  }

  public void setUp() throws Exception
  {
    DB.init();
  }

  public void tearDown() throws Exception
  {
    DB.close();
  }

  public void testConnection() throws Exception
  {
    assert(!DB.con.isClosed());
  }

  public void testStoreRetrieveDeleteSalariedEmployee() throws Exception
  {
    int id = 6;
    SalariedEmployee original = new SalariedEmployee( id, "Young Bob", 12334 );
    assertEquals( 0, DB.getNumberOfEmployees() );
    DB.store( original );
    assertEquals( 1, DB.getNumberOfEmployees() );
    SalariedEmployee expected = DB.retrieve(id);
    assertEquals( expected, original );
    DB.delete(id);
    assertEquals( 0, DB.getNumberOfEmployees() );
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -