Skip to content

Commit 4f26661

Browse files
authored
Merge pull request #194 from WASdev/dev_bd
Fixed deprecations
2 parents 892c30d + bfcf077 commit 4f26661

File tree

29 files changed

+92
-66
lines changed

29 files changed

+92
-66
lines changed

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ build
1919

2020
# Mac stuff
2121
**/.DS_Store
22+
23+
#IntelliJ stuff
24+
.idea

Diff for: cli-client/src/fat/java/com/ibm/ws/lars/upload/cli/UploadFatTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import static org.hamcrest.Matchers.equalTo;
2121
import static org.hamcrest.Matchers.hasProperty;
2222
import static org.junit.Assert.assertEquals;
23-
import static org.junit.Assert.assertThat;
23+
import static org.hamcrest.MatcherAssert.assertThat;
2424

2525
import java.io.File;
2626
import java.util.Arrays;

Diff for: cli-client/src/test/java/com/ibm/ws/lars/upload/cli/MainTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import static org.hamcrest.Matchers.containsString;
2020
import static org.junit.Assert.assertEquals;
21-
import static org.junit.Assert.assertThat;
21+
import static org.hamcrest.MatcherAssert.assertThat;
2222
import static org.junit.Assert.fail;
2323

2424
import java.io.ByteArrayInputStream;

Diff for: cli-client/src/test/java/com/ibm/ws/lars/upload/cli/UploadTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import static org.junit.Assert.assertEquals;
2121
import static org.junit.Assert.assertNotNull;
2222
import static org.junit.Assert.assertNull;
23-
import static org.junit.Assert.assertThat;
23+
import static org.hamcrest.MatcherAssert.assertThat;
2424
import static org.junit.Assert.fail;
2525

2626
import java.io.ByteArrayInputStream;

Diff for: client-lib-tests/src/fat/java/com/ibm/ws/repository/test/EsaResourceTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import static org.junit.Assert.assertEquals;
2727
import static org.junit.Assert.assertFalse;
2828
import static org.junit.Assert.assertNull;
29-
import static org.junit.Assert.assertThat;
29+
import static org.hamcrest.MatcherAssert.assertThat;
3030
import static org.junit.Assert.assertTrue;
3131

3232
import java.io.File;

Diff for: client-lib-tests/src/fat/java/com/ibm/ws/repository/test/RepositoryUtilsTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ public void testRepositoryStatusOK() throws IOException, RequestFailureException
7777
*/
7878
@Test
7979
public void testInvalidRepositoryNotAvailable() {
80-
RestRepositoryConnection invalidLoginInfo = new RestRepositoryConnection("I", "don't", "exist", "http://dont.exist.com");
80+
RestRepositoryConnection invalidLoginInfo = new RestRepositoryConnection("I", "don't", "exist", "http://dont252qmadjf842sgs7842d.hu43634existsaosd.com");
8181
assertFalse("An invalid test repository should not be available", invalidLoginInfo.isRepositoryAvailable());
8282
}
8383

8484
@Test
8585
public void testInvalidRepositoryThrowsException() throws IOException, RequestFailureException {
86-
RestRepositoryConnection invalidLoginInfo = new RestRepositoryConnection("I", "don't", "exist", "http://dont.exist.com");
86+
RestRepositoryConnection invalidLoginInfo = new RestRepositoryConnection("I", "don't", "exist", "http://dont252qmadjf842sgs7842d.hu43634existsaosd.com");
8787
try {
8888
invalidLoginInfo.checkRepositoryStatus();
8989
fail("Should not have been able to reach here, repository status should have thrown an exception");

Diff for: client-lib-tests/src/fat/java/com/ibm/ws/repository/test/ResourceTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import static org.junit.Assert.assertFalse;
2525
import static org.junit.Assert.assertNotNull;
2626
import static org.junit.Assert.assertNull;
27-
import static org.junit.Assert.assertThat;
27+
import static org.hamcrest.MatcherAssert.assertThat;
2828
import static org.junit.Assert.assertTrue;
2929
import static org.junit.Assert.fail;
3030
import static org.junit.Assume.assumeThat;

Diff for: client-lib-tests/src/fat/java/com/ibm/ws/repository/test/SampleResourceTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import static org.hamcrest.Matchers.contains;
2323
import static org.hamcrest.Matchers.containsInAnyOrder;
2424
import static org.junit.Assert.assertEquals;
25-
import static org.junit.Assert.assertThat;
25+
import static org.hamcrest.MatcherAssert.assertThat;
2626

2727
import java.io.IOException;
2828
import java.lang.reflect.InvocationTargetException;

Diff for: client-lib-tests/src/fat/java/com/ibm/ws/repository/transport/client/test/RepositoryClientTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import static org.junit.Assert.assertFalse;
2222
import static org.junit.Assert.assertNotNull;
2323
import static org.junit.Assert.assertNull;
24-
import static org.junit.Assert.assertThat;
24+
import static org.hamcrest.MatcherAssert.assertThat;
2525
import static org.junit.Assert.assertTrue;
2626
import static org.junit.Assert.fail;
2727
import static org.junit.Assume.assumeThat;

Diff for: client-lib-tests/src/fat/java/com/ibm/ws/repository/transport/client/test/RestClientTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import static org.junit.Assert.assertEquals;
2424
import static org.junit.Assert.assertFalse;
2525
import static org.junit.Assert.assertNotNull;
26-
import static org.junit.Assert.assertThat;
26+
import static org.hamcrest.MatcherAssert.assertThat;
2727
import static org.junit.Assert.assertTrue;
2828
import static org.junit.Assert.fail;
2929

Diff for: client-lib-tests/src/test/java/com/ibm/ws/repository/common/enums/test/FilterPredicateTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import static org.hamcrest.CoreMatchers.containsString;
1919
import static org.junit.Assert.assertEquals;
20-
import static org.junit.Assert.assertThat;
20+
import static org.hamcrest.MatcherAssert.assertThat;
2121
import static org.junit.Assert.assertTrue;
2222
import static org.junit.Assert.fail;
2323

Diff for: client-lib-tests/src/test/java/com/ibm/ws/repository/connections/test/SingleFileRepositoryConnectionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import static org.hamcrest.Matchers.emptyCollectionOf;
1919
import static org.hamcrest.Matchers.is;
20-
import static org.junit.Assert.assertThat;
20+
import static org.hamcrest.MatcherAssert.assertThat;
2121
import static org.junit.Assert.fail;
2222

2323
import java.io.File;

Diff for: client-lib-tests/src/test/java/com/ibm/ws/repository/resources/internal/test/EsaResourceImplTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import static org.junit.Assert.assertEquals;
2121
import static org.junit.Assert.assertNotNull;
2222
import static org.junit.Assert.assertNull;
23-
import static org.junit.Assert.assertThat;
23+
import static org.hamcrest.MatcherAssert.assertThat;
2424

2525
import java.util.ArrayList;
2626
import java.util.Collection;

Diff for: client-lib-tests/src/test/java/com/ibm/ws/repository/transport/client/test/AbstractFileClientTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import static org.hamcrest.Matchers.hasSize;
1919
import static org.junit.Assert.assertEquals;
20-
import static org.junit.Assert.assertThat;
20+
import static org.hamcrest.MatcherAssert.assertThat;
2121

2222
import java.io.File;
2323
import java.io.IOException;

Diff for: client-lib/src/main/java/com/ibm/ws/repository/resources/internal/EsaResourceImpl.java

+3
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ public Collection<Link> getLinks() {
433433

434434
/** {@inheritDoc} */
435435
@Override
436+
@SuppressWarnings("deprecation")
436437
public void addRequireFeature(String requiredFeatureSymbolicName) {
437438
copyRequireFeatureToRequireFeatureWithTolerates();
438439
// Add to the old field without tolerates info
@@ -534,6 +535,7 @@ public Collection<String> getRequireFix() {
534535

535536
/** {@inheritDoc} */
536537
@Override
538+
@SuppressWarnings("deprecation")
537539
public void setRequireFeature(Collection<String> feats) {
538540
// No need to copy (like we do in addRequireFeatureWithTolerates)
539541
// as we are overwriting anyway
@@ -580,6 +582,7 @@ public void setRequireFeatureWithTolerates(Map<String, Collection<String>> featu
580582

581583
/** {@inheritDoc} */
582584
@Override
585+
@SuppressWarnings("deprecation")
583586
public Collection<String> getRequireFeature() {
584587
return _asset.getWlpInformation().getRequireFeature();
585588
}

Diff for: server/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ dependencies {
8181
compile group:'com.fasterxml.jackson.core', name:'jackson-core', version:jackson_version
8282
compile group:'com.fasterxml.jackson.core', name:'jackson-databind', version:jackson_version
8383
compile group:'com.fasterxml.jackson.core', name:'jackson-annotations', version:jackson_version
84-
84+
8585
sharedLibs group:'org.mongodb', name:'mongo-java-driver', version:mongodb_java_version
8686
providedCompile fileTree(dir: "${libertyRoot}/dev/api/spec", include: requiredSpecJars)
8787
providedCompile fileTree(dir: "${libertyRoot}/dev/api/ibm", include: requiredIbmJars)

Diff for: server/src/fat/java/com/ibm/ws/lars/rest/ApiTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import static org.hamcrest.Matchers.containsString;
2323
import static org.junit.Assert.assertArrayEquals;
2424
import static org.junit.Assert.assertEquals;
25-
import static org.junit.Assert.assertThat;
25+
import static org.hamcrest.MatcherAssert.assertThat;
2626
import static org.junit.Assert.assertTrue;
2727
import static org.junit.Assert.fail;
2828

Diff for: server/src/fat/java/com/ibm/ws/lars/rest/ImCompatibilityTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import static org.hamcrest.CoreMatchers.containsString;
1919
import static org.hamcrest.collection.IsMapContaining.hasEntry;
20-
import static org.junit.Assert.assertThat;
20+
import static org.hamcrest.MatcherAssert.assertThat;
2121

2222
import java.io.ByteArrayInputStream;
2323
import java.util.Properties;

Diff for: server/src/fat/java/com/ibm/ws/lars/rest/PermissionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import static com.ibm.ws.lars.rest.matchers.ServerAssetByIdMatcher.assetsWithIds;
2020
import static org.hamcrest.Matchers.containsInAnyOrder;
2121
import static org.junit.Assert.assertEquals;
22-
import static org.junit.Assert.assertThat;
22+
import static org.hamcrest.MatcherAssert.assertThat;
2323

2424
import java.io.IOException;
2525
import java.nio.charset.StandardCharsets;

Diff for: server/src/fat/java/com/ibm/ws/lars/rest/PersistenceBeanTest.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import static org.hamcrest.Matchers.containsInAnyOrder;
2424
import static org.junit.Assert.assertEquals;
2525
import static org.junit.Assert.assertNotNull;
26-
import static org.junit.Assert.assertThat;
26+
import static org.hamcrest.MatcherAssert.assertThat;
2727
import static org.junit.Assert.assertTrue;
2828
import static org.junit.Assert.fail;
2929

@@ -39,6 +39,7 @@
3939
import java.util.Map;
4040
import java.util.logging.Logger;
4141

42+
import com.mongodb.MongoClientOptions;
4243
import org.junit.After;
4344
import org.junit.Before;
4445
import org.junit.Test;
@@ -55,15 +56,13 @@
5556
import com.ibm.ws.lars.testutils.FatUtils;
5657
import com.mongodb.DB;
5758
import com.mongodb.MongoClient;
58-
import com.mongodb.WriteConcern;
5959

6060
import mockit.Mocked;
6161

6262
public class PersistenceBeanTest {
6363

6464
// TODO Should the db name be configurable?
6565
private static final String DB_NAME = "testdb";
66-
private static final WriteConcern WRITE_CONCERN = WriteConcern.JOURNAL_SAFE;
6766

6867
private MongoClient mongoClient;
6968
private PersistenceBean persistenceBean;
@@ -86,8 +85,7 @@ public void setUp() throws Exception {
8685
//
8786
// Also we currently don't bother with Mongo security but clearly we
8887
// might like to think about that at some point
89-
mongoClient = new MongoClient("localhost:" + FatUtils.DB_PORT);
90-
mongoClient.setWriteConcern(WRITE_CONCERN);
88+
mongoClient = new MongoClient("localhost:" + FatUtils.DB_PORT, new MongoClientOptions.Builder().build());
9189

9290
db = mongoClient.getDB(DB_NAME);
9391

Diff for: server/src/fat/java/com/ibm/ws/lars/rest/RepositoryContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
import org.apache.http.client.methods.HttpRequestBase;
5757
import org.apache.http.client.protocol.HttpClientContext;
5858
import org.apache.http.client.utils.URLEncodedUtils;
59-
import org.apache.http.conn.ssl.SSLContextBuilder;
59+
import org.apache.http.ssl.SSLContextBuilder;
6060
import org.apache.http.conn.ssl.TrustStrategy;
6161
import org.apache.http.entity.ByteArrayEntity;
6262
import org.apache.http.entity.ContentType;

Diff for: server/src/test/java/com/ibm/ws/lars/rest/AssetQueryParametersTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import static java.util.Arrays.asList;
2121
import static org.hamcrest.Matchers.containsInAnyOrder;
2222
import static org.junit.Assert.assertEquals;
23-
import static org.junit.Assert.assertThat;
23+
import static org.hamcrest.MatcherAssert.assertThat;
2424

2525
import java.util.ArrayList;
2626
import java.util.List;

0 commit comments

Comments
 (0)