Skip to content

Commit 3730275

Browse files
committed
Fixing some minor warnings and errors in JPA tests
Signed-off-by: Will Dazey <[email protected]>
1 parent eb98ed2 commit 3730275

File tree

337 files changed

+10366
-2041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+10366
-2041
lines changed

antbuild.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1574,10 +1574,10 @@
15741574
<target name="test-jpa" description="run the jpa tests">
15751575
<ant antfile="antbuild.xml" dir="${eclipselink.jpa.test}" target="test-lrg"/>
15761576
</target>
1577-
<target name="test-jpa21" description="run the jpa tests">
1577+
<target name="test-jpa21" description="run the jpa 21 tests">
15781578
<ant antfile="antbuild.xml" dir="${eclipselink.jpa.test}" target="test-lrg"/>
15791579
</target>
1580-
<target name="test-jpa22" description="run the jpa tests">
1580+
<target name="test-jpa22" description="run the jpa 22 tests">
15811581
<ant antfile="antbuild.xml" dir="${eclipselink.jpa.test}" target="test-lrg22"/>
15821582
</target>
15831583
<!-- Run JPA SRG. -->

foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/distributedservers/rcm/jgroups/JGroupsConfigurationTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2019 Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2019 IBM Corporation. All rights reserved.
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -19,7 +20,6 @@
1920
import org.eclipse.persistence.sessions.coordination.RemoteCommandManager;
2021
import org.eclipse.persistence.sessions.coordination.TransportManager;
2122
import org.eclipse.persistence.testing.tests.distributedservers.rcm.ConfigurableCacheSyncDistributedTest;
22-
import org.junit.Assert;
2323

2424
import java.lang.reflect.Field;
2525

@@ -38,9 +38,9 @@ protected void test() throws Throwable {
3838
RemoteConnection connection = transport.getConnectionToLocalHost();
3939
try {
4040
int multicastPort = getMulticastPort(connection);
41-
Assert.assertEquals("Default multicast port different than expected", 45588, multicastPort);
41+
assertEquals("Default multicast port different than expected", 45588, multicastPort);
4242
} catch (Exception x) {
43-
Assert.fail("Failed to retrieve multicast port: " + x.getMessage());
43+
fail("Failed to retrieve multicast port: " + x.getMessage());
4444
} finally {
4545
connection.close();
4646
}
@@ -53,9 +53,9 @@ protected void test() throws Throwable {
5353
connection = transport.getConnectionToLocalHost();
5454
try {
5555
int multicastPort = getMulticastPort(connection);
56-
Assert.assertEquals("Configured multicast port different than expected", 45678, multicastPort);
56+
assertEquals("Configured multicast port different than expected", 45678, multicastPort);
5757
} catch (Exception x) {
58-
Assert.fail("Failed to retrieve multicast port: " + x.getMessage());
58+
fail("Failed to retrieve multicast port: " + x.getMessage());
5959
} finally {
6060
connection.close();
6161
}

foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeCompositeKeyTestSuite.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2019 IBM Corporation. All rights reserved.
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -24,7 +25,6 @@
2425

2526
//JUnit4 imports
2627
import org.junit.AfterClass;
27-
import org.junit.Assert;
2828
import org.junit.BeforeClass;
2929
import static org.junit.Assert.assertEquals;
3030
import static org.junit.Assert.assertFalse;
@@ -90,7 +90,7 @@ protected void assertDefaultValues(DynamicEntity simpleInstance) {
9090
@Override
9191
public DynamicEntity createSimpleInstance(Session session, int id) {
9292
DynamicType simpleEntityType = dynamicHelper.getType("Simple");
93-
Assert.assertNotNull(simpleEntityType);
93+
assertNotNull(simpleEntityType);
9494

9595
DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
9696
simpleInstance.set("id1", id);

foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeTestSuite.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2019 IBM Corporation. All rights reserved.
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -25,7 +26,6 @@
2526
//JUnit4 imports
2627
import org.junit.After;
2728
import org.junit.AfterClass;
28-
import org.junit.Assert;
2929
import org.junit.Before;
3030
import org.junit.BeforeClass;
3131
import org.junit.Test;
@@ -162,7 +162,7 @@ protected void assertDefaultValues(DynamicEntity simpleInstance) {
162162

163163
public DynamicEntity createSimpleInstance(Session session, int id) {
164164
DynamicType simpleEntityType = dynamicHelper.getType("Simple");
165-
Assert.assertNotNull(simpleEntityType);
165+
assertNotNull(simpleEntityType);
166166

167167
DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
168168
simpleInstance.set("id", id);

foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/SimpleTypeWithEnumTestSuite.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2019 Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2019 IBM Corporation. All rights reserved.
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -26,7 +27,6 @@
2627
//JUnit4 imports
2728
import org.junit.After;
2829
import org.junit.AfterClass;
29-
import org.junit.Assert;
3030
import org.junit.Before;
3131
import org.junit.BeforeClass;
3232
import org.junit.Test;
@@ -174,7 +174,7 @@ protected void assertDefaultValues(DynamicEntity simpleInstance) {
174174

175175
public DynamicEntity createSimpleInstance(Session session, int id) {
176176
DynamicType simpleEntityType = dynamicHelper.getType("Simple");
177-
Assert.assertNotNull(simpleEntityType);
177+
assertNotNull(simpleEntityType);
178178

179179
DynamicEntity simpleInstance = simpleEntityType.newDynamicEntity();
180180
simpleInstance.set("id", id);

foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_AggregateObject.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2019 IBM Corporation. All rights reserved.
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -38,7 +39,6 @@
3839
import org.eclipse.persistence.sessions.UnitOfWork;
3940
import org.junit.After;
4041
import org.junit.AfterClass;
41-
import org.junit.Assert;
4242
import org.junit.BeforeClass;
4343
import org.junit.Test;
4444

@@ -147,7 +147,7 @@ public void verifyConfig() throws Exception {
147147
@Test
148148
public void verifyProperties() {
149149
DynamicType simpleTypeA = dynamicHelper.getType("SimpleA");
150-
Assert.assertNotNull(simpleTypeA);
150+
assertNotNull(simpleTypeA);
151151

152152
assertEquals(4, simpleTypeA.getNumberOfProperties());
153153
assertEquals("id", simpleTypeA.getPropertiesNames().get(0));
@@ -159,7 +159,7 @@ public void verifyProperties() {
159159
@Test
160160
public void createSimpleA() {
161161
DynamicType simpleTypeA = dynamicHelper.getType("SimpleA");
162-
Assert.assertNotNull(simpleTypeA);
162+
assertNotNull(simpleTypeA);
163163

164164
DynamicEntity a = simpleTypeA.newDynamicEntity();
165165

@@ -179,7 +179,7 @@ public void createSimpleA() {
179179
@Test
180180
public void persistSimpleA() {
181181
DynamicType simpleTypeA = dynamicHelper.getType("SimpleA");
182-
Assert.assertNotNull(simpleTypeA);
182+
assertNotNull(simpleTypeA);
183183

184184
DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
185185
simpleInstance.set("id", 1);
@@ -193,15 +193,15 @@ public void persistSimpleA() {
193193
countQuery.addCount();
194194
countQuery.setShouldReturnSingleValue(true);
195195
int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
196-
Assert.assertEquals(1, simpleCount);
196+
assertEquals(1, simpleCount);
197197
}
198198

199199
@Test
200200
public void verifyChangTracking() {
201201
persistSimpleA();
202202

203203
DynamicType simpleTypeA = dynamicHelper.getType("SimpleA");
204-
Assert.assertNotNull(simpleTypeA);
204+
assertNotNull(simpleTypeA);
205205

206206
UnitOfWork uow = session.acquireUnitOfWork();
207207

@@ -227,11 +227,11 @@ public void verifyChangTracking() {
227227
@Test
228228
public void createSimpleAwithSimpleB() {
229229
DynamicType simpleTypeA = dynamicHelper.getType("SimpleA");
230-
Assert.assertNotNull(simpleTypeA);
230+
assertNotNull(simpleTypeA);
231231
DynamicType simpleTypeB = dynamicHelper.getType("SimpleB");
232-
Assert.assertNotNull(simpleTypeB);
232+
assertNotNull(simpleTypeB);
233233

234-
Assert.assertNotNull(session.getDescriptorForAlias("SimpleB"));
234+
assertNotNull(session.getDescriptorForAlias("SimpleB"));
235235

236236
DynamicEntity simpleInstanceB = simpleTypeB.newDynamicEntity();
237237
simpleInstanceB.set("value2", true);
@@ -251,7 +251,7 @@ public void createSimpleAwithSimpleB() {
251251
countQuery.setShouldReturnSingleValue(true);
252252

253253
int simpleCountA = ((Number) session.executeQuery(countQuery)).intValue();
254-
Assert.assertEquals(1, simpleCountA);
254+
assertEquals(1, simpleCountA);
255255
}
256256

257257
}

foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_ManyToMany.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2019 IBM Corporation. All rights reserved.
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -29,7 +30,6 @@
2930
import org.junit.BeforeClass;
3031
import org.junit.Ignore;
3132
import org.junit.Test;
32-
import org.junit.Assert;
3333
import static org.junit.Assert.assertEquals;
3434
import static org.junit.Assert.assertNotNull;
3535

@@ -141,7 +141,7 @@ public void createSimpleA() {
141141
countQuery.addCount();
142142
countQuery.setShouldReturnSingleValue(true);
143143
int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
144-
Assert.assertEquals(1, simpleCount);
144+
assertEquals(1, simpleCount);
145145
}
146146

147147
@Test
@@ -158,7 +158,7 @@ public void createSimpleB() {
158158
countQuery.addCount();
159159
countQuery.setShouldReturnSingleValue(true);
160160
int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
161-
Assert.assertEquals(1, simpleCount);
161+
assertEquals(1, simpleCount);
162162
}
163163

164164
@Test
@@ -181,13 +181,13 @@ public void createAwithB() {
181181
countQueryB.addCount();
182182
countQueryB.setShouldReturnSingleValue(true);
183183
int simpleCountB = ((Number) session.executeQuery(countQueryB)).intValue();
184-
Assert.assertEquals(1, simpleCountB);
184+
assertEquals(1, simpleCountB);
185185

186186
ReportQuery countQueryA = dynamicHelper.newReportQuery("SimpleA", new ExpressionBuilder());
187187
countQueryA.addCount();
188188
countQueryA.setShouldReturnSingleValue(true);
189189
int simpleCountA = ((Number) session.executeQuery(countQueryA)).intValue();
190-
Assert.assertEquals(1, simpleCountA);
190+
assertEquals(1, simpleCountA);
191191
}
192192

193193
@Ignore

foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/dynamic/simple/mappings/SimpleTypes_MultiTable.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
* Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2019 Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2019 IBM Corporation. All rights reserved.
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the Eclipse Public License v. 2.0 which is available at
@@ -36,7 +37,6 @@
3637
import org.eclipse.persistence.sessions.UnitOfWork;
3738
import org.junit.After;
3839
import org.junit.AfterClass;
39-
import org.junit.Assert;
4040
import org.junit.BeforeClass;
4141
import org.junit.Test;
4242

@@ -122,7 +122,7 @@ public void verifyConfig() throws Exception {
122122
@Test
123123
public void verifyProperties() {
124124
DynamicType simpleTypeA = dynamicHelper.getType("SimpleA");
125-
Assert.assertNotNull(simpleTypeA);
125+
assertNotNull(simpleTypeA);
126126

127127
assertEquals(6, simpleTypeA.getNumberOfProperties());
128128
assertTrue(simpleTypeA.getPropertiesNames().contains("id"));
@@ -143,23 +143,23 @@ public void verifyProperties() {
143143
@Test
144144
public void createSimpleA() {
145145
DynamicType simpleTypeA = dynamicHelper.getType("SimpleA");
146-
Assert.assertNotNull(simpleTypeA);
146+
assertNotNull(simpleTypeA);
147147

148148
DynamicEntity a = simpleTypeA.newDynamicEntity();
149149

150150
assertNotNull(a);
151151
assertEquals(((Number) a.get("id")).intValue(), 0);
152152
assertFalse(a.isSet("value1"));
153-
assertEquals(a.get("value2"), false);
153+
assertEquals(false, a.get("value2"));
154154
assertFalse(a.isSet("value3"));
155-
assertEquals(((Number) a.get("value4")).doubleValue(), 0.0, 0.01);
155+
assertEquals(0.0, ((Number) a.get("value4")).doubleValue(), 0.01);
156156
assertFalse(a.isSet("value5"));
157157
}
158158

159159
@Test
160160
public void persistSimpleA() {
161161
DynamicType simpleTypeA = dynamicHelper.getType("SimpleA");
162-
Assert.assertNotNull(simpleTypeA);
162+
assertNotNull(simpleTypeA);
163163

164164
DynamicEntity simpleInstance = simpleTypeA.newDynamicEntity();
165165
simpleInstance.set("id", 1);
@@ -173,7 +173,7 @@ public void persistSimpleA() {
173173
countQuery.addCount();
174174
countQuery.setShouldReturnSingleValue(true);
175175
int simpleCount = ((Number) session.executeQuery(countQuery)).intValue();
176-
Assert.assertEquals(1, simpleCount);
176+
assertEquals(1, simpleCount);
177177

178178
session.release();
179179
}
@@ -182,7 +182,7 @@ public void persistSimpleA() {
182182
public void verifyChangeTracking() {
183183
persistSimpleA();
184184
DynamicType simpleTypeA = dynamicHelper.getType("SimpleA");
185-
Assert.assertNotNull(simpleTypeA);
185+
assertNotNull(simpleTypeA);
186186

187187
UnitOfWork uow = session.acquireUnitOfWork();
188188

0 commit comments

Comments
 (0)