Skip to content

Instantly share code, notes, and snippets.

muir@dotterel pastecode]$ cat target/failsafe-reports/TestSuite.txt
-------------------------------------------------------------------------------
Test set: TestSuite
-------------------------------------------------------------------------------
Tests run: 6, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 25.969 sec <<< FAILURE!
exactSearchTest(org.jboss.weld.examples.pastecode.test.selenium.PasteCodeTest) Time elapsed: 4.915 sec <<< FAILURE!
java.lang.AssertionError: A page should contain 'Posted by graham ...' expected:<true> but was:<false>
at org.testng.Assert.fail(Assert.java:89)
at org.testng.Assert.failNotEquals(Assert.java:443)
at org.testng.Assert.assertTrue(Assert.java:37)

Approved

Seam ...

  • Ready
  • Shell
  • Runner
  • Machine
  • Shell
@SuppressWarnings("unchecked")
@Produces @Named @RequestScoped
public List<User> getUsers()
{
return userDatabase.createQuery("select u from User u").getResultList();
}
<?xml version="1.0" encoding="UTF-8"?>
<faces-config id="seam3" version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xi="http://www.w3.org/2001/XInclude"
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/web-facesconfig_2_0.xsd">
<name>seam3</name>
<ordering>
<after>
<name>weld</name>
<others/>
/**
* The context in which instance injection occurs.
*
* @author Pete Muir
*
*/
public interface InjectionContext<T>
{
/**
@pmuir
pmuir / gist:579315
Created September 14, 2010 16:35 — forked from tsurdilo/gist:579313
@RunWith(Arquillian.class)
public class KSessionTest
{
@Deployment
public static JavaArchive createTestArchive()
{
String pkgPath = KSessionTest.class.getPackage().getName().replaceAll("\\.", "/");
JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class)
.addPackages(true, new DroolsModuleFilter("ksession"), KnowledgeBaseProducer.class.getPackage())
.addClass(KSessionTestRules.class)
@pmuir
pmuir / Config.java
Created September 14, 2010 17:19 — forked from tsurdilo/gist:579321
@Drools(kbuilderConfigFile = "kbuilderconfig.properties",
kbaseConfigFile = "kbaseconfig.properties",
})
@Produces
@ApplicationScoped
RuleResouces configureRules() {
// Here the RuleResource guesses at being a DRL based on extension (not sure if this is valid)
// I also compressed the URL back to a normal syntax
return new RuleResources().add(new RuleResource("classpath:/kbasetest.drl", "forkbasetest")).add(...);
}
@Produces
@SomeQualifier // The unique identifier for this generic configuration
public Dools setupDroolsConfig()
{
//set up the configuration and return it.
//any producer that returns a Drools automatically installs a
//set of generic beans with the same qualifier
}
public void breakWeld(HttpRequestContext requestContext, @Basic RequestContext basicRequestContext) {
requestContext.invalidate(); // This would cause the store to be marked invalid
requestContext.deactivate(); // This would cause the context to be marked inactive, and if invalid, cause bean instances to be destroyed
basicRequestContext.activate(); // This would cause a new request context to start
// Now you have broken your app totally.
}
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
*
* Use is subject to license terms.
*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a