Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Spark Micro Framework #1

Open
cardil opened this issue Mar 5, 2016 · 3 comments
Open

Add support for Spark Micro Framework #1

cardil opened this issue Mar 5, 2016 · 3 comments

Comments

@cardil
Copy link
Member

cardil commented Mar 5, 2016

Spark is nice small library inspired directly by Sinatra. It will be nice to support it as well.

@cardil
Copy link
Member Author

cardil commented Mar 5, 2016

Unfortunately Spark doesn't support setting port from system property. I will create PR to Spark to add external port setting with -Dserver.port=12345. The same property as in Spring Boot.

@cardil
Copy link
Member Author

cardil commented Mar 5, 2016

This feature is blocked by perwendel/spark#478

@cardil
Copy link
Member Author

cardil commented Mar 6, 2016

There is a walk around for this, obviously. One should use port() Spark method to set port from system property, like this:

int sparkPort = Integer.valueOf(
  System.getProperty("spark.port", String.valueOf(spark.SparkInstance.SPARK_DEFAULT_PORT))
);
port(sparkPort);

Then when testing with Gasper:

@ClassRule
public static Gasper gasper = Gasper.builder()
  .usingSystemPropertyForPort("spark.port")
  .build();

This must be done explicitly in Spark application and can't be used by Gasper globally for all Spark applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@cardil and others