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
import java.io.Serializable; | |
import java.lang.annotation.Annotation; | |
import java.util.Set; | |
import javax.enterprise.context.ApplicationScoped; | |
import javax.enterprise.context.spi.CreationalContext; | |
import javax.enterprise.inject.Any; | |
import javax.enterprise.inject.Default; | |
import javax.enterprise.inject.spi.Bean; |
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
import static org.hamcrest.CoreMatchers.is; | |
import static org.hamcrest.CoreMatchers.not; | |
import static org.hamcrest.collection.IsEmptyCollection.empty; | |
import static org.junit.Assert.assertThat; | |
import java.util.Set; | |
import javax.validation.ConstraintViolation; | |
import javax.validation.Validation; | |
import javax.validation.Validator; |
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
/** | |
* Rewrite of the ActivitiRule since TestWatchman is deprecated for junit>4.9. | |
* | |
* @author Jan Galinski, Holisticon AG (jan.galinski@holisticon.de) | |
*/ | |
public class ActivitiTestWatcher extends TestWatcher implements ProcessEngineRule { | |
/** | |
* Default configuration file name when not used with needle. | |
*/ |
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 FactoryThatThrowsException { | |
// a String creation Factory/Builder ... | |
public static String getString() throws Exception { | |
throw new Exception(); | |
} | |
// normally would not compile | |
private final String aString = getString(); |
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
import java.util.Random; | |
public class Coin { | |
private static final Random random = new Random(); | |
@Deprecated | |
private Coin() { | |
// never instantiate | |
} |
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 sof14839561; | |
import static com.google.inject.Guice.createInjector; | |
import static com.google.inject.name.Names.named; | |
import static org.hamcrest.CoreMatchers.is; | |
import static org.junit.Assert.assertThat; | |
import javax.inject.Inject; | |
import javax.inject.Named; |
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 MyBean { | |
@Inject | |
@Named("myValue") | |
private String value; | |
@Produces | |
@Named("myValue") | |
private static String initValue() { | |
return new PropertyReader("file").getValue("parameter"); |
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 MyBean { | |
private String value; | |
@PostConstruct | |
public void initValue() { | |
value = new PropertyReader("file").getValue("parameter"); | |
} | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<ear-subdeployments-isolated>false</ear-subdeployments-isolated> | |
<!-- | |
I have a ear deployment, I'm specifying only the module which is client of the EJB Remote module running in AS5. | |
My client class is itself an EJB 3.1 running in JBoss AS7. It is client of an EJB 2.0 running in JBoss AS5. | |
--> | |
<sub-deployment name="my-ejb-module-on-as7-${project.version}.jar"> | |
<dependencies> |
NewerOlder