Skip to content

Commit

Permalink
Merge pull request #135 from mbien/dependency-updates-4
Browse files Browse the repository at this point in the history
Dependency updates and some compiler warning cleanup in tests
  • Loading branch information
mbien authored Feb 4, 2024
2 parents af8df0a + 8035ca9 commit 944e1f1
Show file tree
Hide file tree
Showing 27 changed files with 96 additions and 103 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:

steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'

- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false
submodules: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
Expand All @@ -59,7 +59,7 @@ jobs:
- name: Run Integration Tests
run: |
cd it-selenium
mvn -V -ntp -Dwebdriver.gecko.driver=$GECKOWEBDRIVER/geckodriver install
mvn -V -ntp install
- name: Publish JUnit Report
uses: test-summary/action@v2
Expand All @@ -76,7 +76,7 @@ jobs:
# only on integration and only once in this matrix
- name: Upload Dev Build on Integration
if: ${{ (matrix.java == '11') && (github.event_name == 'push') }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dev-build
path: ./app/target/roller.war
Expand Down
45 changes: 27 additions & 18 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,26 @@ limitations under the License.
<java-activation.version>1.2.0</java-activation.version>
<jstl.version>1.2</jstl.version>
<angular.version>1.7.8</angular.version>
<ant.version>1.10.13</ant.version>
<asm.version>9.5</asm.version>
<ant.version>1.10.14</ant.version>
<asm.version>9.6</asm.version>
<bouncycastle.version>1.70</bouncycastle.version>
<commons-validator.version>1.7</commons-validator.version>
<commons-validator.version>1.8.0</commons-validator.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<commons-codec.version>1.15</commons-codec.version>
<commons-codec.version>1.16.0</commons-codec.version>
<commons-text.version>1.11.0</commons-text.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<eclipse-link.version>4.0.2</eclipse-link.version>
<guice.version>6.0.0</guice.version>
<log4j2.version>2.20.0</log4j2.version>
<lucene.version>9.6.0</lucene.version>
<guice.version>7.0.0</guice.version>
<log4j2.version>2.22.1</log4j2.version>
<lucene.version>9.9.1</lucene.version>
<oauth-core.version>20100527</oauth-core.version>
<maven-war.version>3.3.2</maven-war.version>
<maven-surefire.version>2.22.2</maven-surefire.version>
<maven-war.version>3.4.0</maven-war.version>
<maven-surefire.version>3.2.5</maven-surefire.version>
<maven-antrun.version>1.0b3</maven-antrun.version>
<rome.version>1.19.0</rome.version> <!-- locked in place since next version removes popono -->
<spring.version>5.3.27</spring.version>
<spring.security.version>5.8.3</spring.security.version>
<slf4j.version>2.0.11</slf4j.version>
<spring.version>5.3.31</spring.version>
<spring.security.version>5.8.8</spring.security.version>
<struts.version>2.5.29</struts.version>
<velocity.version>2.3</velocity.version>
<webjars.version>1.6</webjars.version>
Expand Down Expand Up @@ -264,7 +267,7 @@ limitations under the License.
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.6.4</version>
<version>3.7.1</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -363,9 +366,15 @@ limitations under the License.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
<version>${commons-text.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>

<dependency>
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-common</artifactId>
Expand Down Expand Up @@ -497,7 +506,7 @@ limitations under the License.
<dependency>
<groupId>com.jgeppert.struts2.bootstrap</groupId>
<artifactId>struts2-bootstrap-plugin</artifactId>
<version>4.0.1</version>
<version>4.0.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -572,14 +581,14 @@ limitations under the License.
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<version>5.9.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.instancio</groupId>
<artifactId>instancio-junit</artifactId>
<version>2.16.0</version>
<version>4.0.0</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -728,7 +737,7 @@ limitations under the License.

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<dependencies>
<dependency>
<groupId>ant-contrib</groupId>
Expand Down Expand Up @@ -786,7 +795,7 @@ limitations under the License.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<executions>
<execution>
<phase>validate</phase>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/webapp/WEB-INF/jsps/tiles/head.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ You can override it with your own file via WEB-INF/tiles-def.xml

<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>

<script src="<s:url value='/webjars/jquery/3.6.4/jquery.min.js' />"></script>
<script src="<s:url value='/webjars/jquery/3.7.1/jquery.min.js' />"></script>

<script src="<s:url value='/webjars/jquery-ui/1.13.2/jquery-ui.min.js' />"></script>
<link href="<s:url value='/webjars/jquery-ui/1.13.2/jquery-ui.css' />" rel="stylesheet" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testGroupLookups() throws Exception {

// lookup all groups in planet
Planet planet = mgr.getWebloggerById(testPlanet.getId());
Set groups = planet.getGroups();
Set<PlanetGroup> groups = planet.getGroups();
assertNotNull(groups);
assertEquals(2, groups.size());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testPlanetLookups() throws Exception {
assertEquals("planetFuncTest", planet.getHandle());

// all planets (should be 2, the default and the one we created)
List planets = mgr.getWebloggers();
List<Planet> planets = mgr.getWebloggers();
assertNotNull(planets);
assertEquals(2, planets.size());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void _testBookmarkLookups() throws Exception {

// test lookup of all bookmarks in single folder
WeblogBookmarkFolder testFolder = bmgr.getFolder(f1.getId());
List allBookmarks = bmgr.getBookmarks(testFolder);
List<WeblogBookmark> allBookmarks = bmgr.getBookmarks(testFolder);
assertNotNull(allBookmarks);
assertEquals(2, allBookmarks.size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void testCommentCRUD() throws Exception {
public void testCommentLookups() throws Exception {

WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
List comments;
List<WeblogEntryComment> comments;

// we need some comments to play with
testEntry = TestUtils.getManagedWeblogEntry(testEntry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void testLookupAllFoldersByWeblog() throws Exception {

// get all folders, including root
testWeblog = TestUtils.getManagedWebsite(testWeblog);
List allFolders = bmgr.getAllFolders(testWeblog);
List<WeblogBookmarkFolder> allFolders = bmgr.getAllFolders(testWeblog);
assertNotNull(allFolders);
assertEquals(5, allFolders.size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ public void testHotWeblogs() throws Exception {
assertEquals(30, testCount.getDailyHits());

// get hot weblogs
List hotBlogs = mgr.getHotWeblogs(1, 0, 5);
List<WeblogHitCount> hotBlogs = mgr.getHotWeblogs(1, 0, 5);
assertNotNull(hotBlogs);
assertEquals(3, hotBlogs.size());

// also check ordering and values
WeblogHitCount hitCount;
Iterator it = hotBlogs.iterator();
Iterator<WeblogHitCount> it = hotBlogs.iterator();
for (int i=3; it.hasNext(); i--) {
hitCount = (WeblogHitCount) it.next();
hitCount = it.next();
assertEquals(i*10, hitCount.getDailyHits());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,13 @@ public void testSearchMediaFile() throws Exception {
assertFalse(searchResults.isEmpty());
assertEquals(id2, (searchResults.get(0)).getId());
assertNotNull((searchResults.get(0)).getDirectory());
assertEquals("default", (searchResults.get(0)).getDirectory()
.getName());
assertEquals("default", searchResults.get(0).getDirectory().getName());

MediaFileFilter filter3 = new MediaFileFilter();
filter3.setName("test_work.jpg");
searchResults = mfMgr.searchMediaFiles(testWeblog, filter3);
assertFalse(searchResults.isEmpty());
assertEquals(id1, ((MediaFile) searchResults.get(0)).getId());
assertEquals(id1, searchResults.get(0).getId());

// search by tag

Expand All @@ -540,8 +539,7 @@ public void testSearchMediaFile() throws Exception {
searchResults = mfMgr.searchMediaFiles(testWeblog, filter4);
assertFalse(searchResults.isEmpty());
assertEquals(1, searchResults.size());
assertEquals("test_work.jpg",
((MediaFile) searchResults.get(0)).getName());
assertEquals("test_work.jpg", searchResults.get(0).getName());

// search by size

Expand All @@ -551,26 +549,23 @@ public void testSearchMediaFile() throws Exception {
searchResults = mfMgr.searchMediaFiles(testWeblog, filter6);
assertFalse(searchResults.isEmpty());
assertEquals(1, searchResults.size());
assertEquals("test_work.jpg",
((MediaFile) searchResults.get(0)).getName());
assertEquals("test_work.jpg", searchResults.get(0).getName());

MediaFileFilter filter7 = new MediaFileFilter();
filter7.setSize(3000);
filter7.setSizeFilterType(MediaFileFilter.SizeFilterType.EQ);
searchResults = mfMgr.searchMediaFiles(testWeblog, filter7);
assertFalse(searchResults.isEmpty());
assertEquals(1, searchResults.size());
assertEquals("test_home.jpg",
((MediaFile) searchResults.get(0)).getName());
assertEquals("test_home.jpg", searchResults.get(0).getName());

MediaFileFilter filter8 = new MediaFileFilter();
filter8.setSize(3000);
filter8.setSizeFilterType(MediaFileFilter.SizeFilterType.GT);
searchResults = mfMgr.searchMediaFiles(testWeblog, filter8);
assertFalse(searchResults.isEmpty());
assertEquals(1, searchResults.size());
assertEquals("test_pers.jpg",
((MediaFile) searchResults.get(0)).getName());
assertEquals("test_pers.jpg", searchResults.get(0).getName());

MediaFileFilter filter9 = new MediaFileFilter();
filter9.setSize(3000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void testPermissionsCRUD() throws Exception {
assertNull(perm);

// create permissions
List<String> actions = new ArrayList<String>();
List<String> actions = new ArrayList<>();
actions.add(WeblogPermission.ADMIN);
actions.add(WeblogPermission.POST);
mgr.grantWeblogPermission(testWeblog, testUser, actions);
Expand Down Expand Up @@ -189,7 +189,7 @@ public void testPermissionsLookups() throws Exception {
perms = mgr.getWeblogPermissions(TestUtils.getManagedWebsite(testWeblog));
assertEquals(1, perms.size());

List<String> actions = new ArrayList<String>();
List<String> actions = new ArrayList<>();
actions.add(WeblogPermission.POST);
mgr.grantWeblogPermissionPending(testWeblog, user, actions);
TestUtils.endSession(true);
Expand Down Expand Up @@ -244,11 +244,9 @@ public void testInvitations() throws Exception {

WeblogManager wmgr = WebloggerFactory.getWeblogger().getWeblogManager();
UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
WeblogPermission perm = null;
List perms = null;

// invite user to weblog
List<String> actions = new ArrayList<String>();
List<String> actions = new ArrayList<>();
actions.add(WeblogPermission.EDIT_DRAFT);
umgr.grantWeblogPermissionPending(testWeblog, user, actions);
TestUtils.endSession(true);
Expand All @@ -269,12 +267,12 @@ public void testInvitations() throws Exception {

// assert that user is member of weblog
assertNotNull(umgr.getWeblogPermission(testWeblog, user));
List weblogs = wmgr.getUserWeblogs(TestUtils.getManagedUser(user), true);
List<Weblog> weblogs = wmgr.getUserWeblogs(TestUtils.getManagedUser(user), true);
assertEquals(1, weblogs.size());
assertEquals(testWeblog.getId(), ((Weblog)weblogs.get(0)).getId());
assertEquals(testWeblog.getId(), weblogs.get(0).getId());

// assert that website has user
List users = wmgr.getWeblogUsers(testWeblog, true);
List<User> users = wmgr.getWeblogUsers(testWeblog, true);
assertEquals(2, users.size());

// test user can be retired from website
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void testPingTargetLookups() throws Exception {
assertEquals(testCommonPing.getName(), ping.getName());

// lookup all common pings
List commonPings = mgr.getCommonPingTargets();
List<PingTarget> commonPings = mgr.getCommonPingTargets();
assertNotNull(commonPings);
// correct answer is: 4 pings in config + 1 new one = 5
assertEquals(5, commonPings.size());
Expand Down Expand Up @@ -331,7 +331,7 @@ public void testAutoPingLookups() throws Exception {

// lookup by ping target
pingTarget = ptmgr.getPingTarget(pingTarget.getId());
List autoPings = mgr.getAutoPingsByTarget(pingTarget);
List<AutoPing> autoPings = mgr.getAutoPingsByTarget(pingTarget);
assertNotNull(autoPings);
assertEquals(1, autoPings.size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.roller.planet.pojos.Planet;
import org.apache.roller.planet.pojos.PlanetGroup;
import org.apache.roller.planet.pojos.Subscription;
import org.apache.roller.planet.pojos.SubscriptionEntry;
import org.apache.roller.weblogger.TestUtils;
import org.apache.roller.weblogger.planet.tasks.RefreshRollerPlanetTask;
import org.apache.roller.weblogger.planet.tasks.SyncWebsitesTask;
Expand Down Expand Up @@ -155,7 +156,7 @@ public void testRefreshEntries() {

planetObject = planet.getWeblogger("default");
group = planet.getGroup(planetObject, "all");
List agg = planet.getEntries(group, 0, -1);
List<SubscriptionEntry> agg = planet.getEntries(group, 0, -1);
assertEquals(3, agg.size());
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,17 @@ public void testUserLookups() throws Exception {

// lookup by UserName (part)
user = null;
List users1 = mgr.getUsersStartingWith(testUser.getUserName().substring(0, 3), Boolean.TRUE, 0, 1);
List<User> users1 = mgr.getUsersStartingWith(testUser.getUserName().substring(0, 3), Boolean.TRUE, 0, 1);
assertEquals(1, users1.size());
user = (User) users1.get(0);
user = users1.get(0);
assertNotNull(user);
assertEquals(testUser.getUserName(), user.getUserName());

// lookup by Email (part)
user = null;
List users2 = mgr.getUsersStartingWith(testUser.getEmailAddress().substring(0, 3), Boolean.TRUE, 0, 1);
List<User> users2 = mgr.getUsersStartingWith(testUser.getEmailAddress().substring(0, 3), Boolean.TRUE, 0, 1);
assertEquals(1, users2.size());
user = (User) users2.get(0);
user = users2.get(0);
assertNotNull(user);
assertEquals(testUser.getUserName(), user.getUserName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void testLookupAllCategoriesByWeblog() throws Exception {
WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();

testWeblog = TestUtils.getManagedWebsite(testWeblog);
List cats = mgr.getWeblogCategories(testWeblog);
List<WeblogCategory> cats = mgr.getWeblogCategories(testWeblog);
assertNotNull(cats);
assertEquals(5, cats.size());

Expand Down
Loading

0 comments on commit 944e1f1

Please sign in to comment.