all assert use apache commons lang3's Validate
This commit is contained in:
@@ -20,7 +20,7 @@ import javax.xml.bind.annotation.XmlAnyElement;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.util.Assert;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.springside.modules.utils.Exceptions;
|
||||
import org.springside.modules.utils.Reflections;
|
||||
|
||||
@@ -140,7 +140,7 @@ public class JaxbMapper {
|
||||
}
|
||||
|
||||
protected static JAXBContext getJaxbContext(Class clazz) {
|
||||
Assert.notNull(clazz, "'clazz' must not be null");
|
||||
Validate.notNull(clazz, "'clazz' must not be null");
|
||||
JAXBContext jaxbContext = jaxbContexts.get(clazz);
|
||||
if (jaxbContext == null) {
|
||||
try {
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* 反射工具类.
|
||||
@@ -258,7 +257,7 @@ public class Reflections {
|
||||
}
|
||||
|
||||
public static Class<?> getUserClass(Object instance) {
|
||||
Assert.notNull(instance, "Instance must not be null");
|
||||
Validate.notNull(instance, "Instance must not be null");
|
||||
Class clazz = instance.getClass();
|
||||
if ((clazz != null) && clazz.getName().contains(CGLIB_CLASS_SEPARATOR)) {
|
||||
Class<?> superClass = clazz.getSuperclass();
|
||||
|
||||
+3
-3
@@ -8,13 +8,13 @@ package org.springside.modules.test.selenium;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||
import org.openqa.selenium.ie.InternetExplorerDriver;
|
||||
import org.openqa.selenium.remote.DesiredCapabilities;
|
||||
import org.openqa.selenium.remote.RemoteWebDriver;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* 创建WebDriver的工厂类.
|
||||
@@ -41,7 +41,7 @@ public class WebDriverFactory {
|
||||
driver = new ChromeDriver();
|
||||
} else if (driverName.startsWith(BrowserType.remote.name())) {
|
||||
String[] params = driverName.split(":");
|
||||
Assert.isTrue(params.length == 4,
|
||||
Validate.isTrue(params.length == 4,
|
||||
"Remote driver is not right, accept format is \"remote:localhost:4444:firefox\", but the input is\""
|
||||
+ driverName + "\"");
|
||||
|
||||
@@ -67,7 +67,7 @@ public class WebDriverFactory {
|
||||
}
|
||||
}
|
||||
|
||||
Assert.notNull(driver, "Driver could be found by name:" + driverName);
|
||||
Validate.notNull(driver, "Driver could be found by name:" + driverName);
|
||||
|
||||
return driver;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user