lineitemtest.java

来自「测试工具ejb3unit的例子。使用时需要导入ejb3unit,jmock,lo」· Java 代码 · 共 44 行

JAVA
44
字号
package com.ejb3unit.entitytests;

import com.bm.datagen.Generator;
import com.bm.datagen.annotations.GeneratorType;
import com.bm.datagen.relation.SingleBeanGenerator;
import com.bm.testsuite.BaseEntityFixture;
import com.ejb3unit.LineItem;
import com.ejb3unit.Order;

/**
 * This is an axample for fully automated entity bean testing. Beans are randomly
 * generated and written to an in momory database. Equals and hashcode
 * imlementations will be automatically checked. 
 * This test test a entity bean with property access and a N:1 releation.
 * 
 * @author Daniel Wiese
 * 
 */
public class LineItemTest extends BaseEntityFixture<LineItem> {

	private static final Generator[] SPECIAL_GENERATORS = { new MyOrderCreator() };

	/**
	 * Default constructor.
	 */
	public LineItemTest() {
		super(LineItem.class, SPECIAL_GENERATORS);
	}

	/**
	 * Innec Test class.
	 * 
	 * @author Daniel Wiese
	 * @since 21.11.2005
	 */
	@GeneratorType(className = Order.class)
	private static final class MyOrderCreator extends
			SingleBeanGenerator<Order> {
		private MyOrderCreator() {
			super(Order.class);
		}
	}
}

⌨️ 快捷键说明

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