package org.nthx.pat;
import junit.framework.TestCase;
import org.apache.log4j.Logger;
public class CommandGenerationHelperTest
extends TestCase
{
public void testBos2Stream()
{
User user = new User();
user.setOID(new Long(17));
User target = new User();
target.setOID(new Long(102301230123L));
Object[] bos = new Object[3];
bos[0] = new String("AAAA"); bos[1] = user; bos[2] = new Long(8);
ObjectForStream[] forStream =
CommandGenerationHelper.targetAndBos2FakeOIDs(target, bos);
assertNotNull(forStream);
assertEquals(4, forStream.length);
assertNotNull(forStream[0]);
assertNotNull(forStream[1]);
assertNotNull(forStream[2]);
assertNotNull(forStream[3]);
assertEquals(true, forStream[0].isBo);
assertEquals(false, forStream[1].isBo);
assertEquals(true, forStream[2].isBo);
assertEquals(false, forStream[3].isBo);
assertEquals(new Long(102301230123L), forStream[0].objectOrOID);
assertEquals("AAAA", forStream[1].objectOrOID);
assertEquals(new Long(17), forStream[2].objectOrOID);
assertEquals(new Long(8), forStream[3].objectOrOID);
}
private class User
extends IdentifiableMixin
implements BusinessObject
{
}
public CommandGenerationHelperTest(String arg)
{
super(arg);
}
public static void main(String[] args)
{
junit.textui.TestRunner.run(CommandGenerationHelperTest.class);
}
private transient Logger logTest = Logger.getLogger("pat");
}