Author: DartPeng
Date: 2009-01-14 00:43:36 -0500 (Wed, 14 Jan 2009)
New Revision: 13027
Added:
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/A.java
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/JavaSelectorTestCase.java
Log:
JBIDE-3479
Add a new test case for testing local the Javabean with "selector"
Added:
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/A.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/A.java
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/A.java 2009-01-14
05:43:36 UTC (rev 13027)
@@ -0,0 +1,33 @@
+package org.jboss.tools.smooks.test.java;
+
+public class A {
+ private A a;
+
+ private String name;
+
+ private int integer;
+
+ public A getA() {
+ return a;
+ }
+
+ public void setA(A a) {
+ this.a = a;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getInteger() {
+ return integer;
+ }
+
+ public void setInteger(int integer) {
+ this.integer = integer;
+ }
+}
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/A.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/JavaSelectorTestCase.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/JavaSelectorTestCase.java
(rev 0)
+++
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/JavaSelectorTestCase.java 2009-01-14
05:43:36 UTC (rev 13027)
@@ -0,0 +1,41 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.test.java;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.jboss.tools.smooks.javabean.analyzer.JavaBeanAnalyzer;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModelFactory;
+
+/**
+ * @author Dart
+ *
+ */
+public class JavaSelectorTestCase extends TestCase {
+ public void testLocalJavaBean() {
+ localJavabean(" ");
+ }
+
+ public void localJavabean(String sperator) {
+ JavaBeanModel model = JavaBeanModelFactory
+ .getJavaBeanModelWithLazyLoad(A.class);
+
+ JavaBeanModel aModel = JavaBeanAnalyzer.localJavaBeanModelWithSelector(
+ "a", model);
+ Assert.assertNotNull(aModel);
+ Assert.assertEquals(aModel.getBeanClass(), A.class);
+
+ JavaBeanModel nullModel = JavaBeanAnalyzer
+ .localJavaBeanModelWithSelectorWithoutException("a" + sperator
+ + "null", model);
+ Assert.assertNull(nullModel);
+
+ // avoid died loop
+ nullModel = JavaBeanAnalyzer
+ .localJavaBeanModelWithSelectorWithoutException("null", model);
+ Assert.assertNull(nullModel);
+ }
+}
Property changes on:
trunk/smooks/tests/org.jboss.tools.smooks.test/src/org/jboss/tools/smooks/test/java/JavaSelectorTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Show replies by date