diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/WebSocketFrame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/WebSocketFrame.java index 62329e34f04..3b6afa0fc67 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/WebSocketFrame.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/WebSocketFrame.java @@ -35,16 +35,16 @@ public class WebSocketFrame implements Frame /** Maximum size of Control frame, per RFC 6455 */ public static final int MAX_CONTROL_PAYLOAD = 125; - public static WebSocketFrame binar(byte buf[]) - { - return new WebSocketFrame(OpCode.BINARY).setPayload(buf); - } - public static WebSocketFrame binary() { return new WebSocketFrame(OpCode.BINARY); } + public static WebSocketFrame binary(byte buf[]) + { + return new WebSocketFrame(OpCode.BINARY).setPayload(buf); + } + public static WebSocketFrame text() { return new WebSocketFrame(OpCode.TEXT); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/ab/TestABCase1_1.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/ab/TestABCase1_1.java index e59336df969..3ddf6057f98 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/ab/TestABCase1_1.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/ab/TestABCase1_1.java @@ -10,7 +10,6 @@ import org.eclipse.jetty.websocket.api.WebSocketPolicy; import org.eclipse.jetty.websocket.generator.Generator; import org.eclipse.jetty.websocket.parser.FrameParseCapture; import org.eclipse.jetty.websocket.parser.Parser; -import org.eclipse.jetty.websocket.protocol.FrameBuilder; import org.eclipse.jetty.websocket.protocol.OpCode; import org.eclipse.jetty.websocket.protocol.WebSocketFrame; import org.junit.Assert; @@ -35,7 +34,7 @@ public class TestABCase1_1 builder.append("*"); } - WebSocketFrame textFrame = FrameBuilder.text(builder.toString()).asFrame(); + WebSocketFrame textFrame = WebSocketFrame.text(builder.toString()); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(textFrame); @@ -73,7 +72,7 @@ public class TestABCase1_1 builder.append("*"); } - WebSocketFrame textFrame = FrameBuilder.text(builder.toString()).asFrame(); + WebSocketFrame textFrame = WebSocketFrame.text(builder.toString()); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(textFrame); @@ -115,7 +114,7 @@ public class TestABCase1_1 builder.append("*"); } - WebSocketFrame textFrame = FrameBuilder.text(builder.toString()).asFrame(); + WebSocketFrame textFrame = WebSocketFrame.text(builder.toString()); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(textFrame); @@ -157,7 +156,7 @@ public class TestABCase1_1 builder.append("*"); } - WebSocketFrame textFrame = FrameBuilder.text(builder.toString()).asFrame(); + WebSocketFrame textFrame = WebSocketFrame.text(builder.toString()); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(textFrame); @@ -199,7 +198,7 @@ public class TestABCase1_1 builder.append("*"); } - WebSocketFrame textFrame = FrameBuilder.text(builder.toString()).asFrame(); + WebSocketFrame textFrame = WebSocketFrame.text(builder.toString()); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(textFrame); @@ -239,7 +238,7 @@ public class TestABCase1_1 builder.append("*"); } - WebSocketFrame textFrame = FrameBuilder.text(builder.toString()).asFrame(); + WebSocketFrame textFrame = WebSocketFrame.text(builder.toString()); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(textFrame); @@ -270,7 +269,7 @@ public class TestABCase1_1 @Test public void testGenerateEmptyTextCase1_1_1() { - WebSocketFrame textFrame = FrameBuilder.text("").asFrame(); + WebSocketFrame textFrame = WebSocketFrame.text(""); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(textFrame); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/ab/TestABCase1_2.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/ab/TestABCase1_2.java index 394b8d6b1eb..12dd4d181e6 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/ab/TestABCase1_2.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/ab/TestABCase1_2.java @@ -11,7 +11,6 @@ import org.eclipse.jetty.websocket.api.WebSocketPolicy; import org.eclipse.jetty.websocket.generator.Generator; import org.eclipse.jetty.websocket.parser.FrameParseCapture; import org.eclipse.jetty.websocket.parser.Parser; -import org.eclipse.jetty.websocket.protocol.FrameBuilder; import org.eclipse.jetty.websocket.protocol.OpCode; import org.eclipse.jetty.websocket.protocol.WebSocketFrame; import org.junit.Assert; @@ -38,7 +37,7 @@ public class TestABCase1_2 bb.flip(); - WebSocketFrame binaryFrame = FrameBuilder.binary(BufferUtil.toArray(bb)).asFrame(); + WebSocketFrame binaryFrame = WebSocketFrame.binary(BufferUtil.toArray(bb)); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(binaryFrame); @@ -79,7 +78,7 @@ public class TestABCase1_2 bb.flip(); - WebSocketFrame binaryFrame = FrameBuilder.binary(BufferUtil.toArray(bb)).asFrame(); + WebSocketFrame binaryFrame = WebSocketFrame.binary(BufferUtil.toArray(bb)); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(binaryFrame); @@ -124,7 +123,7 @@ public class TestABCase1_2 bb.flip(); - WebSocketFrame binaryFrame = FrameBuilder.binary(BufferUtil.toArray(bb)).asFrame(); + WebSocketFrame binaryFrame = WebSocketFrame.binary(BufferUtil.toArray(bb)); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(binaryFrame); @@ -168,7 +167,7 @@ public class TestABCase1_2 } bb.flip(); - WebSocketFrame binaryFrame = FrameBuilder.binary(BufferUtil.toArray(bb)).asFrame(); + WebSocketFrame binaryFrame = WebSocketFrame.binary(BufferUtil.toArray(bb)); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(binaryFrame); @@ -213,7 +212,7 @@ public class TestABCase1_2 bb.flip(); - WebSocketFrame binaryFrame = FrameBuilder.binary(BufferUtil.toArray(bb)).asFrame(); + WebSocketFrame binaryFrame = WebSocketFrame.binary(BufferUtil.toArray(bb)); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(binaryFrame); @@ -255,7 +254,7 @@ public class TestABCase1_2 bb.flip(); - WebSocketFrame binaryFrame = FrameBuilder.binary(BufferUtil.toArray(bb)).asFrame(); + WebSocketFrame binaryFrame = WebSocketFrame.binary(BufferUtil.toArray(bb)); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(binaryFrame); @@ -286,7 +285,7 @@ public class TestABCase1_2 @Test public void testGenerateEmptyBinaryCase1_2_1() { - WebSocketFrame binaryFrame = FrameBuilder.binary(new byte[] {}).asFrame(); + WebSocketFrame binaryFrame = WebSocketFrame.binary(new byte[] {}); Generator generator = new Generator(policy); ByteBuffer actual = generator.generate(binaryFrame);