You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2014/12/08 11:41:43 UTC

tomee git commit: missing files

Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x c1998e1b5 -> 05a294f91


missing files


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/05a294f9
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/05a294f9
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/05a294f9

Branch: refs/heads/tomee-1.7.x
Commit: 05a294f915c4d385611c702c53d843bfff1ee381
Parents: c1998e1
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Mon Dec 8 11:41:37 2014 +0100
Committer: Romain Manni-Bucau <rm...@apache.org>
Committed: Mon Dec 8 11:41:37 2014 +0100

----------------------------------------------------------------------
 .../org/apache/openejb/testing/RandomPort.java  | 29 ++++++++++++
 .../org/apache/openejb/testing/SimpleLog.java   | 28 ++++++++++++
 .../apache/openejb/testing/RandomPortTest.java  | 48 ++++++++++++++++++++
 3 files changed, 105 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/05a294f9/container/openejb-core/src/main/java/org/apache/openejb/testing/RandomPort.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/testing/RandomPort.java b/container/openejb-core/src/main/java/org/apache/openejb/testing/RandomPort.java
new file mode 100644
index 0000000..164f323
--- /dev/null
+++ b/container/openejb-core/src/main/java/org/apache/openejb/testing/RandomPort.java
@@ -0,0 +1,29 @@
+/*
+ * 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.testing;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface RandomPort {
+    String value();
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/05a294f9/container/openejb-core/src/main/java/org/apache/openejb/testing/SimpleLog.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/testing/SimpleLog.java b/container/openejb-core/src/main/java/org/apache/openejb/testing/SimpleLog.java
new file mode 100644
index 0000000..ac955fd
--- /dev/null
+++ b/container/openejb-core/src/main/java/org/apache/openejb/testing/SimpleLog.java
@@ -0,0 +1,28 @@
+/*
+ * 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.testing;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface SimpleLog {
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/05a294f9/container/openejb-core/src/test/java/org/apache/openejb/testing/RandomPortTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/test/java/org/apache/openejb/testing/RandomPortTest.java b/container/openejb-core/src/test/java/org/apache/openejb/testing/RandomPortTest.java
new file mode 100644
index 0000000..9c779e2
--- /dev/null
+++ b/container/openejb-core/src/test/java/org/apache/openejb/testing/RandomPortTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.testing;
+
+import org.apache.openejb.jee.EjbJar;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.net.URL;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+@RunWith(ApplicationComposer.class)
+public class RandomPortTest {
+    @Module
+    public EjbJar jar() {
+        return new EjbJar();
+    }
+
+    @RandomPort("httpejb")
+    private int port;
+
+    @RandomPort("httpejb")
+    private URL portUrl;
+
+    @Test
+    public void checkRandom() {
+        assertTrue(port > 0);
+        assertNotNull(portUrl);
+        assertEquals(port, portUrl.getPort());
+    }
+}