Skip to content

Instantly share code, notes, and snippets.

José Rodolfo Freitas joserodolfofreitas

  • Brazil
Block or report user

Report or block joserodolfofreitas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View directive-template.html
<select class="selectpicker" ng-transclude>
<option value="">{{defaultOption}}</option>
</select>
@joserodolfofreitas
joserodolfofreitas / exception
Created Jan 4, 2013
Problem to resolving maven dependencies in shrinkres alpha-7 when dependency is defined in the parent project.
View exception
.
.
.
Caused by: org.jboss.shrinkwrap.resolver.api.ResolutionException: Unable to get version for dependency specified by org.jboss.solder:solder-impl, it was not provided in <dependencyManagement> section.
at org.jboss.shrinkwrap.resolver.impl.maven.task.ResolveVersionFromMetadataTask.execute(ResolveVersionFromMetadataTask.java:91)
at org.jboss.shrinkwrap.resolver.impl.maven.PomEquippedResolveStageBaseImpl.resolveVersion(PomEquippedResolveStageBaseImpl.java:103)
at org.jboss.shrinkwrap.resolver.impl.maven.ResolveStageBaseImpl.resolveDependency(ResolveStageBaseImpl.java:188)
at org.jboss.shrinkwrap.resolver.impl.maven.ResolveStageBaseImpl.resolveDependency(ResolveStageBaseImpl.java:183)
at org.jboss.shrinkwrap.resolver.impl.maven.ResolveStageBaseImpl.addDependencies(ResolveStageBaseImpl.java:173)
at org.jboss.shrinkwrap.resolver.impl.maven.ResolveStageBaseImpl.resolve(ResolveStageBaseImpl.java:89)
@joserodolfofreitas
joserodolfofreitas / ShrinkResAPIChanges.java
Created Jan 3, 2013
Changes from shrinkres 2.0.0-alpha-1 to 2.0.0-alpha-7
View ShrinkResAPIChanges.java
Alpha 1 {
war
.addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class).loadEffectivePom("pom.xml")
.artifact("org.apache.solr:solr-solrj")
.artifact("org.jboss.solder:solder-impl")
.artifact("org.apache.httpcomponents:httpclient")
.artifact("org.apache.httpcomponents:httpmime").resolveAsFiles())
.addClass(TestCase.class)
.addPackage(SomeClass.class.getPackage())
;
View gist:4193893
---
layout: reveal
title: "JavaOne 2012 | Testing JSF applications with Arquillian and Selenium"
---
%section
%img.splash{:src => "assets/jbosscommunity/splash_text.png"}
%section
%h1 Testing JSF applications
%h2.capitalize with Arquillian and Selenium
View gist:1468315
@ConversationScoped
public class EntityManagerProducer implements Serializable {
private static final long serialVersionUID = -8275317247692627840L;
@PersistenceUnit
private EntityManagerFactory entityManagerFactory;
@Produces
@ConversationScoped
@joserodolfofreitas
joserodolfofreitas / SqlQueryProducer.java
Created Dec 7, 2011
Producer that produces a Class with T.class as parameter.
View SqlQueryProducer.java
public class SqlQueryProducer {
@Inject
BeanManager beanManager;
@Produces
public <T> SqlQuery<T> producesSqlQuery(@New SqlQueryExecutor sqlQueryExecutor, InjectionPoint ip) {
@SuppressWarnings("unchecked")
Class<T> clazz = (Class<T>) ClassUtils.getParameterizedTypeFromAnnotated(ip.getAnnotated());
@joserodolfofreitas
joserodolfofreitas / gist:1439519
Created Dec 6, 2011
CDI with generic class and the hell of type erasure
View gist:1439519
I'm trying to achieve something that might be impossible, but before concluding that, I'd like to ask you, CDI gurus!
I have the following class:
public class Foo<T> {
public TypedQuery<T> getQuery(){
}
@joserodolfofreitas
joserodolfofreitas / gist:1393355
Created Nov 25, 2011
Error when running a test that is not related with persistence.
View gist:1393355
It seems that it tries to load a datasource even when I'm not working with a persistence Test. Is that a way to workaround that?
org.jboss.arquillian.persistence.exception.DataSourceNotDefinedException: Data source not defined!
at org.jboss.arquillian.persistence.metadata.MetadataProvider.isPersistenceFeatureEnabled(MetadataProvider.java:52)
at org.jboss.arquillian.persistence.PersistenceTestHandler.beforeTest(PersistenceTestHandler.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
View gist:1298830
14:23:51,044 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http--127.0.0.1-8080-2) Error Rendering View[/compsc/commons/zion-datatable.xhtml]: java.lang.NullPointerException
at br.com.softplan.pd.zion.faces.components.datable.ZionDataModel.load(ZionDataModel.java:61) [zion-faces-0.6-SNAPSHOT.jar:]
at org.primefaces.component.datatable.DataTable.loadLazyData(DataTable.java:692) [primefaces-3.0.M3.jar:]
at org.primefaces.component.datatable.DataTableRenderer.encodeTbody(DataTableRenderer.java:568) [primefaces-3.0.M3.jar:]
at org.primefaces.component.datatable.DataTableRenderer.encodeRegularTable(DataTableRenderer.java:227) [primefaces-3.0.M3.jar:]
at org.primefaces.component.datatable.DataTableRenderer.encodeMarkup(DataTableRenderer.java:205) [primefaces-3.0.M3.jar:]
at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:95) [primefaces-3.0.M3.jar:]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:883) [jboss-jsf-api_2.0_spec-1.0
@joserodolfofreitas
joserodolfofreitas / EntityInstanceHandler.java
Created Sep 27, 2011
creating a framework that provide some crud boilerplate code.
View EntityInstanceHandler.java
package org.jboss.saf;
import java.io.Serializable;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.criteria.CriteriaQuery;
public class EntityInstanceHandler implements Serializable {
You can’t perform that action at this time.