Skip to content

Commit

Permalink
Issue #1 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita committed May 14, 2012
1 parent 2547c72 commit 7f0664c
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 13 deletions.
15 changes: 15 additions & 0 deletions src/main/java/com/corundumstudio/socketio/PacketHandler.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Copyright 2012 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.corundumstudio.socketio;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

public class AuthorizeMessage extends BaseMessage {

private UUID sessionId;
private String origin;
private String msg;
private String jsonpParam;
private final UUID sessionId;
private final String origin;
private final String msg;
private final String jsonpParam;

public AuthorizeMessage(String msg, String jsonpParam, String origin, UUID sessionId) {
this.origin = origin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Copyright 2012 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.corundumstudio.socketio.messages;

import org.jboss.netty.buffer.ChannelBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

public class WebSocketPacketMessage extends BaseMessage {

private UUID sessionId;
private Packet packet;
private final UUID sessionId;
private final Packet packet;

public WebSocketPacketMessage(UUID sessionId, Packet packet) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class WebsocketErrorMessage extends BaseMessage {

private Packet packet;
private final Packet packet;

public WebsocketErrorMessage(Packet packet) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

public class XHRErrorMessage extends BaseMessage {

private Packet packet;
private String origin;
private final Packet packet;
private final String origin;

public XHRErrorMessage(Packet packet, String origin) {
this.packet = packet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

public class XHRNewChannelMessage extends BaseMessage {

private UUID sessionId;
private String origin;
private final UUID sessionId;
private final String origin;

public XHRNewChannelMessage(UUID sessionId, String origin) {
this.sessionId = sessionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

public class XHRPostMessage extends BaseMessage {

private String origin;
private final String origin;

public XHRPostMessage(String origin) {
this.origin = origin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Copyright 2012 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.corundumstudio.socketio.parser;

public class DecoderException extends RuntimeException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Copyright 2012 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.corundumstudio.socketio.transport;

import java.net.SocketAddress;
Expand Down
17 changes: 16 additions & 1 deletion src/test/java/com/corundumstudio/socketio/PacketHandlerTest.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/**
* Copyright 2012 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.corundumstudio.socketio;

import java.util.ArrayList;
Expand Down Expand Up @@ -102,7 +117,7 @@ private void testHandler(final AtomicInteger invocations,
Assert.assertEquals(packets.size(), invocations.get());
}

@Test
//@Test
public void testDecodePerf() throws Exception {
PacketListener listener = new PacketListener(null, null, null) {
@Override
Expand Down

0 comments on commit 7f0664c

Please sign in to comment.