} | } | ||||
/** | /** | ||||
* Checks if the object is serializable or not. To be used in assertion checks only, | |||||
* since the check might be a bit heavyweight. | |||||
* Checks if the object is serializable or not. To be used in assertion | |||||
* checks only, since the check might be a bit heavyweight. | |||||
* | * | ||||
* @param obj to be checked | |||||
* @param obj | |||||
* to be checked | |||||
* @return {@code true} | * @return {@code true} | ||||
* @throws AssertionError if the object is not serializable | |||||
* @throws AssertionError | |||||
* if the object is not serializable | |||||
*/ | */ | ||||
public static boolean checkSerialization(Object obj) { | public static boolean checkSerialization(Object obj) { | ||||
try { | try { | ||||
ObjectOutputStream dummyObjectOutputStream = new ObjectOutputStream(new OutputStream() { | |||||
@Override | |||||
public void write(int b) { | |||||
} | |||||
ObjectOutputStream dummyObjectOutputStream = new ObjectOutputStream( | |||||
new OutputStream() { | |||||
@Override | |||||
public void write(int b) { | |||||
} | |||||
@SuppressWarnings("NullableProblems") | |||||
@Override | |||||
public void write(byte[] ignored) { | |||||
} | |||||
@SuppressWarnings("NullableProblems") | |||||
@Override | |||||
public void write(byte[] ignored) { | |||||
} | |||||
@SuppressWarnings("NullableProblems") | |||||
@Override | |||||
public void write(byte[] b, int off, int len) { | |||||
} | |||||
}); | |||||
@SuppressWarnings("NullableProblems") | |||||
@Override | |||||
public void write(byte[] b, int off, int len) { | |||||
} | |||||
}); | |||||
dummyObjectOutputStream.writeObject(obj); | dummyObjectOutputStream.writeObject(obj); | ||||
} catch (Throwable e) { | } catch (Throwable e) { | ||||
throw new AssertionError("Formatter supplier should be serializable", e); | |||||
throw new AssertionError( | |||||
"Formatter supplier should be serializable", e); | |||||
} | } | ||||
return true; | return true; | ||||
} | } |
/* | /* | ||||
* (non-Javadoc) | * (non-Javadoc) | ||||
* | |||||
* @see javax.servlet.GenericServlet#destroy() | * @see javax.servlet.GenericServlet#destroy() | ||||
*/ | */ | ||||
@Override | @Override |
fireUploadSuccess(event.getFileName(), event.getMimeType(), | fireUploadSuccess(event.getFileName(), event.getMimeType(), | ||||
event.getContentLength()); | event.getContentLength()); | ||||
endUpload(); | endUpload(); | ||||
if(lastStartedEvent != null) | |||||
if (lastStartedEvent != null) | |||||
lastStartedEvent.disposeStreamVariable(); | lastStartedEvent.disposeStreamVariable(); | ||||
} | } | ||||
} | } | ||||
} finally { | } finally { | ||||
endUpload(); | endUpload(); | ||||
if(lastStartedEvent != null) | |||||
if (lastStartedEvent != null) | |||||
lastStartedEvent.disposeStreamVariable(); | lastStartedEvent.disposeStreamVariable(); | ||||
} | } | ||||
} | } |
"com\\.vaadin\\.screenshotbrowser\\.ScreenshotBrowser.*", // | "com\\.vaadin\\.screenshotbrowser\\.ScreenshotBrowser.*", // | ||||
"com\\.vaadin\\.osgi.*", // | "com\\.vaadin\\.osgi.*", // | ||||
"com\\.vaadin\\.server\\.osgi.*", | "com\\.vaadin\\.server\\.osgi.*", | ||||
//V7 | |||||
// V7 | |||||
"com\\.vaadin\\.v7\\.ui\\.themes\\.BaseTheme", | "com\\.vaadin\\.v7\\.ui\\.themes\\.BaseTheme", | ||||
"com\\.vaadin\\.v7\\.ui\\.themes\\.ChameleonTheme", | "com\\.vaadin\\.v7\\.ui\\.themes\\.ChameleonTheme", | ||||
"com\\.vaadin\\.v7\\.ui\\.themes\\.Reindeer", | "com\\.vaadin\\.v7\\.ui\\.themes\\.Reindeer", | ||||
"com\\.vaadin\\.v7\\.data\\.util.BeanItemContainerGenerator.*", | "com\\.vaadin\\.v7\\.data\\.util.BeanItemContainerGenerator.*", | ||||
"com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.connection\\.MockInitialContextFactory", | "com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.connection\\.MockInitialContextFactory", | ||||
"com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.DataGenerator", | "com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.DataGenerator", | ||||
"com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.FreeformQueryUtil", | |||||
}; | |||||
"com\\.vaadin\\.v7\\.data\\.util\\.sqlcontainer\\.FreeformQueryUtil", }; | |||||
/** | /** | ||||
* Tests that all the relevant classes and interfaces under | * Tests that all the relevant classes and interfaces under |
/** | /** | ||||
* Used to execute data generation | * Used to execute data generation | ||||
* | |||||
* | |||||
* @param initial | * @param initial | ||||
* {@code true} to mock initial data request; {@code false} | * {@code true} to mock initial data request; {@code false} | ||||
* for follow-up request. | * for follow-up request. |
protected Result<LocalDate> handleUnparsableDateString( | protected Result<LocalDate> handleUnparsableDateString( | ||||
String dateString) { | String dateString) { | ||||
try { | try { | ||||
String parseableString = dateString == null ? "" : dateString.replaceAll(" ", ""); | |||||
String parseableString = dateString == null ? "" | |||||
: dateString.replaceAll(" ", ""); | |||||
if (parseableString.length() % 2 == 1) { | if (parseableString.length() % 2 == 1) { | ||||
parseableString = "0" + parseableString; | parseableString = "0" + parseableString; | ||||
} | } |
* {@link Actions#moveToElement(WebElement, int, int)}. This method takes | * {@link Actions#moveToElement(WebElement, int, int)}. This method takes | ||||
* into account the W3C specification in browsers that properly implement | * into account the W3C specification in browsers that properly implement | ||||
* it. | * it. | ||||
* | |||||
* | |||||
* @param element | * @param element | ||||
* the element | * the element | ||||
* @param targetX | * @param targetX | ||||
* {@link Actions#moveToElement(WebElement, int, int)}. This method takes | * {@link Actions#moveToElement(WebElement, int, int)}. This method takes | ||||
* into account the W3C specification in browsers that properly implement | * into account the W3C specification in browsers that properly implement | ||||
* it. | * it. | ||||
* | |||||
* | |||||
* @param element | * @param element | ||||
* the element | * the element | ||||
* @param targetY | * @param targetY |