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

📄 defaultfacthandlefactorytest.java

📁 drools 一个开放源码的规则引擎
💻 JAVA
字号:
package org.drools.reteoo;

import junit.framework.TestCase;

public class DefaultFactHandleFactoryTest extends TestCase
{

    /*
     * Class under test for FactHandle newFactHandle()
     */
    public void testNewFactHandle()
    {
        DefaultFactHandleFactory factory = new DefaultFactHandleFactory();
        FactHandleImpl handle = (FactHandleImpl) factory.newFactHandle();
        assertEquals( 1,
                      handle.getId() );
        assertEquals( 1,
                      handle.getRecency() );

        handle = (FactHandleImpl) factory.newFactHandle();
        assertEquals( 2,
                      handle.getId() );
        assertEquals( 2,
                      handle.getRecency() );

        handle = (FactHandleImpl) factory.newFactHandle();
        assertEquals( 3,
                      handle.getId() );
        assertEquals( 3,
                      handle.getRecency() );
    }

    /*
     * Class under test for FactHandle newFactHandle(long)
     */
    public void testNewFactHandlelong()
    {
        DefaultFactHandleFactory factory = new DefaultFactHandleFactory();
        FactHandleImpl handle = (FactHandleImpl) factory.newFactHandle( 5 );
        assertEquals( 5,
                      handle.getId() );
        assertEquals( 1,
                      handle.getRecency() );

        handle = (FactHandleImpl) factory.newFactHandle( 3 );
        assertEquals( 3,
                      handle.getId() );
        assertEquals( 2,
                      handle.getRecency() );

        handle = (FactHandleImpl) factory.newFactHandle( 255 );
        assertEquals( 255,
                      handle.getId() );
        assertEquals( 3,
                      handle.getRecency() );
    }

}

⌨️ 快捷键说明

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