Author: kmalhi
Date: Tue Jul 20 12:01:27 2010
New Revision: 965818
URL: http://svn.apache.org/viewvc?rev=965818&view=rev
Log:
Tested @Timeout keys
Added:
openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/CheckInvalidTimeoutTest.java
Added:
openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/CheckInvalidTimeoutTest.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/CheckInvalidTimeoutTest.java?rev=965818&view=auto
==============================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/CheckInvalidTimeoutTest.java
(added)
+++
openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/rules/CheckInvalidTimeoutTest.java
Tue Jul 20 12:01:27 2010
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.openejb.config.rules;
+
+import javax.ejb.Timeout;
+
+import junit.framework.TestCase;
+
+import org.apache.openejb.jee.EjbJar;
+import org.apache.openejb.jee.StatelessBean;
+import org.junit.runner.RunWith;
+
+...@runwith(ValidationRunner.class)
+public class CheckInvalidTimeoutTest extends TestCase {
+ @Keys( { @Key(value = "timeout.badReturnType"),
@Key("timeout.invalidArguments"), @Key("timeout.tooManyMethods") })
+ public EjbJar test() throws Exception {
+ System.setProperty("openejb.validation.output.level", "VERBOSE");
+ EjbJar ejbJar = new EjbJar();
+ ejbJar.addEnterpriseBean(new StatelessBean(TestBean.class));
+ ejbJar.addEnterpriseBean(new StatelessBean(FooBean.class));
+ return ejbJar;
+ }
+
+ public static class TestBean {
+ @Timeout
+ public Object bar() {
+ return null;
+ }
+ }
+
+ public static class FooBean {
+ @Timeout
+ public void foo(javax.ejb.Timer timer) {}
+ @Timeout
+ public void bar(javax.ejb.Timer timer) {}
+ }
+}
\ No newline at end of file