[savara-commits] savara SVN: r311 - in trunk/tools/tests/org.jboss.savara.protocol.contract.tests: META-INF and 9 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jul 7 10:25:53 EDT 2010


Author: objectiser
Date: 2010-07-07 10:25:52 -0400 (Wed, 07 Jul 2010)
New Revision: 311

Added:
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/META-INF/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/META-INF/MANIFEST.MF
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/ContractGeneratorTest.java
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/osgi/
   trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/osgi/Activator.java
Log:
Initial contract generation plugins.

Added: trunk/tools/tests/org.jboss.savara.protocol.contract.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/tools/tests/org.jboss.savara.protocol.contract.tests/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/tools/tests/org.jboss.savara.protocol.contract.tests/META-INF/MANIFEST.MF	2010-07-07 14:25:52 UTC (rev 311)
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JBoss SAVARA Protocol Contract Tests Plugin
+Bundle-SymbolicName: org.jboss.savara.protocol.contract.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.savara.protocol.contract.tests.osgi.Activator
+Bundle-Vendor: www.jboss.org
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.scribble.core,
+ org.scribble.conversation.model,
+ org.jboss.savara.contract.model,
+ org.jboss.savara.protocol.contract,
+ org.junit
+Export-Package: org.jboss.savara.protocol.contract.tests

Added: trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/ContractGeneratorTest.java
===================================================================
--- trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/ContractGeneratorTest.java	                        (rev 0)
+++ trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/ContractGeneratorTest.java	2010-07-07 14:25:52 UTC (rev 311)
@@ -0,0 +1,89 @@
+package org.jboss.savara.protocol.contract.tests;
+
+import static org.junit.Assert.*;
+
+import org.jboss.savara.protocol.contract.ContractGenerator;
+import org.jboss.savara.protocol.contract.ContractGeneratorFactory;
+import org.scribble.conversation.model.Conversation;
+import org.scribble.model.LocatedName;
+import org.scribble.model.Role;
+
+public class ContractGeneratorTest {
+
+	@org.junit.Test
+	public void testGenerateProtocolNull() {
+		
+		ContractGenerator generator=ContractGeneratorFactory.getContractGenerator();
+		
+		try {
+			Conversation conv=null;
+			Role role=new Role();
+			
+			generator.generate(conv, role);
+			
+			fail("Should have thrown IllegalArgumentException");
+			
+		} catch(IllegalArgumentException iae) {
+			// Test worked
+		}
+	}
+
+	@org.junit.Test
+	public void testGenerateRoleNull() {
+		
+		ContractGenerator generator=ContractGeneratorFactory.getContractGenerator();
+		
+		try {
+			Conversation conv=new Conversation();
+			conv.setLocatedName(new LocatedName());
+			
+			Role role=null;
+			
+			generator.generate(conv, role);
+			
+			fail("Should have thrown IllegalArgumentException");
+			
+		} catch(IllegalArgumentException iae) {
+			// Test worked
+		}
+	}
+
+	@org.junit.Test
+	public void testGenerateConversationAndRoleNotNull1() {
+		
+		ContractGenerator generator=ContractGeneratorFactory.getContractGenerator();
+		
+		try {
+			Conversation conv=new Conversation();
+			LocatedName ln=new LocatedName();
+			ln.setRole(new Role());
+			conv.setLocatedName(ln);
+			
+			Role role=null;
+			
+			generator.generate(conv, role);
+			
+		} catch(IllegalArgumentException iae) {			
+			fail("Should NOT have thrown IllegalArgumentException");
+		}
+	}
+
+	@org.junit.Test
+	public void testGenerateConversationAndRoleNotNull2() {
+		
+		ContractGenerator generator=ContractGeneratorFactory.getContractGenerator();
+		
+		try {
+			Conversation conv=new Conversation();
+			LocatedName ln=new LocatedName();
+			conv.setLocatedName(ln);
+			
+			Role role=new Role();
+			
+			generator.generate(conv, role);
+			
+		} catch(IllegalArgumentException iae) {			
+			fail("Should NOT have thrown IllegalArgumentException");
+		}
+	}
+}

Added: trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/osgi/Activator.java
===================================================================
--- trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/osgi/Activator.java	                        (rev 0)
+++ trunk/tools/tests/org.jboss.savara.protocol.contract.tests/src/java/org/jboss/savara/protocol/contract/tests/osgi/Activator.java	2010-07-07 14:25:52 UTC (rev 311)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.jboss.savara.protocol.contract.tests.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}



More information about the savara-commits mailing list