本文整理汇总了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);
}