Java 程序:
/*
* Copyright (c) 2003 Systems Union Holdings Ltd. All rights reserved.
* Systems Union Proprietary / Confidential. Use is subject to license terms.
*/
package com.systemsunion.precheck.exercise1;/**
* Class or interface description
*
* @author
*/
public class Supplier { public Supplier(Integer supplierCode) {
this.suppliercode = supplierCode;
} public Supplier(Integer supplierCode, String zipCode) {
this.zipCode= zipCode;
this.suppliercode = supplierCode;
} public Supplier(String name, String zipCode, String telephone) {
this.name = name;
this.zipCode = zipCode;
this.telephone = telephone;
} public Supplier(String name, String zipCode, String telephone, Integer suppliercode) {
this.name = name;
this.zipCode = zipCode;
this.telephone = telephone;
this.suppliercode = suppliercode;
} public Integer GetSupplierCode() {
return this.suppliercode;
} public void SetSupplierCode(Integer i) {
this.suppliercode = i;
}
private String name;
private String zipCode;
private String telephone;
// supplierCode is mandatory, every supplier must have one
private Integer suppliercode;}
JUnit测试程序:/*
* Copyright (c) 2003 Systems Union Holdings Ltd. All rights reserved.
* Systems Union Proprietary / Confidential. Use is subject to license terms.
*/
package com.systemsunion.precheck.exercise1;import junit.framework.TestCase;/**
* Class or interface description
*
*/
public class TestCase_Supplier extends TestCase { public TestCase_Supplier(String name) {
super(name);
} protected void setUp() throws Exception {
} protected void tearDown() throws Exception {
} public void testConstuctionWithNull() throws Exception {
fail("Implement me");
} public void testCreateWithGoodInteger() throws Exception {
Supplier mySupplier = new Supplier(new Integer(6));
assertEquals("Supplier value wrong", new Integer(6), mySupplier.GetSupplierCode());
} public void testEqualIncludesSupplierCodeOnly() throws Exception {
fail("Not implemented");
}
}
/*
* Copyright (c) 2003 Systems Union Holdings Ltd. All rights reserved.
* Systems Union Proprietary / Confidential. Use is subject to license terms.
*/
package com.systemsunion.precheck.exercise1;/**
* Class or interface description
*
* @author
*/
public class Supplier { public Supplier(Integer supplierCode) {
this.suppliercode = supplierCode;
} public Supplier(Integer supplierCode, String zipCode) {
this.zipCode= zipCode;
this.suppliercode = supplierCode;
} public Supplier(String name, String zipCode, String telephone) {
this.name = name;
this.zipCode = zipCode;
this.telephone = telephone;
} public Supplier(String name, String zipCode, String telephone, Integer suppliercode) {
this.name = name;
this.zipCode = zipCode;
this.telephone = telephone;
this.suppliercode = suppliercode;
} public Integer GetSupplierCode() {
return this.suppliercode;
} public void SetSupplierCode(Integer i) {
this.suppliercode = i;
}
private String name;
private String zipCode;
private String telephone;
// supplierCode is mandatory, every supplier must have one
private Integer suppliercode;}
JUnit测试程序:/*
* Copyright (c) 2003 Systems Union Holdings Ltd. All rights reserved.
* Systems Union Proprietary / Confidential. Use is subject to license terms.
*/
package com.systemsunion.precheck.exercise1;import junit.framework.TestCase;/**
* Class or interface description
*
*/
public class TestCase_Supplier extends TestCase { public TestCase_Supplier(String name) {
super(name);
} protected void setUp() throws Exception {
} protected void tearDown() throws Exception {
} public void testConstuctionWithNull() throws Exception {
fail("Implement me");
} public void testCreateWithGoodInteger() throws Exception {
Supplier mySupplier = new Supplier(new Integer(6));
assertEquals("Supplier value wrong", new Integer(6), mySupplier.GetSupplierCode());
} public void testEqualIncludesSupplierCodeOnly() throws Exception {
fail("Not implemented");
}
}
解决方案 »
- DOM中,怎么在TextNode里面插入Element?
- 各位高手请帮我看一下代码,到底是在哪里出了问题?
- 救命啊!怎么总是出错??!大家帮我看下那里出错误!
- 关于List的isEmpty()和size()方法的疑惑!!!!
- 怎样将java原程序编译为.EXE文件??
- java.io.IOException Server returned HTTP reponse code:405 for URL: http://www.xxxx.com/test
- 请大家帮忙看看,到底是哪错了?
- 好久都沒有解決的問題,緊急求助
- SOS!请问如何用Java实现:把HTML解析出来并把它重构成一种合乎标准(我们自己定义的)的XML文件
- gnu.regexp是什么东西
- 关于super()的用法,请大家指教
- 再次悬赏请高手出马讨论:是arraylist还是vector?!
高手指点,补充完整