@@ -53,9 +53,6 @@ public void testOptions() {
5353 JsonObject config = new JsonObject ().put ("foo" , "bar" ).put ("obj" , new JsonObject ().put ("quux" , 123 ));
5454 assertEquals (options , options .setConfig (config ));
5555 assertEquals (config , options .getConfig ());
56- assertFalse (options .isWorker ());
57- assertEquals (options , options .setWorker (true ));
58- assertTrue (options .isWorker ());
5956 String rand = TestUtils .randomUnicodeString (1000 );
6057 assertFalse (options .isHa ());
6158 assertEquals (options , options .setHa (true ));
@@ -90,14 +87,12 @@ public void testCopyOptions() {
9087 long maxWorkerExecuteTime = TestUtils .randomPositiveLong ();
9188 TimeUnit maxWorkerExecuteTimeUnit = TimeUnit .MILLISECONDS ;
9289 options .setConfig (config );
93- options .setWorker (worker );
9490 options .setHa (ha );
9591 options .setWorkerPoolName (poolName );
9692 options .setWorkerPoolSize (poolSize );
9793 options .setMaxWorkerExecuteTime (maxWorkerExecuteTime );
9894 options .setMaxWorkerExecuteTimeUnit (maxWorkerExecuteTimeUnit );
9995 DeploymentOptions copy = new DeploymentOptions (options );
100- assertEquals (worker , copy .isWorker ());
10196 assertNotSame (config , copy .getConfig ());
10297 assertEquals ("bar" , copy .getConfig ().getString ("foo" ));
10398 assertEquals (ha , copy .isHa ());
@@ -112,7 +107,6 @@ public void testDefaultJsonOptions() {
112107 DeploymentOptions def = new DeploymentOptions ();
113108 DeploymentOptions json = new DeploymentOptions (new JsonObject ());
114109 assertEquals (def .getConfig (), json .getConfig ());
115- assertEquals (def .isWorker (), json .isWorker ());
116110 assertEquals (def .isHa (), json .isHa ());
117111 assertEquals (def .getWorkerPoolName (), json .getWorkerPoolName ());
118112 assertEquals (def .getWorkerPoolSize (), json .getWorkerPoolSize ());
@@ -141,7 +135,6 @@ public void testJsonOptions() {
141135 json .put ("maxWorkerExecuteTime" , maxWorkerExecuteTime );
142136 json .put ("maxWorkerExecuteTimeUnit" , maxWorkerExecuteTimeUnit );
143137 DeploymentOptions options = new DeploymentOptions (json );
144- assertEquals (worker , options .isWorker ());
145138 assertEquals ("bar" , options .getConfig ().getString ("foo" ));
146139 assertEquals (ha , options .isHa ());
147140 assertEquals (poolName , options .getWorkerPoolName ());
@@ -164,15 +157,13 @@ public void testToJson() {
164157 long maxWorkerExecuteTime = TestUtils .randomPositiveLong ();
165158 TimeUnit maxWorkerExecuteTimeUnit = TimeUnit .MILLISECONDS ;
166159 options .setConfig (config );
167- options .setWorker (worker );
168160 options .setHa (ha );
169161 options .setWorkerPoolName (poolName );
170162 options .setWorkerPoolSize (poolSize );
171163 options .setMaxWorkerExecuteTime (maxWorkerExecuteTime );
172164 options .setMaxWorkerExecuteTimeUnit (maxWorkerExecuteTimeUnit );
173165 JsonObject json = options .toJson ();
174166 DeploymentOptions copy = new DeploymentOptions (json );
175- assertEquals (worker , copy .isWorker ());
176167 assertEquals ("bar" , copy .getConfig ().getString ("foo" ));
177168 assertEquals (ha , copy .isHa ());
178169 assertEquals (poolName , copy .getWorkerPoolName ());
@@ -231,7 +222,7 @@ public void testDeployFromContext() throws Exception {
231222 @ Test
232223 public void testDeployWorkerFromTestThread () throws Exception {
233224 MyVerticle verticle = new MyVerticle ();
234- vertx .deployVerticle (verticle , new DeploymentOptions ().setWorker ( true )).onComplete (ar -> {
225+ vertx .deployVerticle (verticle , new DeploymentOptions ().setThreadingModel ( ThreadingModel . WORKER )).onComplete (ar -> {
235226 assertDeployment (1 , verticle , null , ar );
236227 assertTrue (verticle .startContext .isWorkerContext ());
237228 vertx .undeploy (ar .result ()).onComplete (ar2 -> {
@@ -247,7 +238,7 @@ public void testDeployWorkerFromTestThread() throws Exception {
247238 public void testDeployWorkerWithConfig () throws Exception {
248239 MyVerticle verticle = new MyVerticle ();
249240 JsonObject conf = generateJSONObject ();
250- vertx .deployVerticle (verticle , new DeploymentOptions ().setConfig (conf ).setWorker ( true )).onComplete (ar -> {
241+ vertx .deployVerticle (verticle , new DeploymentOptions ().setConfig (conf ).setThreadingModel ( ThreadingModel . WORKER )).onComplete (ar -> {
251242 assertDeployment (1 , verticle , conf , ar );
252243 assertTrue (verticle .startContext .isWorkerContext ());
253244 assertFalse (verticle .startContext .isEventLoopContext ());
@@ -278,7 +269,7 @@ public void stop() throws Exception {
278269 assertFalse (Context .isOnEventLoopThread ());
279270 }
280271 };
281- vertx .deployVerticle (verticle , new DeploymentOptions ().setWorker ( true ))
272+ vertx .deployVerticle (verticle , new DeploymentOptions ().setThreadingModel ( ThreadingModel . WORKER ))
282273 .onComplete (onSuccess (res -> {
283274 assertTrue (Context .isOnVertxThread ());
284275 assertFalse (Context .isOnWorkerThread ());
0 commit comments