Package org.apache.agila.impl

Source Code of org.apache.agila.impl.TokenImplTestCase

/*
* Copyright 2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.agila.impl;

import junit.framework.TestCase;
import org.apache.agila.engine.Token;
import org.apache.agila.engine.TokenID;
import org.apache.agila.engine.InstanceID;
import org.apache.agila.model.NodeID;

public class TokenImplTestCase extends TestCase {

  TokenImpl tokenImpl;
   
  
  protected void setUp() throws Exception {
        super.setUp();
       
        tokenImpl = new TokenImpl();
    }

   
    protected void tearDown() throws Exception {
        super.tearDown();
    }
   
    public void testSetInstanceID() {
      InstanceID id = new InstanceID(1);
      tokenImpl.setInstanceID(id);
      assertEquals(id,tokenImpl.getInstanceID());
    }
   
    public void testSetCurrentNodeID(){
      tokenImpl.setCurrentNodeID(new NodeID(101));
      assertEquals(101,tokenImpl.getCurrentNodeID().getID());
    }
   
    public void testSetCurrentState(){
      tokenImpl.setCurrentState(10);
      assertEquals(10,tokenImpl.getCurrentState());
    }
   
    public void testSetActive(){
      tokenImpl.setActive(false);
      assertEquals(false,tokenImpl.isActive());
    }
   
    public void testSetTokenID(){
      TokenID token = new TokenID(1);
      tokenImpl.setTokenID(token);
      assertEquals(token,tokenImpl.getTokenID());
    }

   
}
TOP

Related Classes of org.apache.agila.impl.TokenImplTestCase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.