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
post '/junit-results' do | |
result = JSON.parse(request.body.read) | |
passes = result['stats']['passes'] | |
failures = result['stats']['failures'] | |
File.open(File.dirname(__FILE__) + '/../../target/artifacts/reports/javascript.xml', 'w') do |f| | |
xml = Builder::XmlMarkup.new | |
suite = xml.testsuite :errors => 0, :failures => failures, :tests => passes, :name => "javascript.tests" do | |
result['results'].each do |tc| | |
unless tc.nil? | |
tc['specs'].each do |s| |
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
@Component | |
public class HackedParametersProvider extends OgnlParametersProvider { | |
public HackedParametersProvider(...., HttpServletRequest request, ...) { | |
super(....., new HackedRequest(request), ....); | |
} | |
} |
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
@Component | |
public class FreemarkerPathResolver extends DefaultPathResolver { | |
//delegate constructor | |
@Override | |
protected String getPrefix() { | |
return "/WEB-INF/freemarker/"; | |
} | |
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
@Target(ElementType.METHOD) | |
@Retention(RetentionType.RUNTIME) | |
public @interface DisplayTag { | |
String value(); | |
} |
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 Basket implements HypermediaResource { | |
private int id; | |
private String name; | |
public void configureRelations(RelationBuilder builder) { | |
builder.relation("self").uses(ItemController.class).showItem(id); | |
builder.relation("basket").at("/Basket/add/"+id); | |
} |
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
@Documented | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.FIELD) | |
public @interface Out { | |
} |
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
@Component | |
@ApplicationScoped | |
public class TenantRoutesParser implements RoutesParser { | |
private final RoutesParser parser; | |
public TenantRoutesParser(RoutesParser parser) { | |
this.parser = parser; | |
} |
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 my.apps.package; | |
public class CustomProvider extends GuiceProvider { | |
static class CustomModule extends AbstractModule { | |
private final Module module; | |
CustomModule(Module module) { | |
this.module = module; | |
} |
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 Calculadora { | |
private static final Prova _ = of(Prova.class); | |
public double mediaDeProvas(List<Prova> provas) { | |
return mediaPonderada(provas, function(_.getNota()), function(_.getPeso())); | |
} | |
public <T> double mediaPonderada(List<T> lista, Function<T, Double> valor, Function<T, Double> peso) { | |
double soma = 0.0; | |
double somaPesos = 0.0; |
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
@Component | |
class ActiveRecord[T](session:Session) { | |
implicit def obj2AR(obj:T) = new AR(session, obj) | |
} | |
class AR[T](session:Session, obj:T) { | |
def save = session.save(obj) | |
} |
OlderNewer