Skip to content

Commit ad2cbe0

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 39365f3 + 1e2696f commit ad2cbe0

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

src/main/java/org/javawebstack/framework/WebApplication.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ public I18N getTranslation() {
263263
return translation;
264264
}
265265

266+
public CommandSystem getCommandSystem() {
267+
return commandSystem;
268+
}
269+
266270
protected void setupModules() {
267271
}
268272

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
11
package org.javawebstack.framework.testing;
22

3+
import org.javawebstack.command.CommandResult;
34
import org.javawebstack.framework.WebApplication;
5+
import org.javawebstack.framework.config.Config;
46
import org.javawebstack.httpserver.test.HTTPTest;
7+
import org.javawebstack.injector.Injector;
58

6-
public abstract class WebFrameworkTest {
9+
public abstract class WebFrameworkTest extends HTTPTest {
710

8-
private HTTPTest httpTest;
911
private WebApplication webApplication;
1012

1113
public WebFrameworkTest(WebApplication webApplication){
14+
super(webApplication.getServer());
15+
webApplication.getInjector().inject(this);
16+
1217
this.webApplication = webApplication;
13-
httpTest = new HTTPTest(webApplication.getServer()) {};
1418
}
1519

16-
public HTTPTest getHttpTest() {
17-
return httpTest;
20+
public WebApplication getApplication() {
21+
return webApplication;
1822
}
1923

20-
public WebApplication getWebApplication() {
21-
return webApplication;
24+
public Injector getInjector(){
25+
return webApplication.getInjector();
26+
}
27+
28+
public void seed(String name){
29+
webApplication.getSeeder(name).seed();
30+
}
31+
32+
public CommandResult runCommand(String... input){
33+
return webApplication.getCommandSystem().eval(input);
34+
}
35+
36+
public Config getConfig(){
37+
return webApplication.getConfig();
2238
}
2339
}

0 commit comments

Comments
 (0)