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 2016/02/05 08:03:09 UTC
tomee git commit: try to not use default AMQ broker port in test as
default port but another one to avoid potential conflicts
Repository: tomee
Updated Branches:
refs/heads/master 7293b1a5c -> 891f8df58
try to not use default AMQ broker port in test as default port but another one to avoid potential conflicts
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/891f8df5
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/891f8df5
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/891f8df5
Branch: refs/heads/master
Commit: 891f8df589c31f0d8e1b0dfb83f777ed5b3b31c2
Parents: 7293b1a
Author: Romain manni-Bucau <rm...@gmail.com>
Authored: Fri Feb 5 08:01:42 2016 +0100
Committer: Romain manni-Bucau <rm...@gmail.com>
Committed: Fri Feb 5 08:01:42 2016 +0100
----------------------------------------------------------------------
.../activemq/OpenEjbBrokerFactoryTest.java | 2 +-
.../java/org/superbiz/quartz/QuartzMdbTest.java | 67 ++++++++++++++++++++
.../superbiz/ws/security/CalculatorBean.java" | 30 +++++++++
.../ws/security/PasswordCallbackHandler.java" | 44 +++++++++++++
.../main/resources/META-INF/openejb-jar.xml" | 24 +++++++
5 files changed, 166 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/891f8df5/container/openejb-core/src/test/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactoryTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/test/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactoryTest.java b/container/openejb-core/src/test/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactoryTest.java
index 976d539..ea814f4 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactoryTest.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/resource/activemq/OpenEjbBrokerFactoryTest.java
@@ -46,7 +46,7 @@ import java.util.Map;
import java.util.Properties;
public class OpenEjbBrokerFactoryTest extends TestCase {
- private final int brokerPort = NetworkUtil.getNextAvailablePort(new int[]{61616, 0});
+ private final int brokerPort = NetworkUtil.getNextAvailablePort(new int[]{7272 /* try to not use default AMQ port */, 0});
public void testBrokerUri() throws Exception {
final String prefix = ActiveMQFactory.getBrokerMetaFile();
http://git-wip-us.apache.org/repos/asf/tomee/blob/891f8df5/examples/quartz-app/quartz-beans/src#test/java/org/superbiz/quartz/QuartzMdbTest.java
----------------------------------------------------------------------
diff --git a/examples/quartz-app/quartz-beans/src#test/java/org/superbiz/quartz/QuartzMdbTest.java b/examples/quartz-app/quartz-beans/src#test/java/org/superbiz/quartz/QuartzMdbTest.java
new file mode 100644
index 0000000..784f993
--- /dev/null
+++ b/examples/quartz-app/quartz-beans/src#test/java/org/superbiz/quartz/QuartzMdbTest.java
@@ -0,0 +1,67 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.superbiz.quartz;
+
+import org.apache.openejb.config.OutputGeneratedDescriptors;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.util.Date;
+import java.util.Properties;
+
+public class QuartzMdbTest {
+
+ private static InitialContext initialContext = null;
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ System.setProperty(OutputGeneratedDescriptors.OUTPUT_DESCRIPTORS, "false"); // just to avoid to dump files in /tmp
+ if (null == initialContext) {
+ Properties properties = new Properties();
+ properties.setProperty("openejb.deployments.classpath.include", ".*quartz-.*");
+ properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
+
+ initialContext = new InitialContext(properties);
+ }
+ }
+
+ @AfterClass
+ public static void afterClass() throws Exception {
+ if (null != initialContext) {
+ initialContext.close();
+ initialContext = null;
+ }
+ }
+
+ @Test
+ public void testLookup() throws Exception {
+
+ final JobScheduler jbi = (JobScheduler) initialContext.lookup("JobBeanLocal");
+ final Date d = jbi.createJob();
+ Thread.sleep(500);
+ System.out.println("Scheduled test job should have run at: " + d.toString());
+ }
+
+ @Test
+ public void testMdb() throws Exception {
+ // Sleep 3 seconds and give quartz a chance to execute our MDB
+ Thread.sleep(3000);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/891f8df5/"examples/webservice-ws-with-resources-config\313src/main/java/org/superbiz/ws/security/CalculatorBean.java"
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/891f8df5/"examples/webservice-ws-with-resources-config\313src/main/java/org/superbiz/ws/security/PasswordCallbackHandler.java"
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/891f8df5/"examples/webservice-ws-with-resources-config\313src/main/resources/META-INF/openejb-jar.xml"
----------------------------------------------------------------------