Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
/node_modules
/bower_components
/release.properties
/pom.xml.releaseBackup
/pom.xml.releaseBackup
*.iml
.idea
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
language: java

jdk:
- oraclejdk7
- openjdk6
- oraclejdk8
- oraclejdk9
- oraclejdk11
- openjdk8
- openjdk10
- openjdk11
12 changes: 8 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@
- If reporting a bug, please add a [simplified example](http://sscce.org/).

## Pull requests

- Create a new topic branch for every separate change you make.
- Create a test case if you are fixing a bug or implementing an important feature.
- Make sure the build runs successfully [(see below)](#development).

## Development

### Tools

We use the following tools for development:

- [Maven](https://maven.apache.org/) for Java Build.
- [NodeJS](http://nodejs.org/download/) required to run grunt.
- [Grunt](http://gruntjs.com/getting-started) for JavaScript task management.
- [NodeJS](https://nodejs.org/en/download/) used for NPM (installed by Maven automatically).
- [NPM](https://www.npmjs.com) used to install Bower (installed by Maven automatically).
- [Bower](https://bower.io) used to get [js-cookie](https://github.com/js-cookie/js-cookie/) for Integration tests (installed by NPM automatically).


### Getting started

Install [NodeJS](http://nodejs.org/).
Install [Maven](https://maven.apache.org/download.cgi) and add `mvn` as a global alias to run the `/bin/mvn` command inside Maven folder.

Browse to the project root directory and run the build:
Expand All @@ -33,6 +36,7 @@ After the build completes, you should see the following message in the console:
----------------------------------------------------------------------------

### Unit tests

To run the unit tests, execute the following command:

$ mvn test
Expand All @@ -41,7 +45,7 @@ To run the unit tests, execute the following command:

If you want to debug the integration tests in the browser, switch `Debug.FALSE` to `Debug.TRUE` in `CookiesEncodingIT.java` and run the build:

$ mvn install
$ mvn verify

[Arquillian](http://arquillian.org/) will start the server, [Selenium](http://www.seleniumhq.org/) will run the tests in Firefox, but the build will hang to allow debugging in the browser.

Expand Down
18 changes: 0 additions & 18 deletions Gruntfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A simple Java API for handling cookies

* Supports Java 6+, Servlet 2.2+
* Supports Java 8+, Servlet 2.2+
* [Unobtrusive](#json-data-binding) JSON Data Binding support
* [RFC 6265](http://www.rfc-editor.org/rfc/rfc6265.txt) compliant
* Enable [custom decoding](#converter)
Expand Down
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "java-cookie",
"version": "1.0.0",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/js-cookie/java-cookie.git"
},
"devDependencies": {
"bower": "1.4.1",
"grunt": "0.4.5",
"grunt-bower-postinst": "0.2.1",
"grunt-cli": "0.1.13"
"bower": "1.8.8"
},
"scripts": {
"test": "cd bower_components/js-cookie && ../../node/node \"../../node/node_modules/npm/bin/npm-cli.js\" install"
}
}
89 changes: 53 additions & 36 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.js-cookie</groupId>
<artifactId>java-cookie</artifactId>
Expand All @@ -9,7 +10,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<selenium.version>2.45.0</selenium.version>
<selenium.version>3.141.59</selenium.version>
<wildfly.version>15.0.1.Final</wildfly.version>
<project.scm.id>java-cookie-scm</project.scm.id>
</properties>
<licenses>
Expand All @@ -35,8 +37,8 @@
</scm>
<repositories>
<repository>
<id>RedHat</id>
<url>https://maven.repository.redhat.com/earlyaccess/all</url>
<id>RedHat GA</id>
<url>https://maven.repository.redhat.com/ga/</url>
</repository>
</repositories>
<build>
Expand Down Expand Up @@ -64,13 +66,13 @@
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.8.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.4.1.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
Expand All @@ -83,12 +85,12 @@
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.7</version>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.11.1</version>
<version>2.9.8</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand All @@ -115,33 +117,45 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
<version>7.2.0.Final</version>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<version>1.4.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.4.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>2.1.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-bom</artifactId>
<version>2.2.0-beta-2</version>
<type>pom</type>
<scope>import</scope>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>3.1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-spi</artifactId>
<version>3.1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.3</version>
<version>4.5.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>4.3.3</version>
<version>4.5.7</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -165,9 +179,9 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<version>7.5.0.Final-redhat-15</version>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>${wildfly.version}</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>target</outputDirectory>
Expand All @@ -193,22 +207,22 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.23</version>
<version>1.5</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v0.10.18</nodeVersion>
<npmVersion>1.3.8</npmVersion>
<nodeVersion>v11.10.0</nodeVersion>
<npmVersion>6.8.0</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
<goal>npm</goal>
</goals>
</execution>
<execution>
Expand All @@ -218,10 +232,13 @@
</goals>
</execution>
<execution>
<id>grunt build</id>
<id>npm test</id>
<goals>
<goal>grunt</goal>
<goal>npm</goal>
</goals>
<configuration>
<arguments>test</arguments>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -245,7 +262,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -258,7 +275,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -271,7 +288,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.5</version>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down Expand Up @@ -300,4 +317,4 @@
<id>simple</id>
</profile>
</profiles>
</project>
</project>
8 changes: 4 additions & 4 deletions src/test/resources/arquillian.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="jbossas-managed" default="true">
<container qualifier="wildfly-managed" default="true">
<configuration>
<property name="jbossHome">target/jboss-eap-6.4</property>
<property name="jbossHome">target/wildfly-15.0.1.Final</property>
<property name="javaVmArguments">-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n</property>
</configuration>
</container>
Expand Down
11 changes: 2 additions & 9 deletions src/test/resources/web.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>encoding</servlet-name>
Expand All @@ -9,12 +10,4 @@
<servlet-name>encoding</servlet-name>
<url-pattern>/encoding</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>multiple-set-cookie</servlet-name>
<servlet-class>com.github.jscookie.javacookie.test.integration.write.MultipleSetCookieServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>multiple-set-cookie</servlet-name>
<url-pattern>/multiple-set-cookie</url-pattern>
</servlet-mapping>
</web-app>