-
-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
163 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* RED5 Open Source Flash Server - http://code.google.com/p/red5/ | ||
* | ||
* Copyright 2006-2013 by respective authors (see below). All rights reserved. | ||
* | ||
* 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 org.red5.test.selftest; | ||
|
||
import org.red5.server.adapter.MultiThreadedApplicationAdapter; | ||
|
||
/** | ||
* Echo sample application. | ||
* | ||
* @author The Red5 Project | ||
* @author Joachim Bauch (jojo@struktur.de) | ||
*/ | ||
public class EchoApplication extends MultiThreadedApplicationAdapter { | ||
|
||
/** | ||
* Return passed parameter back to client. | ||
* | ||
* @param param Parameter to return. | ||
* @return Passed parameter. | ||
*/ | ||
public Object echo(Object param) { | ||
return param; | ||
} | ||
|
||
} |
91 changes: 91 additions & 0 deletions
91
src/test/java/org/red5/test/selftest/ExternalizableClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
* RED5 Open Source Flash Server - http://code.google.com/p/red5/ | ||
* | ||
* Copyright 2006-2013 by respective authors (see below). All rights reserved. | ||
* | ||
* 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 org.red5.test.selftest; | ||
|
||
import org.red5.io.amf3.IDataInput; | ||
import org.red5.io.amf3.IDataOutput; | ||
import org.red5.io.amf3.IExternalizable; | ||
|
||
public class ExternalizableClass implements IExternalizable { | ||
|
||
private boolean[] a = new boolean[2]; | ||
private byte[] b = new byte[5]; | ||
private double c; | ||
private float d; | ||
private int[] e = new int[3]; | ||
private String[] f = new String[2]; | ||
private Object ob; | ||
private short[] g = new short[3]; | ||
private long[] h = new long[2]; | ||
private String i; | ||
private String j; | ||
|
||
public void readExternal(IDataInput input) { | ||
a[0] = input.readBoolean(); | ||
a[1] = input.readBoolean(); | ||
b[0] = input.readByte(); | ||
b[1] = input.readByte(); | ||
b[2] = input.readByte(); | ||
b[3] = input.readByte(); | ||
b[4] = input.readByte(); | ||
// TODO: input.readBytes | ||
c = input.readDouble(); | ||
d = input.readFloat(); | ||
e[0] = input.readInt(); | ||
e[1] = input.readInt(); | ||
e[2] = input.readInt(); | ||
f[0] = input.readMultiByte(7, "iso-8859-1"); | ||
f[1] = input.readMultiByte(14, "utf-8"); | ||
ob = input.readObject(); | ||
g[0] = input.readShort(); | ||
g[1] = input.readShort(); | ||
g[2] = input.readShort(); | ||
h[0] = input.readUnsignedInt(); | ||
h[1] = input.readUnsignedInt(); | ||
i = input.readUTF(); | ||
j = input.readUTFBytes(12); | ||
} | ||
|
||
public void writeExternal(IDataOutput output) { | ||
output.writeBoolean(a[0]); | ||
output.writeBoolean(a[1]); | ||
output.writeByte(b[0]); | ||
output.writeByte(b[1]); | ||
output.writeByte(b[2]); | ||
output.writeByte(b[3]); | ||
output.writeByte(b[4]); | ||
output.writeDouble(c); | ||
output.writeFloat(d); | ||
output.writeInt(e[0]); | ||
output.writeInt(e[1]); | ||
output.writeInt(e[2]); | ||
output.writeMultiByte(f[0], "iso-8859-1"); | ||
output.writeMultiByte(f[1], "utf-8"); | ||
output.writeObject(ob); | ||
output.writeShort(g[0]); | ||
output.writeShort(g[1]); | ||
output.writeShort(g[2]); | ||
output.writeUnsignedInt(h[0]); | ||
output.writeUnsignedInt(h[1]); | ||
output.writeUTF(i); | ||
output.writeUTFBytes(j); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* RED5 Open Source Flash Server - http://code.google.com/p/red5/ | ||
* | ||
* Copyright 2006-2013 by respective authors (see below). All rights reserved. | ||
* | ||
* 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 org.red5.test.selftest; | ||
|
||
public class RemoteClass { | ||
|
||
public String attribute1; | ||
|
||
public int attribute2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters