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
Show all changes
63 commits
Select commit Hold shift + click to select a range
45d567d
Initial code
FagnerMartinsBrack Apr 26, 2015
cb45ad5
Review the code and add converters
FagnerMartinsBrack Apr 26, 2015
447d37e
Retrieve all cookies
FagnerMartinsBrack Apr 26, 2015
5b829e0
Implement parsing an Integer type in the cookie value
FagnerMartinsBrack Apr 28, 2015
3f4343c
parse boolean value
FagnerMartinsBrack Apr 29, 2015
4b6b84b
Do not extend the Cookies class unless there's an use case to do so
FagnerMartinsBrack Apr 29, 2015
6e715c9
This exception should only be used inside a converter when there's error
FagnerMartinsBrack Apr 29, 2015
af54e06
Use jackson data binding to parse JSON strings
FagnerMartinsBrack Apr 30, 2015
30e5201
Create several tests for properties in custom types
FagnerMartinsBrack Apr 30, 2015
6599275
Create a method to workaround Java Type Erasure
FagnerMartinsBrack Apr 30, 2015
93083b9
There's no need for this feature
FagnerMartinsBrack Apr 30, 2015
d3b7552
Create tests for JSON writing and implement int value
FagnerMartinsBrack May 1, 2015
9f7473f
Make the docs appear in eclipse. Need to have content not just the "see"
FagnerMartinsBrack May 1, 2015
e9ea285
Implement boolean writing
FagnerMartinsBrack May 1, 2015
3c883a7
Implement JSONArray write. Use Jackson for all other types.
FagnerMartinsBrack May 1, 2015
b9d9645
This is just for internal purposes
FagnerMartinsBrack May 1, 2015
10948a0
Serialize a custom type to JSON
FagnerMartinsBrack May 1, 2015
c6cfd7a
Fix test expectation
FagnerMartinsBrack May 1, 2015
0717129
Use the null object pattern and prevent using the default constructor
FagnerMartinsBrack May 1, 2015
ab6c7a8
Rename the test packages to test only the public APIs
FagnerMartinsBrack May 2, 2015
539c875
Let's synchronize only the main get/set methods
FagnerMartinsBrack May 2, 2015
24d5f86
Add arquillian with jboss EAP 6.4 managed container with servlet API
FagnerMartinsBrack May 3, 2015
1e46ca8
Integrate selenium with qunit
FagnerMartinsBrack May 3, 2015
e639cbc
Add the .project file for eclipse
FagnerMartinsBrack May 23, 2015
40b4881
Add frontend-maven-plugin to run bower inside maven lifecycle
FagnerMartinsBrack May 24, 2015
fd83e19
Need to ignore bower_components
FagnerMartinsBrack May 24, 2015
c03b77e
Create a temporary reference to the js-cookie topic branch
FagnerMartinsBrack May 24, 2015
cf64594
Add files to run the front-end build
FagnerMartinsBrack May 24, 2015
a53a9ce
Proper hanging if debug is set to true
FagnerMartinsBrack May 24, 2015
b761d18
These files were just for testing, not needed anymore
FagnerMartinsBrack May 24, 2015
33be27a
The default path attribute should be to the whole site
FagnerMartinsBrack May 25, 2015
9d94caf
Do not spam the tests results when debugging
FagnerMartinsBrack May 25, 2015
df4978c
Add remaining classes to arquillian
FagnerMartinsBrack May 25, 2015
b50b89a
Complement last commit with the dependencies
FagnerMartinsBrack May 25, 2015
1bfb211
Provide a proper return for each request
FagnerMartinsBrack May 25, 2015
35a6f83
Make it clear when a cookie is not found
FagnerMartinsBrack May 25, 2015
36073af
Encode/decode without using URLEncoder/URLDecoder
FagnerMartinsBrack May 30, 2015
88c540e
Should not encode characters allowed in both name and value
FagnerMartinsBrack May 30, 2015
c53640e
Align the conditons
FagnerMartinsBrack May 30, 2015
2d6b56e
Correctly decode characters with more than 1 byte using UTF-8
FagnerMartinsBrack May 31, 2015
90bdec5
Adjust encoding for characters greater than 1 byte
FagnerMartinsBrack May 31, 2015
94e6f8e
There's no need to put the Attributes definition inside the interface
FagnerMartinsBrack Jun 1, 2015
f6c1595
Separate the strategy internal interface from the Cookies definition
FagnerMartinsBrack Jun 1, 2015
513e6eb
Make it possible to create custom converters without the inline syntax
FagnerMartinsBrack Jun 1, 2015
0ae0adc
Try to use primitives as much as possible to prevent NPE
FagnerMartinsBrack Jun 1, 2015
38c4902
Let's not add an unnecessary dependency
FagnerMartinsBrack Jun 1, 2015
e82676f
Use a static factory method to instantiate from servlet
FagnerMartinsBrack Jun 1, 2015
06006dc
Make it possible to change each specific defaults
FagnerMartinsBrack Jun 4, 2015
5226f63
This is ignored by bower
FagnerMartinsBrack Jun 4, 2015
2bef80f
If the path attribute is removed, use the whole site.
FagnerMartinsBrack Jun 4, 2015
7b6a4dc
If sending an empty string to the path make it a session cookie
FagnerMartinsBrack Jun 4, 2015
a3b5dac
This dependency does not exist anymore
FagnerMartinsBrack Jun 5, 2015
c157e41
Read the cookies from the header to workaround some problems
FagnerMartinsBrack Jun 6, 2015
bcd45b1
Using encode/decode naming makes it more understandable
FagnerMartinsBrack Jun 6, 2015
02beea3
Some characters in the cookie-value don't need to be encoded
FagnerMartinsBrack Jun 6, 2015
7cbdf97
Use .addHeader to fix quoted values being sent using response.addCookie
FagnerMartinsBrack Jun 7, 2015
cc9d15e
Implement expires format
FagnerMartinsBrack Jun 7, 2015
f0939c8
Test character with 3 bytes in name
FagnerMartinsBrack Jun 7, 2015
30494c6
Iterate over code points to be able to encode 4 byte characters
FagnerMartinsBrack Jun 7, 2015
0f8a8f4
Test characters with 4 bytes mixed with single bytes
FagnerMartinsBrack Jun 7, 2015
a5c455d
Fix the retrieval of UTF-8 characters from the server
FagnerMartinsBrack Jun 7, 2015
4d22947
Fix build with Debug.FALSE
FagnerMartinsBrack Jun 7, 2015
3ebdc76
Add httpOnly attribute
FagnerMartinsBrack Jun 7, 2015
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
20 changes: 13 additions & 7 deletions Java Cookie/.classpath → .classpath
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="owner.project.facets" value="jboss.m2"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<classpathentry kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="owner.project.facets" value="jboss.m2"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target
/node
/node_modules
/bower_components
29 changes: 29 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Java Cookie</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
18 changes: 18 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = function (grunt) {

grunt.initConfig({
bower_postinst: {
all: {
options: {
components: {
'js-cookie': ['npm', 'grunt']
}
}
}
}
});

grunt.loadNpmTasks('grunt-bower-postinst');

grunt.registerTask('default', ['bower_postinst']);
};
1 change: 0 additions & 1 deletion Java Cookie/.gitignore

This file was deleted.

57 changes: 0 additions & 57 deletions Java Cookie/pom.xml

This file was deleted.

6 changes: 6 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "java-cookie",
"devDependencies": {
"js-cookie": "master"
}
}
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "java-cookie",
"version": "1.0.0",
"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"
}
}
209 changes: 209 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
<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>org.jscookie</groupId>
<artifactId>java-cookie</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Java Cookie</name>
<description>A simple Servlet API for handling cookies</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<selenium.version>2.45.0</selenium.version>
</properties>
<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/js-cookie/java-cookie</url>
<connection>https://github.com/js-cookie/java-cookie.git</connection>
<developerConnection>scm:git:git@github.com:js-cookie/java-cookie.git</developerConnection>
</scm>
<repositories>
<repository>
<id>RedHat</id>
<url>https://maven.repository.redhat.com/earlyaccess/all</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>process-test-classes</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-dist</artifactId>
<version>7.5.0.Final-redhat-15</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>target</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>failsafe-maven-plugin</artifactId>
<version>2.4.3-alpha-1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.23</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v0.10.18</nodeVersion>
<npmVersion>1.3.8</npmVersion>
</configuration>
</execution>
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
</execution>
<execution>
<id>grunt build</id>
<goals>
<goal>grunt</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</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>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.3</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>${selenium.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
<version>7.2.0.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>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>jbossas-managed</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
<version>7.2.0.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Loading