BIMserver icon indicating copy to clipboard operation
BIMserver copied to clipboard

Create a temporary bimserver instance

Open michelespinella opened this issue 2 years ago • 1 comments

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: <groupId>org.opensourcebim</groupId> <artifactId>bimserverclientlib</artifactId> 1.5.182

Can I do the same with the server? Thanks a lot for the support Kind regards Michele Spinella

michelespinella avatar Aug 30 '22 11:08 michelespinella

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.

GuusLieben avatar Aug 30 '22 13:08 GuusLieben