Author: Alex.Kolonitsky
Date: 2010-03-12 08:31:06 -0500 (Fri, 12 Mar 2010)
New Revision: 16568
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java
Log:
fix test for tag handler class generator
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java 2010-03-12
13:16:30 UTC (rev 16567)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java 2010-03-12
13:31:06 UTC (rev 16568)
@@ -23,17 +23,12 @@
package org.richfaces.cdk.generate.java;
-import static org.easymock.EasyMock.*;
-
-import java.io.StringWriter;
-import java.util.Set;
-
-import javax.faces.component.UIOutput;
-import javax.faces.el.ValueBinding;
-import javax.faces.el.MethodBinding;
-import javax.el.ValueExpression;
-import javax.el.MethodExpression;
-
+import com.google.inject.Inject;
+import static org.easymock.EasyMock.anyInt;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.CdkTestRunner;
@@ -43,7 +38,11 @@
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.Property;
-import com.google.inject.Inject;
+import javax.el.MethodExpression;
+import javax.faces.component.UIOutput;
+import javax.faces.el.MethodBinding;
+import java.io.StringWriter;
+import java.util.Set;
/**
* <p class="changed_added_4_0">
@@ -100,10 +99,13 @@
attribute = component.getOrCreateAttribute("testBinding");
attribute.setType(new ClassName(MethodBinding.class));
attribute.setGenerate(true);
+ attribute.setBinding(true);
+ attribute.setBindingAttribute(true);
attribute = component.getOrCreateAttribute("testExpr");
attribute.setType(new ClassName(MethodExpression.class));
attribute.setGenerate(true);
+ attribute.setBindingAttribute(true);
attribute = component.getOrCreateAttribute("id");
attribute.setType(new ClassName(String.class));
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java 2010-03-12
13:16:30 UTC (rev 16567)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/TagHandlerClassGeneratorTest.java 2010-03-12
13:31:06 UTC (rev 16568)
@@ -22,16 +22,12 @@
package org.richfaces.cdk.generate.java;
+import com.google.inject.Inject;
import static org.easymock.EasyMock.anyInt;
import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
-
-import java.io.StringWriter;
-
-import javax.faces.view.facelets.ComponentHandler;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.CdkTestRunner;
@@ -43,7 +39,8 @@
import org.richfaces.cdk.model.TagModel;
import org.richfaces.cdk.model.validator.ValidatorImpl;
-import com.google.inject.Inject;
+import javax.faces.view.facelets.ComponentHandler;
+import java.io.StringWriter;
/**
* @author akolonitsky
@@ -52,15 +49,9 @@
@RunWith(CdkTestRunner.class)
public class TagHandlerClassGeneratorTest extends AbstractClassGeneratorTest {
- @Mock
- private NamingConventions namiingConventions;
-
@Inject
private TagHandlerClassGenerator generator;
- @Inject
- private ValidatorImpl validator;
-
@Test
public void testGetOutputFileBehavior() throws Exception {
final StringWriter outputWriter = new StringWriter();
@@ -77,12 +68,9 @@
tagModel.setTargetClass(ClassName.parseName("org.richfaces.cdk.generate.java.GeneratedTagHandler"));
tagModel.setBaseClass(ClassName.parseName(ComponentHandler.class.getName()));
- //TODO nick - review
- validator.verify();
-
generator.process(tagModel);
-// System.out.println(outputWriter);
+ System.out.println(outputWriter);
verify(output);
compare(outputWriter, "GeneratedTagHandler.java");
Show replies by date