[jboss-svn-commits] JBoss Common SVN: r4123 - in arquillian/trunk/examples/testng/src/test/java/com/acme/cdi: payment and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Mar 8 09:06:48 EST 2010


Author: aslak
Date: 2010-03-08 09:06:48 -0500 (Mon, 08 Mar 2010)
New Revision: 4123

Added:
   arquillian/trunk/examples/testng/src/test/java/com/acme/cdi/payment/
   arquillian/trunk/examples/testng/src/test/java/com/acme/cdi/payment/SynchronousPaymentProcessorTestCase.java
Log:
ARQ-44


Added: arquillian/trunk/examples/testng/src/test/java/com/acme/cdi/payment/SynchronousPaymentProcessorTestCase.java
===================================================================
--- arquillian/trunk/examples/testng/src/test/java/com/acme/cdi/payment/SynchronousPaymentProcessorTestCase.java	                        (rev 0)
+++ arquillian/trunk/examples/testng/src/test/java/com/acme/cdi/payment/SynchronousPaymentProcessorTestCase.java	2010-03-08 14:06:48 UTC (rev 4123)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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 com.acme.cdi.payment;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.testng.Arquillian;
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.Archives;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class SynchronousPaymentProcessorTestCase extends Arquillian {
+
+	@Deployment
+	public static JavaArchive createDeployment() {
+		return Archives.create("test.jar", JavaArchive.class)
+				.addPackage(
+						Synchronous.class.getPackage()
+				)
+				.addManifestResource(
+						"com/acme/cdi/payment/beans.xml",
+						ArchivePaths.create("beans.xml"));
+	}
+	
+	@Inject @Synchronous PaymentProcessor processor;
+	
+	@Test
+	public void shouldBeReplacedByAMock() throws Exception
+	{
+		processor.process("");
+		Assert.assertTrue(MockPaymentProcessor.HAS_BEEN_CALLED);
+	}
+}



More information about the jboss-svn-commits mailing list