openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r750625 - in /incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test: mock/MockServletContextEvent.java unittests/config/WebBeansScannerTest.java
Date Thu, 05 Mar 2009 22:07:10 GMT
Author: gerdogdu
Date: Thu Mar  5 22:07:09 2009
New Revision: 750625

URL: http://svn.apache.org/viewvc?rev=750625&view=rev
Log:
Update tests for discovery and also addition of some mock objects.

Added:
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/mock/MockServletContextEvent.java
  (with props)
Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/config/WebBeansScannerTest.java

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/mock/MockServletContextEvent.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/mock/MockServletContextEvent.java?rev=750625&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/mock/MockServletContextEvent.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/mock/MockServletContextEvent.java
Thu Mar  5 22:07:09 2009
@@ -0,0 +1,30 @@
+/*
+ *  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.webbeans.test.mock;
+
+import javax.servlet.ServletContextEvent;
+
+public class MockServletContextEvent extends ServletContextEvent
+{
+    private static final long serialVersionUID = 1L;
+
+    public MockServletContextEvent()
+    {
+        super(new MockServletContext());
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/mock/MockServletContextEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/config/WebBeansScannerTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/config/WebBeansScannerTest.java?rev=750625&r1=750624&r2=750625&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/config/WebBeansScannerTest.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/config/WebBeansScannerTest.java
Thu Mar  5 22:07:09 2009
@@ -22,7 +22,8 @@
 
 import junit.framework.Assert;
 
-import org.apache.webbeans.config.WebBeansScanner;
+import org.apache.webbeans.spi.ServiceLoader;
+import org.apache.webbeans.spi.deployer.MetaDataDiscoveryService;
 import org.apache.webbeans.test.mock.MockServletContext;
 import org.apache.webbeans.test.servlet.TestContext;
 import org.apache.webbeans.util.ArrayUtil;
@@ -49,13 +50,13 @@
     @Test
     public void testWebBeansScanner() throws Exception
     {
-        WebBeansScanner scanner = new WebBeansScanner();
+        MetaDataDiscoveryService scanner = ServiceLoader.getService(MetaDataDiscoveryService.class);
 
         ServletContext servletContext = new MockServletContext();
-        scanner.scan(servletContext);
+        scanner.init(servletContext);
 
         // try to re-run the scan
-        scanner.scan(servletContext);
+        scanner.scan();
 
         Map<String, Set<String>> classMap = scanner.getANNOTATION_DB().getClassIndex();
         Assert.assertNotNull(classMap);



Mime
View raw message