Author: pete.muir(a)jboss.org
Date: 2008-12-09 10:38:10 -0500 (Tue, 09 Dec 2008)
New Revision: 504
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/FinalTuna.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FinalTuna.java
Modified:
ri/trunk/build.properties
ri/trunk/examples/numberguess/WebContent/home.xhtml
ri/trunk/examples/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java
ri/trunk/examples/pom.xml
ri/trunk/pom.xml
ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs
ri/trunk/webbeans-ri/
ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Plaice.java
Log:
throw unproxyabledependencyexception at startup
Modified: ri/trunk/build.properties
===================================================================
--- ri/trunk/build.properties 2008-12-09 15:33:59 UTC (rev 503)
+++ ri/trunk/build.properties 2008-12-09 15:38:10 UTC (rev 504)
@@ -1 +1 @@
-jboss.home=/Applications/jboss-5.0.0.GA
+jboss.home=/Users/pmuir/workspace/jboss5/build/output/jboss-5.0.0.GA
Modified: ri/trunk/examples/numberguess/WebContent/home.xhtml
===================================================================
--- ri/trunk/examples/numberguess/WebContent/home.xhtml 2008-12-09 15:33:59 UTC (rev 503)
+++ ri/trunk/examples/numberguess/WebContent/home.xhtml 2008-12-09 15:38:10 UTC (rev 504)
@@ -9,16 +9,14 @@
<ui:define name="content">
<h1>Guess a number...</h1>
<h:form id="NumberGuessMain">
- <div>
+ <div style="color: red">
<h:messages id="messages" globalOnly="true"/>
<h:outputText id="Higher" value="Higher!"
rendered="#{game.number gt game.guess}"/>
<h:outputText id="Lower" value="Lower!"
rendered="#{game.number lt game.guess}"/>
</div>
<div>
- I'm thinking of a number between <h:outputText
id="Smallest" value="#{game.smallest}"/> and
- <h:outputText id="Biggest"
value="#{game.biggest}"/>. You have
- <h:outputText id="RemainingGuesses"
value="#{game.remainingGuesses}"/> guesses.
+ I'm thinking of a number between #{game.smallest} and #{game.biggest}.
You have #{game.remainingGuesses} guesses.
</div>
<div>
Modified:
ri/trunk/examples/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java
===================================================================
---
ri/trunk/examples/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java 2008-12-09
15:33:59 UTC (rev 503)
+++
ri/trunk/examples/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -11,13 +11,17 @@
@SessionScoped
public class Game
{
- private final int number;
+ private int number;
private int guess;
private int smallest;
private int biggest;
private int remainingGuesses;
+ public Game()
+ {
+ }
+
@Initializer
Game(@Random int number, @MaxNumber int maxNumber)
{
Modified: ri/trunk/examples/pom.xml
===================================================================
--- ri/trunk/examples/pom.xml 2008-12-09 15:33:59 UTC (rev 503)
+++ ri/trunk/examples/pom.xml 2008-12-09 15:38:10 UTC (rev 504)
@@ -35,31 +35,5 @@
</pluginManagement>
</build>
- <profiles>
- <profile>
- <activation>
- <property>
- <name>explode</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webappDirectory>
-
${jboss.home}/server/default/deploy/${project.build.finalName}.war
- </webappDirectory>
- </configuration>
- </plugin>
- </plugins>
- <defaultGoal>war:exploded</defaultGoal>
- </build>
- </profile>
- </profiles>
-
-
-
</project>
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2008-12-09 15:33:59 UTC (rev 503)
+++ ri/trunk/pom.xml 2008-12-09 15:38:10 UTC (rev 504)
@@ -136,7 +136,7 @@
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
- <version>1.0</version>
+ <version>1.2</version>
</dependency>
<dependency>
@@ -156,7 +156,37 @@
<artifactId>jboss-ejb3-embedded</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <version>1.0_02.CR2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.15.B1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <version>1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-api</artifactId>
+ <version>${webbeans.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-ri</artifactId>
+ <version>${webbeans.version}</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
@@ -280,5 +310,9 @@
</plugin>
</plugins>
</reporting>
+
+ <properties>
+ <webbeans.version>1.0.0-SNAPSHOT</webbeans.version>
+ </properties>
</project>
Modified: ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs 2008-12-09 15:33:59 UTC
(rev 503)
+++ ri/trunk/webbeans-api/.settings/org.eclipse.jdt.core.prefs 2008-12-09 15:38:10 UTC
(rev 504)
@@ -1,4 +1,4 @@
-#Thu Dec 04 18:33:44 GMT 2008
+#Tue Dec 09 14:39:16 CET 2008
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Property changes on: ri/trunk/webbeans-ri
___________________________________________________________________
Name: svn:ignore
- .project
.classpath
target
test-output
temp-testng-customsuite.xml
+ .project
.classpath
target
test-output
temp-testng-customsuite.xml
ObjectStore
Modified: ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs 2008-12-09 15:33:59 UTC (rev
503)
+++ ri/trunk/webbeans-ri/.settings/org.eclipse.jdt.core.prefs 2008-12-09 15:38:10 UTC (rev
504)
@@ -1,4 +1,4 @@
-#Thu Dec 04 18:33:54 GMT 2008
+#Tue Dec 09 14:39:16 CET 2008
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.5
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-09
15:33:59 UTC (rev 503)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -29,8 +29,10 @@
import javax.webbeans.Observes;
import javax.webbeans.Produces;
import javax.webbeans.Production;
+import javax.webbeans.UnproxyableDependencyException;
import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.MetaDataCache;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -219,6 +221,10 @@
{
throw new DefinitionException("Web Bean implementation class " + type
+ " cannot be declared abstract");
}
+ if (MetaDataCache.instance().getScopeModel(getScopeType()).isNormal() &&
!getAnnotatedItem().isProxyable())
+ {
+ throw new UnproxyableDependencyException(toString() + " is not
proxyable");
+ }
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-09
15:33:59 UTC (rev 503)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -55,9 +55,9 @@
public static void beginApplication(ServletContext context)
{
servletContext = context;
+ ApplicationContext.INSTANCE.setBeanMap(new ApplicationBeanMap(servletContext));
WebBeansBootstrap webBeansBootstrap = new WebBeansBootstrap();
webBeansBootstrap.boot(getWebBeanDiscovery());
- ApplicationContext.INSTANCE.setBeanMap(new ApplicationBeanMap(servletContext));
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-09
15:33:59 UTC (rev 503)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -144,7 +144,7 @@
String name = (String) names.nextElement();
if (name.startsWith(getKeyPrefix()))
{
- String id = name.substring(getKeyPrefix().length());
+ String id = name.substring(getKeyPrefix().length() + 1);
Contextual<?> bean =
CurrentManager.rootManager().getBeans().get(Integer.parseInt(id));
beans.add(bean);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2008-12-09
15:33:59 UTC (rev 503)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -10,10 +10,10 @@
import javax.webbeans.UnproxyableDependencyException;
import javax.webbeans.manager.Bean;
-import org.jboss.webbeans.test.beans.FinalTuna;
import org.jboss.webbeans.test.beans.Fox;
import org.jboss.webbeans.test.beans.Tuna;
import org.jboss.webbeans.test.beans.TunedTuna;
+import org.jboss.webbeans.test.beans.broken.FinalTuna;
import org.jboss.webbeans.util.BeanFactory;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.Test;
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java 2008-12-09
15:33:59 UTC (rev 503)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -13,7 +13,7 @@
import org.jboss.webbeans.test.beans.Animal;
import org.jboss.webbeans.test.beans.DeadlyAnimal;
import org.jboss.webbeans.test.beans.DeadlySpider;
-import org.jboss.webbeans.test.beans.FinalTuna;
+import org.jboss.webbeans.test.beans.DependentFinalTuna;
import org.jboss.webbeans.test.beans.RedSnapper;
import org.jboss.webbeans.test.beans.Spider;
import org.jboss.webbeans.test.beans.SpiderProducer;
@@ -90,7 +90,7 @@
@Test @SpecAssertion(section="2.2")
public void testFinalApiType()
{
- createSimpleBean(FinalTuna.class);
+ createSimpleBean(DependentFinalTuna.class);
}
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-12-09
15:33:59 UTC (rev 503)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -18,13 +18,12 @@
import org.jboss.webbeans.test.annotations.Whitefish;
import org.jboss.webbeans.test.beans.Cod;
import org.jboss.webbeans.test.beans.FishFarm;
-import org.jboss.webbeans.test.beans.Plaice;
import org.jboss.webbeans.test.beans.Salmon;
import org.jboss.webbeans.test.beans.ScottishFish;
import org.jboss.webbeans.test.beans.Sole;
import org.jboss.webbeans.test.beans.Tuna;
+import org.jboss.webbeans.test.beans.broken.FinalTuna;
import org.jboss.webbeans.test.beans.broken.ParameterizedBean;
-import org.jboss.webbeans.test.beans.broken.PlaiceFarm;
import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
import org.testng.annotations.Test;
@@ -98,11 +97,10 @@
@Test(expectedExceptions=UnproxyableDependencyException.class)
@SpecAssertion(section="5.9")
public void testUnproxyableDependencies() throws Exception
{
- AnnotatedField<Plaice> plaiceField = new
AnnotatedFieldImpl<Plaice>(PlaiceFarm.class.getDeclaredField("plaice"),
fishFarmClass);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
- manager.addBean(plaiceBean);
+ Bean<FinalTuna> FinalTunaBean = createSimpleBean(FinalTuna.class);
+ manager.addBean(FinalTunaBean);
- manager.getInstanceByType(Plaice.class, new
AnnotationLiteral<Whitefish>(){});
+ manager.getInstanceByType(FinalTuna.class, new
AnnotationLiteral<Whitefish>(){});
}
/*
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FinalTuna.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FinalTuna.java 2008-12-09
15:33:59 UTC (rev 503)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FinalTuna.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -1,12 +0,0 @@
-package org.jboss.webbeans.test.beans;
-
-import javax.webbeans.RequestScoped;
-
-import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-
-@AnotherDeploymentType
-@RequestScoped
-public final class FinalTuna
-{
-
-}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Plaice.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Plaice.java 2008-12-09
15:33:59 UTC (rev 503)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/Plaice.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -1,7 +1,6 @@
package org.jboss.webbeans.test.beans;
import javax.webbeans.Named;
-import javax.webbeans.RequestScoped;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Whitefish;
@@ -9,7 +8,6 @@
@AnotherDeploymentType
@Whitefish
@Named("whitefish")
-@RequestScoped
public final class Plaice implements Animal
{
Copied:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/FinalTuna.java
(from rev 496,
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FinalTuna.java)
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/FinalTuna.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/broken/FinalTuna.java 2008-12-09
15:38:10 UTC (rev 504)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.beans.broken;
+
+import javax.webbeans.RequestScoped;
+
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+
+@AnotherDeploymentType
+@RequestScoped
+public final class FinalTuna
+{
+
+}