Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work/xthiba/changes #32

Merged
merged 11 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ org.eclipse.jdt.apt.core.prefs
org.eclipse.m2e.core.prefs
org.eclipse.pde.core.prefs

.idea

wiquery-*.i*
rebel.xml
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# WiQuery for Apache Wicket 8.x
# WiQuery for Apache Wicket

WiQuery is a project to simply Wicket integration with jQuery and jQuery UI.

This branch follows the development of Apache Wicket 8.x (the master branch of Apache Wicket)
This branch follows the development of Apache Wicket

WiQuery consists of 3 subprojects:
- core - the core library
Expand Down
29 changes: 18 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<groupId>org.wicketstuff.wiquery</groupId>
<artifactId>wiquery-parent</artifactId>
<packaging>pom</packaging>
<version>9.0.0-SNAPSHOT</version>
<version>9.1.0-SNAPSHOT</version>
<name>WiQuery Parent</name>

<licenses>
Expand Down Expand Up @@ -61,11 +61,12 @@
<maven.compiler.source>11</maven.compiler.source>

<wicket.version>9.16.0</wicket.version>
<jackson.version>2.12.7.1</jackson.version>
<jackson.version>2.16.1</jackson.version>
<slf4j.version>2.0.12</slf4j.version>
<junit.version>5.10.2</junit.version>
<servlet-api.version>4.0.1</servlet-api.version>
<jetty.version>9.4.44.v20210927</jetty.version>
<servlet-api.version>4.0.4</servlet-api.version>
<jetty.version>9.4.54.v20240208</jetty.version>
<rhino.version>1.7.14</rhino.version>
</properties>

<modules>
Expand Down Expand Up @@ -105,12 +106,6 @@
</dependency>

<!-- External dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand All @@ -121,8 +116,19 @@
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<version>${rhino.version}</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet-api.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand All @@ -146,8 +152,9 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
11 changes: 7 additions & 4 deletions wiquery-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.wicketstuff.wiquery</groupId>
<artifactId>wiquery-parent</artifactId>
<version>9.0.0-SNAPSHOT</version>
<version>9.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>wiquery-core</artifactId>
Expand All @@ -25,23 +25,26 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
9 changes: 5 additions & 4 deletions wiquery-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<parent>
<artifactId>wiquery-parent</artifactId>
<groupId>org.wicketstuff.wiquery</groupId>
<version>9.0.0-SNAPSHOT</version>
<version>9.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>wiquery-demo</artifactId>
Expand Down Expand Up @@ -38,7 +39,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<artifactId>slf4j-reload4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -48,8 +49,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected void onSubmit(AjaxRequestTarget target)
withDropDownDatePicker.setChangeMonth(true);
withDropDownDatePicker.setChangeYear(true);
withDropDownDatePicker
.setYearRange(new DatePickerYearRange(new Short("-20"), new Short("20"), true));
.setYearRange(new DatePickerYearRange(Short.parseShort("-20"), Short.parseShort("20"), true));

// Label
withDropDownDatePicker.setLabel(Model.of("Year/month dropdown"));
Expand Down
23 changes: 9 additions & 14 deletions wiquery-jquery-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.wicketstuff.wiquery</groupId>
<artifactId>wiquery-parent</artifactId>
<version>9.0.0-SNAPSHOT</version>
<version>9.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>wiquery-jquery-ui</artifactId>
Expand All @@ -25,6 +25,11 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -40,21 +45,11 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
<artifactId>slf4j-reload4j</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>test</scope>
</dependency>

<!-- New Dependencies -->
<dependency>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>rhino</artifactId>
<version>1.7R5-20130223-1</version>
<scope>test</scope>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public DatePickerYearRange getYearRange()
return (DatePickerYearRange)yearRange;
}

return new DatePickerYearRange(new Short("-10"), new Short("10"), false);
return new DatePickerYearRange(Short.parseShort("-10"), Short.parseShort("10"), false);
}

/**
Expand Down Expand Up @@ -698,7 +698,7 @@ public DatePickerNumberOfMonths getNumberOfMonths()
return (DatePickerNumberOfMonths)numberOfMonths;
}

return new DatePickerNumberOfMonths(new Short("1"));
return new DatePickerNumberOfMonths(Short.parseShort("1"));
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
package org.wicketstuff.wiquery.ui.datepicker;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.GregorianCalendar;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wicketstuff.wiquery.tester.WiQueryTestCase;

import static org.junit.Assert.*;

public class DateOptionTestCase extends WiQueryTestCase
{
protected static final Logger log = LoggerFactory.getLogger(DateOptionTestCase.class);

@Test
public void testGetJavaScriptOption()
{
DateOption dateOption = new DateOption(new Short("5"));
DateOption dateOption = new DateOption(Short.parseShort("5"));

// Short param
String expectedJavascript = "5";
Expand Down Expand Up @@ -60,7 +59,7 @@ public void testGetJavaScriptOption()
try
{
generatedJavascript = dateOption.getJavascriptOption().toString();
assertTrue(false);
fail();
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class DatePickerDurationTestCase extends WiQueryTestCase
@Test
public void testGetJavaScriptOption()
{
DatePickerShortYearCutOff shortYearCutOff = new DatePickerShortYearCutOff(new Short("5"));
DatePickerShortYearCutOff shortYearCutOff = new DatePickerShortYearCutOff(Short.parseShort("5"));

// Short param
String expectedJavascript = "5";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,24 @@ public class DatePickerLanguageResourceReferenceTestCase extends WiQueryTestCase
.getLogger(DatePickerLanguageResourceReferenceTestCase.class);

@Test
public void testGetDatePickerLanguages()
public void testGetDatePickerLanguagesUnavailable()
{
Locale nonavailableLocale = new Locale("wiquery");
Locale availableLocale = DatePickerLanguages.ARMENIAN.getLocale();

assertNull(DatePickerLanguages.getDatePickerLanguages(nonavailableLocale));
assertNull(DatePickerLanguageResourceReference.get(nonavailableLocale));
}

@Test
public void testGetDatePickerLanguagesAvailable() {
Locale availableLocale = DatePickerLanguages.ARMENIAN.getLocale();

assertNotNull(DatePickerLanguages.getDatePickerLanguages(availableLocale));
assertNotNull(DatePickerLanguageResourceReference.get(availableLocale));
}

@Test
public void testGetDatePickerLanguages() {
for (DatePickerLanguages language : DatePickerLanguages.values())
{
// assert if the language getter is implemented correctly to return
Expand Down Expand Up @@ -70,28 +77,29 @@ public void testGetJsFileName()
{
assertNull(DatePickerLanguages.getJsFileName(null));

assertEquals(DatePickerLanguages.getJsFileName(DatePickerLanguages.FRENCH).toString(),
assertEquals(DatePickerLanguages.getJsFileName(DatePickerLanguages.FRENCH),
"i18n/datepicker-fr.js");

assertEquals(DatePickerLanguages.getJsFileName(DatePickerLanguages.SERBIA).toString(),
assertEquals(DatePickerLanguages.getJsFileName(DatePickerLanguages.SERBIA),
"i18n/datepicker-sr-SR.js");
}

@Test
public void testRenamedLocales() {
assertEquals(DatePickerLanguages.INDONESIAN,
DatePickerLanguages.getDatePickerLanguages(new Locale("id")));
public void testRenamedLocales()
{
assertEquals(DatePickerLanguages.INDONESIAN,
DatePickerLanguages.getDatePickerLanguages(new Locale("in")));
assertEquals(DatePickerLanguages.getJsFileName(DatePickerLanguages.INDONESIAN).toString(),
"i18n/datepicker-in.js");
assertEquals(DatePickerLanguages.INDONESIAN,
DatePickerLanguages.getDatePickerLanguages(new Locale("id")));
assertEquals(DatePickerLanguages.getJsFileName(DatePickerLanguages.INDONESIAN),
"i18n/datepicker-id.js");

assertEquals(DatePickerLanguages.HEBREW,
DatePickerLanguages.getDatePickerLanguages(new Locale("he")));
assertEquals(DatePickerLanguages.HEBREW,
DatePickerLanguages.getDatePickerLanguages(new Locale("iw")));
assertEquals(DatePickerLanguages.getJsFileName(DatePickerLanguages.HEBREW).toString(),
"i18n/datepicker-iw.js");
assertEquals(DatePickerLanguages.getJsFileName(DatePickerLanguages.HEBREW),
"i18n/datepicker-he.js");

// Yiddish does not (yet) have i18n
assertNull(DatePickerLanguages.getDatePickerLanguages(new Locale("ji")));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package org.wicketstuff.wiquery.ui.datepicker;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wicketstuff.wiquery.tester.WiQueryTestCase;

import static org.junit.Assert.*;

public class DatePickerNumberOfMonthsTestCase extends WiQueryTestCase
{
protected static final Logger log = LoggerFactory
Expand All @@ -16,7 +15,7 @@ public class DatePickerNumberOfMonthsTestCase extends WiQueryTestCase
@Test
public void testGetJavaScriptOption()
{
DatePickerDuration duration = new DatePickerDuration(new Short("5"));
DatePickerDuration duration = new DatePickerDuration(Short.parseShort("5"));

// Short param
String expectedJavascript = "5";
Expand All @@ -40,7 +39,7 @@ public void testGetJavaScriptOption()
try
{
generatedJavascript = duration.getJavascriptOption().toString();
assertTrue(false);
fail();
}
catch (Exception e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class DatePickerShortYearCutOffTestCase extends WiQueryTestCase
@Test
public void testGetJavaScriptOption()
{
DatePickerNumberOfMonths numberOfMonths = new DatePickerNumberOfMonths(new Short("5"));
DatePickerNumberOfMonths numberOfMonths = new DatePickerNumberOfMonths(Short.parseShort("5"));

// Short param
String expectedJavascript = "5";
Expand Down
Loading
Loading