functional tests:

* more tests added
* fixed copyright header
This commit is contained in:
teo_sarca 2009-01-29 18:04:06 +00:00
parent a2fb1cf06d
commit d134f19b91
6 changed files with 100 additions and 22 deletions

View File

@ -1,6 +1,16 @@
/** /******************************************************************************
* * Product: Adempiere ERP & CRM Smart Business Solution *
*/ * Copyright (C) 2008 SC ARHIPAC SERVICE SRL. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package test.functional; package test.functional;
import java.math.BigDecimal; import java.math.BigDecimal;

View File

@ -1,23 +1,40 @@
/****************************************************************************** /******************************************************************************
* Product: XERP Core * * Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2008 SC ARHIPAC SERVICE SRL. All Rights Reserved. * * Copyright (C) 2008 SC ARHIPAC SERVICE SRL. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/ *****************************************************************************/
package test.functional; package test.functional;
import org.compiere.model.MRefList; import org.compiere.model.MRefList;
import org.compiere.model.X_AD_Table; import org.compiere.model.X_AD_Table;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.ValueNamePair;
import test.AdempiereTestCase; import test.AdempiereTestCase;
/** /**
* Test MRefList class * Test MRefList class
* @author Teo Sarca, SC ARHIPAC SERVICE SRL * @author Teo Sarca, www.arhipac.ro
*
*/ */
public class MRefListTest extends AdempiereTestCase { public class MRefListTest extends AdempiereTestCase {
public void testGet() throws Exception {
@Override
protected void setUp() throws Exception
{
super.setUp();
Env.setContext(getCtx(), Env.LANGUAGE, "en_US");
}
public void testGet() throws Exception
{
// //
// Should be found // Should be found
MRefList rl = MRefList.get(getCtx(), MRefList rl = MRefList.get(getCtx(),
@ -32,11 +49,22 @@ public class MRefListTest extends AdempiereTestCase {
assertNull("Should not be found", rl); assertNull("Should not be found", rl);
} }
public void testGetListName() throws Exception { public void testGetListName() throws Exception
Env.setContext(getCtx(), Env.LANGUAGE, "en_US"); {
String name = MRefList.getListName(getCtx(), String name = MRefList.getListName(getCtx(),
X_AD_Table.ACCESSLEVEL_AD_Reference_ID, X_AD_Table.ACCESSLEVEL_AD_Reference_ID,
X_AD_Table.ACCESSLEVEL_All); X_AD_Table.ACCESSLEVEL_All);
assertEquals("All", name); assertEquals("All", name);
//
name = MRefList.getListName(getCtx(),
X_AD_Table.ACCESSLEVEL_AD_Reference_ID,
"InvalidAccessLevelValue");
assertTrue("Should not be found", org.compiere.util.Util.isEmpty(name));
}
public void testGetList() throws Exception
{
ValueNamePair[] vnp = MRefList.getList (getCtx(), X_AD_Table.ACCESSLEVEL_AD_Reference_ID, false);
assertTrue("Invalid result ", vnp.length > 0);
} }
} }

View File

@ -1,6 +1,16 @@
/** /******************************************************************************
* * Product: Adempiere ERP & CRM Smart Business Solution *
*/ * Copyright (C) 2008 SC ARHIPAC SERVICE SRL. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package test.functional; package test.functional;
import org.compiere.model.MSession; import org.compiere.model.MSession;

View File

@ -1,6 +1,16 @@
/** /******************************************************************************
* * Product: Adempiere ERP & CRM Smart Business Solution *
*/ * Copyright (C) 2008 SC ARHIPAC SERVICE SRL. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package test.functional; package test.functional;
import java.math.BigDecimal; import java.math.BigDecimal;

View File

@ -1,6 +1,16 @@
/** /******************************************************************************
* * Product: Adempiere ERP & CRM Smart Business Solution *
*/ * Copyright (C) 2008 SC ARHIPAC SERVICE SRL. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package test.functional; package test.functional;
import java.util.Properties; import java.util.Properties;

View File

@ -1,6 +1,16 @@
/** /******************************************************************************
* * Product: Adempiere ERP & CRM Smart Business Solution *
*/ * Copyright (C) 2008 SC ARHIPAC SERVICE SRL. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package test.functional; package test.functional;
import org.compiere.model.MUOM; import org.compiere.model.MUOM;