BIMserver
BIMserver copied to clipboard
Create a temporary bimserver instance
Good day all,
I need to create a temporary instance of bimserver in order to lauch integration tests. How I can procced? Have I to import in my pom.xml bimserver, is this the correct way?
I found out only the client:
Can I do the same with the server? Thanks a lot for the support Kind regards Michele Spinella
You can use the BIMserver artifact (org.opensourcebim:bimserver
), and use that to start an embedded server.
A basic server would be:
BimServerConfig config = new BimServerConfig();
BimServer bimServer = new BimServer(config);
EmbeddedWebServerInterface webServer = ...;
bimServer.setEmbeddedWebServer(webServer);
bimServer.start();
The starter JAR can serve as a sample as to what is required for this to work: opensourceBIM/BIMserver/../BimServerJar, specifically BimServerJar/JarBimServer.java
If you want you can also use the starter JAR through org.opensourcebim:bimserverjar
, though for tests I'd recommend the former.