Author: akazakov
Date: 2010-04-09 11:05:28 -0400 (Fri, 09 Apr 2010)
New Revision: 21400
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Game.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Generator.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/HomePage.xhtml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/MaxNumber.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Random.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/index.jsp
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/resources/
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/refactoring/
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NamedBeanRefactoringTest.java
Log:
Moved CDI Refactoring test project resources to jbt package.
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Game.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Game.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Game.java 2010-04-09
15:05:28 UTC (rev 21400)
@@ -0,0 +1,97 @@
+package org.jboss.jsr299.tck.tests.jbt.refactoring;
+
+import java.io.Serializable;
+
+//import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.naming.NamingException;
+
+@SessionScoped
+@Named
+public class Game implements Serializable
+{
+ private static final long serialVersionUID = 12L;
+
+ @Named("myInner")
+ public static class MyInner {
+
+ }
+ private int number;
+ private int guess;
+ private int smallest;
+ private int biggest;
+ private int remainingGuesses;
+
+ @Inject @MaxNumber private int maxNumber;
+
+ @Inject private int[] maxNumber2;
+
+ @Inject Generator[] generator;
+
+ @Inject @Random Instance<Integer> randomNumber;
+
+ public Game() throws NamingException {}
+
+ public int getNumber()
+ {
+ return number + 9;
+ }
+
+ public int getGuess()
+ {
+ return guess;
+ }
+
+ public void setGuess(int guess)
+ {
+ String s = "#{another.kkk}";
+ this.guess = guess;
+ }
+
+ public int getSmallest()
+ {
+ return smallest;
+ }
+
+ public int getBiggest()
+ {
+ return biggest;
+ }
+
+ public int getRemainingGuesses()
+ {
+ return remainingGuesses;
+ }
+
+ public boolean check()
+ {
+ if (guess>number)
+ {
+ biggest = guess - 1;
+ }
+ if (guess<number)
+ {
+ smallest = guess + 1;
+ }
+ remainingGuesses--;
+ return (guess == number);
+ }
+
+// @PostConstruct
+ public void reset()
+ {
+ this.smallest = 0;
+ this.guess = 0;
+ this.remainingGuesses = 10;
+ this.biggest = maxNumber;
+ this.number = randomNumber.get();
+ }
+}
+
+@Named("myLocal")
+class MyLocal {
+
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Game.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Generator.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Generator.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Generator.java 2010-04-09
15:05:28 UTC (rev 21400)
@@ -0,0 +1,38 @@
+package org.jboss.jsr299.tck.tests.jbt.refactoring;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Named;
+
+@ApplicationScoped
+public class Generator implements Serializable
+{
+ private static final long serialVersionUID = -7213673465118041882L;
+
+ private java.util.Random random = new java.util.Random(System.currentTimeMillis());
+
+ private int maxNumber = 100;
+
+ java.util.Random getRandom()
+ {
+ String s = "#{game}";
+ return random;
+ }
+
+ @Produces @Random int next()
+ {
+ return getRandom().nextInt(maxNumber);
+ }
+
+ @Produces @MaxNumber int getMaxNumber()
+ {
+ return maxNumber;
+ }
+}
+
+@Named("another")
+class AnotherOne {
+
+}
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Generator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/HomePage.xhtml
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/HomePage.xhtml
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/HomePage.xhtml 2010-04-09
15:05:28 UTC (rev 21400)
@@ -0,0 +1,28 @@
+<html
xmlns:h="http://java.sun.com/jsf/html">
+ <head>
+ <title>Wicket Weld example</title>
+ </head>
+ <body>
+ <h1>Guess a number...</h1>
+ <form wicket:id="NumberGuessMain">
+ <div style="color: red">
+ <span wicket:id="messages#{myInner}"/>
+ </div>
+
+ <div wicket:id="prompt">
+ I'm thinking of a number between 0 and 100. You have 10 guesses.
+ </div>
+
+ <div>
+ <span wicket:id="guessLabel">Your guess:</span>
+ <input wicket:id="inputGuess" type="text"
size="3"/>
+ <input wicket:id="GuessButton" type="submit"
value="Guess"/>
+ <input wicket:id="RestartButton" type="submit"
value="Reset"/>
+ <h:commandButton id="GuessButton" value="Guess"
action="#{game.check}" disabled="false"/>
+ </div>
+ <div>
+ <h:commandButton id="RestartButton" value="Reset"
action="#{game.reset}" immediate="true"/>
+ </div>
+ </form>
+ </body>
+</html>
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/HomePage.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/MaxNumber.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/MaxNumber.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/MaxNumber.java 2010-04-09
15:05:28 UTC (rev 21400)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.jbt.refactoring;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface MaxNumber
+{
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/MaxNumber.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Random.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Random.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Random.java 2010-04-09
15:05:28 UTC (rev 21400)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.jbt.refactoring;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+public @interface Random
+{
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/Random.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/index.jsp
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/index.jsp
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/index.jsp 2010-04-09
15:05:28 UTC (rev 21400)
@@ -0,0 +1,19 @@
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+
+<f:loadBundle var="Message" basename="demo.Messages" />
+
+<html>
+ <head>
+ <title>Hello!</title>
+ </head>
+
+ <body>
+ <f:view>
+ <h3>
+ <h:outputText value="#{game.biggest}" />!
+ </h3>
+ </f:view>
+ </body>
+
+</html>
\ No newline at end of file
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/refactoring/index.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NamedBeanRefactoringTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NamedBeanRefactoringTest.java 2010-04-09
14:01:58 UTC (rev 21399)
+++
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/NamedBeanRefactoringTest.java 2010-04-09
15:05:28 UTC (rev 21400)
@@ -17,9 +17,9 @@
import org.jboss.tools.tests.AbstractRefactorTest;
public class NamedBeanRefactoringTest extends AbstractRefactorTest {
- private static final String PROJECT_NAME = "/tests/refactoring";
- private static final String FILE_NAME1 =
"JavaSource/org/jboss/jsr299/tck/tests/refactoring/Game.java";
- private static final String FILE_NAME2 =
"JavaSource/org/jboss/jsr299/tck/tests/refactoring/Generator.java";
+ private static final String PROJECT_NAME = "/tests/jbt/refactoring";
+ private static final String FILE_NAME1 =
"JavaSource/org/jboss/jsr299/tck/tests/jbt/refactoring/Game.java";
+ private static final String FILE_NAME2 =
"JavaSource/org/jboss/jsr299/tck/tests/jbt/refactoring/Generator.java";
private static final String FILE_NAME3 = "WebContent/HomePage.xhtml";
private static final String FILE_NAME4 = "WebContent/index.jsp";
static IProject project;
@@ -44,12 +44,12 @@
TestChangeStructure structure = new TestChangeStructure(project
.getProject(), FILE_NAME1);
- TestTextChange change = new TestTextChange(324, 4, newName);
+ TestTextChange change = new TestTextChange(328, 4, newName);
structure.addTextChange(change);
list.add(structure);
structure = new TestChangeStructure(project, FILE_NAME2);
- change = new TestTextChange(522, 4, newName);
+ change = new TestTextChange(526, 4, newName);
structure.addTextChange(change);
list.add(structure);