Skip to content

Commit 5a4abf8

Browse files
committed
Fix TCK runner AS7 datasource workaround to work with AS7.1
1 parent 24efce8 commit 5a4abf8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

jboss-tck-runner/src/test/java/org/jboss/weld/tck/jbossas/DatasourceManager.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ public void onStart(ITestContext context) {
101101
if (!result.get("outcome").asString().equals("success")) {
102102
throw new RuntimeException("DataSource java:/DefaultDS was not found and could not be created automatically: " + result);
103103
}
104+
// As of AS7 7.1 we have to enable DS
105+
ModelNode enableRequest = new ModelNode();
106+
enableRequest.get("operation").set("enable");
107+
enableRequest.get("address").get("subsystem").set("datasources");
108+
enableRequest.get("address").get("data-source").set(JNDI_NAME);
109+
ModelNode enableResult = client.execute(new OperationBuilder(enableRequest).build());
110+
if (!enableResult.get("outcome").asString().equals("success")) {
111+
throw new RuntimeException("DataSource java:/DefaultDS could not be enabled automatically: " + enableResult);
112+
}
113+
104114
} else {
105115
if (test != null && !(test.length() == 0)) {
106116
//we do not worry about this if we are only running one test

0 commit comments

Comments
 (0)