Skip to content

Commit aee0dfa

Browse files
committed
Add unit tests and fix headers
1 parent 1056f84 commit aee0dfa

File tree

3 files changed

+51
-30
lines changed

3 files changed

+51
-30
lines changed

src/main/java/com/ibm/watson/developer_cloud/retrieve_and_rank/v1/model/SolrClusterResizeRequest.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
/*
2-
* BEGIN_COPYRIGHT
3-
*
4-
* IBM Confidential OCO Source Materials
5-
*
6-
* 5725-Y07 (C) Copyright IBM Corp. 2016 All Rights Reserved.
7-
*
8-
* The source code for this program is not published or otherwise divested of its trade secrets,
9-
* irrespective of what has been deposited with the U.S. Copyright Office.
10-
*
11-
* END_COPYRIGHT
1+
/**
2+
* Copyright 2016 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
1213
*/
1314
package com.ibm.watson.developer_cloud.retrieve_and_rank.v1.model;
1415

src/main/java/com/ibm/watson/developer_cloud/retrieve_and_rank/v1/model/SolrClusterSizeResponse.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
/* BEGIN_COPYRIGHT
2-
*
3-
* IBM Confidential
4-
* OCO Source Materials
5-
*
6-
* 5725-Y07
7-
* (C) Copyright IBM Corp. 2016 All Rights Reserved.
8-
*
9-
* The source code for this program is not published or otherwise
10-
* divested of its trade secrets, irrespective of what has been
11-
* deposited with the U.S. Copyright Office.
12-
*
13-
* END_COPYRIGHT
1+
/**
2+
* Copyright 2016 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
1413
*/
1514
package com.ibm.watson.developer_cloud.retrieve_and_rank.v1.model;
1615

src/test/java/com/ibm/watson/developer_cloud/retrieve_and_rank/v1/RetrieveAndRankIT.java

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,14 @@
1313
*/
1414
package com.ibm.watson.developer_cloud.retrieve_and_rank.v1;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertFalse;
18-
import static org.junit.Assert.assertNotNull;
19-
import static org.junit.Assert.assertTrue;
16+
import static org.junit.Assert.*;
2017

2118
import java.io.File;
2219
import java.io.FileInputStream;
2320
import java.io.IOException;
2421
import java.io.InputStream;
2522
import java.util.List;
2623

27-
import com.ibm.watson.developer_cloud.service.exception.NotFoundException;
28-
2924
import org.junit.Assume;
3025
import org.junit.AssumptionViolatedException;
3126
import org.junit.Before;
@@ -41,8 +36,10 @@
4136
import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.model.SolrCluster;
4237
import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.model.SolrCluster.Status;
4338
import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.model.SolrClusterOptions;
39+
import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.model.SolrClusterSizeResponse;
4440
import com.ibm.watson.developer_cloud.retrieve_and_rank.v1.model.SolrClusterStats;
4541
import com.ibm.watson.developer_cloud.service.exception.BadRequestException;
42+
import com.ibm.watson.developer_cloud.service.exception.NotFoundException;
4643

4744
/**
4845
* The Class RetrieveAndRankIT.
@@ -320,4 +317,28 @@ public void testUploadAndDeleteSolrClusterConfigurationZip() {
320317
}
321318
}
322319

320+
/**
321+
* Test solr cluster resize.
322+
*
323+
* @throws InterruptedException
324+
*/
325+
@Test
326+
public void testSolrClusterResize() throws InterruptedException {
327+
SolrClusterSizeResponse resizeRequestResponse =
328+
service.resizeSolrCluster(clusterId, 2).execute();
329+
assertTrue(resizeRequestResponse.geClusterId().equals(clusterId));
330+
assertTrue(resizeRequestResponse.getCurrentSize().equals(CREATED_CLUSTER_SIZE_ONE));
331+
assertTrue(resizeRequestResponse.getTargetSize().equals(2));
332+
try {
333+
for (int x = 0; x < 60 && resizeRequestResponse.getCurrentSize() != 2; x++) {
334+
Thread.sleep(10000);
335+
resizeRequestResponse = service.getSolrClusterResizeStatus(clusterId).execute();
336+
}
337+
assertTrue(resizeRequestResponse.geClusterId().equals(clusterId));
338+
assertTrue(resizeRequestResponse.getCurrentSize().equals(2));
339+
assertNull(resizeRequestResponse.getTargetSize());
340+
} finally {
341+
service.deleteSolrCluster(clusterId).execute();
342+
}
343+
}
323344
}

0 commit comments

Comments
 (0)