[jboss-cvs] JBossAS SVN: r76858 - in projects/microcontainer/trunk/kernel/src: tests/org/jboss/test/kernel/deployment/support and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Aug 10 06:28:37 EDT 2008


Author: alesj
Date: 2008-08-10 06:28:37 -0400 (Sun, 10 Aug 2008)
New Revision: 76858

Added:
   projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.xml
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/MockServiceBinding.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.java
Modified:
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/ScopingOverrideTestCase.java
Log:
Mock service binding test.

Copied: projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.xml (from rev 76841, projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/deployment/test/ScopingOverrideTestCase.xml)
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.xml	2008-08-10 10:28:37 UTC (rev 76858)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="ServiceBinding" class="org.jboss.test.kernel.deployment.support.MockServiceBinding">
+    <constructor>
+      <parameter>jboss.remoting:service=JMXConnectorServer,protocol=rmi</parameter>
+      <parameter>${jboss.bind.address}</parameter>
+      <parameter>1090</parameter>
+    </constructor>
+  </bean>
+
+</deployment>

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/MockServiceBinding.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/MockServiceBinding.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/MockServiceBinding.java	2008-08-10 10:28:37 UTC (rev 76858)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.deployment.support;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MockServiceBinding
+{
+   private String serviceName;
+   private String hostName;
+   private int port;
+
+   public MockServiceBinding(String serviceName, String hostName, int port)
+   {
+      this.serviceName = serviceName;
+      this.hostName = hostName;
+      this.port = port;
+   }
+
+   public String getServiceName()
+   {
+      return serviceName;
+   }
+
+   public String getHostName()
+   {
+      return hostName;
+   }
+
+   public int getPort()
+   {
+      return port;
+   }
+}

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java	2008-08-09 18:59:52 UTC (rev 76857)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.java	2008-08-10 10:28:37 UTC (rev 76858)
@@ -66,6 +66,7 @@
       suite.addTest(AnonymousBeansTestCase.suite());
       suite.addTest(AnonymousBeansXMLTestCase.suite());
       suite.addTest(MutableMetaDataTestCase.suite());
+      suite.addTest(MockServiceBindingTestCase.suite());
       // bean container tests
       suite.addTest(BeanContainerUsageTestCase.suite());
       suite.addTest(BeanContainerUsageMDTestCase.suite());

Copied: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.java (from rev 76841, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/ScopingOverrideTestCase.java)
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.java	2008-08-10 10:28:37 UTC (rev 76858)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.deployment.test;
+
+import junit.framework.Test;
+import org.jboss.test.kernel.deployment.support.MockServiceBinding;
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+import org.jboss.test.AbstractTestDelegate;
+
+/**
+ * MockServiceBindingTestCase
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MockServiceBindingTestCase extends AbstractDeploymentTest
+{
+   public MockServiceBindingTestCase(String name) throws Throwable
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(MockServiceBindingTestCase.class);
+   }
+
+   public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
+   {
+      System.setProperty("jboss.bind.address", "SomeJBossBindAddress");
+      AbstractTestDelegate delegate = MicrocontainerTest.getDelegate(clazz);
+      delegate.enableSecurity = true;
+      return delegate;
+   }
+
+   public void testConfiguration() throws Throwable
+   {
+      MockServiceBinding binding = (MockServiceBinding)getBean("ServiceBinding");
+      assertNotNull(binding);
+      // it's canonicalized due to AbstractValueMetaData::setValue --> JMXObjectNameFix::needsAnAlias
+      assertEquals("jboss.remoting:protocol=rmi,service=JMXConnectorServer", binding.getServiceName());
+      assertEquals("SomeJBossBindAddress", binding.getHostName());
+      assertEquals(1090, binding.getPort());
+   }
+}
\ No newline at end of file

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/ScopingOverrideTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/ScopingOverrideTestCase.java	2008-08-09 18:59:52 UTC (rev 76857)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/ScopingOverrideTestCase.java	2008-08-10 10:28:37 UTC (rev 76858)
@@ -43,9 +43,6 @@
       return suite(ScopingOverrideTestCase.class);
    }
 
-
-   // ---- tests
-
    public void testScopingOverride() throws Throwable
    {
       //This gets injected from the scoped controller




More information about the jboss-cvs-commits mailing list