test.functional: fixed minor transaction issues
This commit is contained in:
parent
8e5d2f5b53
commit
9f0cdd3457
|
@ -28,15 +28,10 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
package test.functional;
|
package test.functional;
|
||||||
|
|
||||||
//import org.compiere.model.I_AD_Alert;
|
|
||||||
//import org.compiere.model.I_AD_AlertProcessor;
|
|
||||||
import org.compiere.model.MAlert;
|
import org.compiere.model.MAlert;
|
||||||
import org.compiere.model.PO;
|
|
||||||
import org.compiere.model.X_AD_Alert;
|
|
||||||
import org.compiere.model.X_AD_AlertProcessor;
|
import org.compiere.model.X_AD_AlertProcessor;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Trx;
|
|
||||||
|
|
||||||
import test.AdempiereTestCase;
|
import test.AdempiereTestCase;
|
||||||
|
|
||||||
|
@ -58,16 +53,14 @@ public class AlertTest extends AdempiereTestCase
|
||||||
*/
|
*/
|
||||||
public void testAlertCreation() throws Exception
|
public void testAlertCreation() throws Exception
|
||||||
{
|
{
|
||||||
Trx trx = Trx.get(Trx.createTrxName("Test"), true);
|
log.info("trx = " + getTrxName());
|
||||||
trx.start();
|
|
||||||
log.info("trx = " + trx.toString());
|
|
||||||
boolean resultSave = false;
|
boolean resultSave = false;
|
||||||
|
|
||||||
//----- Old way:
|
//----- Old way:
|
||||||
MAlert alertOldWay = new MAlert(Env.getCtx(), 100, trx.getTrxName());
|
MAlert alertOldWay = new MAlert(Env.getCtx(), 100, getTrxName());
|
||||||
log.info(alertOldWay.toString());
|
log.info(alertOldWay.toString());
|
||||||
|
|
||||||
X_AD_AlertProcessor alertProcessorOldWay = new X_AD_AlertProcessor(Env.getCtx(), alertOldWay.getAD_AlertProcessor_ID(), trx.getTrxName());
|
X_AD_AlertProcessor alertProcessorOldWay = new X_AD_AlertProcessor(Env.getCtx(), alertOldWay.getAD_AlertProcessor_ID(), getTrxName());
|
||||||
log.info("alertProcessorOldWay.getAD_AlertProcessor_ID = " + alertProcessorOldWay.getAD_AlertProcessor_ID());
|
log.info("alertProcessorOldWay.getAD_AlertProcessor_ID = " + alertProcessorOldWay.getAD_AlertProcessor_ID());
|
||||||
|
|
||||||
alertOldWay.setDescription("Trifon test");
|
alertOldWay.setDescription("Trifon test");
|
||||||
|
@ -95,8 +88,7 @@ public class AlertTest extends AdempiereTestCase
|
||||||
System.out.println("New value of Description = " + alert.getDescription());
|
System.out.println("New value of Description = " + alert.getDescription());
|
||||||
*/
|
*/
|
||||||
|
|
||||||
trx.commit();
|
commit();
|
||||||
trx.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -533,7 +533,7 @@ public class MBPartnerLocationTest extends AdempiereTestCase {
|
||||||
m_group.setPriorityBase(MBPGroup.PRIORITYBASE_Same);
|
m_group.setPriorityBase(MBPGroup.PRIORITYBASE_Same);
|
||||||
m_group.save();
|
m_group.save();
|
||||||
|
|
||||||
m_partner = new MBPartner (getCtx(), 0, "test");
|
m_partner = new MBPartner (getCtx(), 0, getTrxName());
|
||||||
m_partner.setValue ("");
|
m_partner.setValue ("");
|
||||||
m_partner.setName ("Test Business Partner Location");
|
m_partner.setName ("Test Business Partner Location");
|
||||||
m_partner.setName2 (null);
|
m_partner.setName2 (null);
|
||||||
|
@ -553,7 +553,7 @@ public class MBPartnerLocationTest extends AdempiereTestCase {
|
||||||
m_partner.setBPGroup(m_group);
|
m_partner.setBPGroup(m_group);
|
||||||
// Reset Created, Updated to current system time ( teo_sarca )
|
// Reset Created, Updated to current system time ( teo_sarca )
|
||||||
if(m_partner.save()) {
|
if(m_partner.save()) {
|
||||||
bpl = new MBPartnerLocation (getCtx(), 0, "test");
|
bpl = new MBPartnerLocation (getCtx(), 0, getTrxName());
|
||||||
bpl.setIsActive(true);
|
bpl.setIsActive(true);
|
||||||
bpl.setName("Test Business Partner Location");
|
bpl.setName("Test Business Partner Location");
|
||||||
bpl.setC_BPartner_ID(m_partner.get_ID());
|
bpl.setC_BPartner_ID(m_partner.get_ID());
|
||||||
|
|
Loading…
Reference in New Issue