This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SomeBean { | |
@Interceptors(ValidationInterceptor.class) | |
public void addAuthor(@Size(min=5) String name, | |
String surename) { | |
Author a = new Author(); | |
a.setName(name); | |
a.setSurename(surename); | |
em.persist(a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So the answer was: I used wrong import for @Inject. Not from javax, but org.aqruillian and earlier on haven't put beans.xml in archive. With these two things sorted out - the desired-test example works fine. | |
------- | |
So the things is - I have this test to check validation on the server side. | |
I build arquillian archive and deploy it to a remote server: as shown | |
in desired-test.java. | |
As I'm running arquillian test suite I'd rather take this approach that | |
have a hibernate-validator dependency in my test scope to get validator | |
from default factory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.marchwicki.jee6.basetypes; | |
import javax.xml.bind.annotation.XmlElement; | |
import javax.xml.bind.annotation.XmlRootElement; | |
@XmlRootElement(name="helloMessage") | |
public class HelloMessage { | |
@XmlElement(name="message") | |
public String getMessage() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InputStream stream = ConfigHelper.getResourceAsStream("/filename.sql"); | |
InputStreamReader importFileReader = new InputStreamReader(stream); | |
Connection connection = ds.getConnection(); | |
Statement statement = connection.createStatement(); | |
BufferedReader reader = new BufferedReader(importFileReader); | |
for (String sql = reader.readLine(); sql != null; sql = reader.readLine()) { | |
try { | |
String trimmedSql = sql.trim(); |
NewerOlder