Advertisement
Guest User

Dynamic asset selection based on container config.

a guest
Jun 14th, 2010
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.57 KB | None | 0 0
  1.    @Deployment
  2.    public static Archive<?> createTestArchive(WebArchive war, ContainerConfiguration config)
  3.    {
  4.       war.addPackage(Game.class.getPackage())
  5.             .addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
  6.       if (config instanceof GlassFishConfiguration) {
  7.          war.addWebResource("glassfish-persistence.xml", "classes/META-INF/persistence.xml");
  8.       }
  9.       else if (config instanceof JBossASConfiguration) {
  10.          war.addWebResource("jbossas-persistence.xml", "classes/META-INF/persistence.xml");
  11.       }
  12.       return war;
  13.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement