[jboss-cvs] JBossAS SVN: r76127 - in projects/demos/trunk/ioc/src: main/org/jboss/demos/ioc/lazy and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 23 06:18:51 EDT 2008


Author: alesj
Date: 2008-07-23 06:18:50 -0400 (Wed, 23 Jul 2008)
New Revision: 76127

Added:
   projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/Pojo.java
Modified:
   projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/callback/Checker.java
   projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/LazyImpl.java
   projects/demos/trunk/ioc/src/resources/META-INF/lazy-beans.xml
Log:
More lazy examples, Checker fix.

Modified: projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/callback/Checker.java
===================================================================
--- projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/callback/Checker.java	2008-07-23 10:13:23 UTC (rev 76126)
+++ projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/callback/Checker.java	2008-07-23 10:18:50 UTC (rev 76127)
@@ -21,31 +21,39 @@
 */
 package org.jboss.demos.ioc.callback;
 
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Locale;
 import java.util.Set;
+import java.util.TreeSet;
 
 /**
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
 public class Checker
 {
+   private static final Set<String> expected;
    private Set<Object> elements;
 
+   static
+   {
+      expected = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+      expected.add("42");
+      expected.add("3.14");
+      expected.add("http://www.jboss.org");
+      expected.add("SI");
+   }
+
    public Checker(Set<Object> elements)
    {
+      if (elements == null)
+         throw new IllegalArgumentException("Null elements");
       this.elements = elements;
    }
 
    public void create() throws Throwable
    {
-      Set<Object> expected = new HashSet<Object>();
-      expected.add(Long.parseLong("42"));
-      expected.add(Double.parseDouble("3.14"));
-      expected.add(new URL("http://www.jboss.org"));
-      expected.add(new Locale("SI"));
-      if (expected.equals(elements) == false)
-         throw new IllegalArgumentException("Illegal expected set: " + expected + "!=" + elements);
+      Set<String> strings = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+      for (Object element : elements)
+         strings.add(element.toString());
+      if (expected.equals(strings) == false)
+         throw new IllegalArgumentException("Illegal expected set: " + expected + "!=" + strings);
    }
 }
\ No newline at end of file

Modified: projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/LazyImpl.java
===================================================================
--- projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/LazyImpl.java	2008-07-23 10:13:23 UTC (rev 76126)
+++ projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/LazyImpl.java	2008-07-23 10:18:50 UTC (rev 76127)
@@ -28,6 +28,10 @@
 {
    private ILazyPojo other;
 
+   public LazyImpl()
+   {
+   }
+
    public LazyImpl(ILazyPojo other)
    {
       this.other = other;

Copied: projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/Pojo.java (from rev 76125, projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/LazyImpl.java)
===================================================================
--- projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/Pojo.java	                        (rev 0)
+++ projects/demos/trunk/ioc/src/main/org/jboss/demos/ioc/lazy/Pojo.java	2008-07-23 10:18:50 UTC (rev 76127)
@@ -0,0 +1,29 @@
+/*
+* 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.demos.ioc.lazy;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Pojo
+{
+}
\ No newline at end of file

Modified: projects/demos/trunk/ioc/src/resources/META-INF/lazy-beans.xml
===================================================================
--- projects/demos/trunk/ioc/src/resources/META-INF/lazy-beans.xml	2008-07-23 10:13:23 UTC (rev 76126)
+++ projects/demos/trunk/ioc/src/resources/META-INF/lazy-beans.xml	2008-07-23 10:18:50 UTC (rev 76127)
@@ -20,4 +20,8 @@
     </constructor>
   </bean>
 
+  <lazy name="anotherLazy" bean="Pojo" exposeClass="true"/>
+
+  <bean name="Pojo" class="org.jboss.demos.ioc.lazy.Pojo"/>
+
 </deployment>




More information about the jboss-cvs-commits mailing list