|
14 | 14 | import java.nio.file.Files; |
15 | 15 | import java.nio.file.Path; |
16 | 16 | import java.nio.file.Paths; |
| 17 | +import org.jboss.arquillian.container.test.api.RunAsClient; |
17 | 18 |
|
18 | 19 | import static org.junit.Assert.assertTrue; |
19 | 20 |
|
|
22 | 23 | */ |
23 | 24 | @RunWith(Arquillian.class) |
24 | 25 | public class SchemaGenScriptsTest { |
| 26 | + |
25 | 27 | @Deployment |
26 | 28 | public static WebArchive createDeployment() { |
27 | 29 | WebArchive war = ShrinkWrap.create(WebArchive.class) |
28 | | - .addPackage("org.javaee7.jpasamples.schema.gen.scripts.generate") |
29 | | - .addAsResource("META-INF/persistence.xml"); |
| 30 | + .addPackage("org.javaee7.jpasamples.schema.gen.scripts.generate") |
| 31 | + .addAsResource("META-INF/persistence.xml"); |
30 | 32 | System.out.println(war.toString(true)); |
31 | 33 | return war; |
32 | 34 | } |
33 | 35 |
|
34 | 36 | @After |
35 | 37 | public void tearDown() throws Exception { |
36 | | - new File("/tmp/create.sql").delete(); |
37 | | - new File("/tmp/drop.sql").delete(); |
| 38 | + System.out.println(new File("target/create-script.sql").getAbsolutePath()); |
| 39 | + new File("target/create-script.sql").delete(); |
| 40 | + new File("target/drop-script.sql").delete(); |
38 | 41 | } |
39 | 42 |
|
40 | 43 | @Test |
| 44 | + @RunAsClient |
41 | 45 | public void testSchemaGenIndex() throws Exception { |
42 | | - Path create = Paths.get("/tmp/create.sql"); |
| 46 | + Path create = Paths.get("target","create-script.sql"); |
43 | 47 | assertTrue(Files.exists(create)); |
44 | 48 |
|
45 | | - Path drop = Paths.get("/tmp/drop.sql"); |
| 49 | + Path drop = Paths.get("target","drop-script.sql"); |
46 | 50 | assertTrue(Files.exists(create)); |
47 | 51 |
|
48 | 52 | String line; |
|
0 commit comments