本文整理匯總了Java中org.ofbiz.entity.util.EntityDataAssert類的典型用法代碼示例。如果您正苦於以下問題:Java EntityDataAssert類的具體用法?Java EntityDataAssert怎麽用?Java EntityDataAssert使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntityDataAssert類屬於org.ofbiz.entity.util包,在下文中一共展示了EntityDataAssert類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: run
import org.ofbiz.entity.util.EntityDataAssert; //導入依賴的package包/類
@Override
public void run(TestResult result) {
result.startTest(this);
try {
URL entityXmlURL = FlexibleLocation.resolveLocation(entityXmlUrlString);
List<Object> errorMessages = new LinkedList<Object>();
if ("assert".equals(this.action)) {
EntityDataAssert.assertData(entityXmlURL, delegator, errorMessages);
} else if ("load".equals(this.action)) {
EntitySaxReader reader = new EntitySaxReader(delegator);
reader.parse(entityXmlURL);
} else {
// uh oh, bad value
result.addFailure(this, new AssertionFailedError("Bad value [" + this.action + "] for action attribute of entity-xml element"));
}
if (UtilValidate.isNotEmpty(errorMessages)) {
for (Object failureMessage: errorMessages) {
result.addFailure(this, new AssertionFailedError(failureMessage.toString()));
}
}
} catch (Exception e) {
result.addError(this, e);
}
result.endTest(this);
}
示例2: run
import org.ofbiz.entity.util.EntityDataAssert; //導入依賴的package包/類
@Override
public void run(TestResult result) {
result.startTest(this);
try {
URL entityXmlURL = FlexibleLocation.resolveLocation(entityXmlUrlString);
List<Object> errorMessages = FastList.newInstance();
if ("assert".equals(this.action)) {
EntityDataAssert.assertData(entityXmlURL, delegator, errorMessages);
} else if ("load".equals(this.action)) {
EntitySaxReader reader = new EntitySaxReader(delegator);
reader.parse(entityXmlURL);
} else {
// uh oh, bad value
result.addFailure(this, new AssertionFailedError("Bad value [" + this.action + "] for action attribute of entity-xml element"));
}
if (UtilValidate.isNotEmpty(errorMessages)) {
for (Object failureMessage: errorMessages) {
result.addFailure(this, new AssertionFailedError(failureMessage.toString()));
}
}
} catch (Exception e) {
result.addError(this, e);
}
result.endTest(this);
}