/*
 * LOGICAL-PARADOX.ORG
 * Copyright (C)2005 satoshi akabane(akabane@logical-paradox.org)
 * $Id: CommandFactoryTest.java,v 1.2 2005/09/07 13:38:07 rampil Exp $
 */
package org.logical_paradox.vsan.dac;

import org.logical_paradox.vsan.dac.command.CommandFactory;
import org.logical_paradox.vsan.dac.command.handler.DacCommand;
import org.logical_paradox.vsan.dac.command.handler.DisposeDatabaseCommand;

import junit.framework.TestCase;

/**
 * CommandFactoryのテストケース
 * @author satoshi akabane@logical-paradox.org
 * @version $Revision: 1.2 $
 */
public class CommandFactoryTest extends TestCase {

	/**
	 * Constructor for CommandFactoryTest.
	 * @param arg0
	 */
	public CommandFactoryTest(String arg0) {
		super(arg0);
	}

	/**
	 * 正しく存在するコマンド番号が指定された場合のテスト
	 */
	public void testCompleteCommandType() {
		DacCommand command = CommandFactory.getCommand(0x2f);
		assertNotNull(command);
		assertTrue(command instanceof DisposeDatabaseCommand);
	}
	/**
	 * 不正なコマンド番号が指定された場合のテスト
	 */
	public void testIllegalCommandType() {
		assertNull(CommandFactory.getCommand(0x00));
	}
}
