blob: b5f8e98f2252aa9e21e7fb7c8668d2862a2395f0 [file] [log] [blame]
// Copyright 2019 Xinge Gao
//
// 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 test;
import com.caucho.hessian.io.Hessian2Output;
import com.caucho.hessian.test.TestHessian2Servlet;
import java.lang.reflect.Method;
public class Hessian {
public static void main(String[] args) throws Exception {
Method method = null;
if (args[0].startsWith("throw_")) {
method = TestThrowable.class.getMethod(args[0]);
} else {
method = TestHessian2Servlet.class.getMethod(args[0]);
}
TestHessian2Servlet servlet = new TestHessian2Servlet();
Object object = method.invoke(servlet);
Hessian2Output output = new Hessian2Output(System.out);
output.writeObject(object);
output.flush();
}
}