This file contains hidden or 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 br.com.caelum.produtos.aceitacao; | |
import org.junit.Assert; | |
import org.junit.Test; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
public class PaginaIndexIT { |
This file contains hidden or 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
<!-- copia para pasta WEB-INF.xml --> | |
<beans | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation=" | |
http://java.sun.com/xml/ns/javaee | |
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd" > | |
</beans> |
This file contains hidden or 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
<!-- no arquivo standalone-jms.xml --> | |
<security-domain name="lojaDomain" cache-type="default"> | |
<authentication> | |
<login-module code="Database" flag="required"> | |
<module-option name="dsJndiName" value="java:/livrariaDS"/> | |
<module-option name="principalsQuery" value="select password from users where user=?"/> | |
<module-option name="rolesQuery" value="select role, 'Roles' from roles where user like ?"/> | |
</login-module> | |
</authentication> |
This file contains hidden or 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
<script src="resources/js/jquery.js"></script> | |
<script> | |
$("input[type=submit]").on("click", function(event) { | |
event.preventDefault(); | |
$.ajax({ | |
url : "adiciona", | |
data : $("form").serialize(), | |
success : function(retorno, codigo, xhr) { | |
$(retorno).appendTo("table"); |
This file contains hidden or 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
Gerenciando o certificado com o Java keytool: | |
Para gerar um certificado válido por 180 dias, usando algoritmo RSA:: | |
keytool -genkey -keyalg RSA -alias livraria -keystore caelum_keystore.jks -storepass caelum -validity 180 | |
Obs: Para usar com Tomcat usa a mesma senha para o keystore e para o certificado! | |
Para listar todo o conteudo do keystore: |
This file contains hidden or 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 br.com.caelum.threads; | |
public class Banheiro { | |
private boolean sujo = true; | |
public void fazNumero1() { | |
String nomeAluno = Thread.currentThread().getName(); | |
System.out.println(nomeAluno + " tentando entrar no banheiro"); |
This file contains hidden or 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
jndi.properties | |
---------------- | |
java.naming.factory.url.pkgs=org.jboss.ejb.client.naming | |
jboss-ejb-client.properties (Usuario deve ser criado antes através do add-user.sh) | |
---------------------------- | |
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false |
This file contains hidden or 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 br.com.caelum.camel; | |
import org.apache.camel.CamelContext; | |
import org.apache.camel.Exchange; | |
import org.apache.camel.LoggingLevel; | |
import org.apache.camel.builder.RouteBuilder; | |
import org.apache.camel.impl.DefaultCamelContext; | |
import org.apache.camel.model.dataformat.XmlJsonDataFormat; | |
public class TesteRoteamento { |
This file contains hidden or 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
<property name="hibernate.connection.provider_class" value="org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider"/> | |
<property name="hibernate.c3p0.min_size" value="5" /> | |
<property name="hibernate.c3p0.max_size" value="20" /> | |
<property name="hibernate.c3p0.timeout" value="180" /> | |
<property name="hibernate.c3p0.idle_test_period" value="100" /> |
This file contains hidden or 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
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee | |
http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" | |
version="3.1"> | |
<interceptors> | |
<interceptor> | |
<interceptor-class>br.com.caelum.financas.interceptor.LogInterceptor</interceptor-class> | |
</interceptor> |