Author: shane.bryzak(a)jboss.com
Date: 2008-05-20 23:47:56 -0400 (Tue, 20 May 2008)
New Revision: 8241
Modified:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ProfileAction.java
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/RegisterAction.java
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/BlogTest.java
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/RegisterTest.java
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/testng.xml
Log:
fixed warnings, re-enabled tests
Modified:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ProfileAction.java
===================================================================
---
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ProfileAction.java 2008-05-21
03:47:34 UTC (rev 8240)
+++
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/ProfileAction.java 2008-05-21
03:47:56 UTC (rev 8241)
@@ -10,7 +10,6 @@
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
-import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
@@ -33,10 +32,10 @@
private Member authenticatedMember;
@Out(required = false)
- List newMembers;
+ List<Member> newMembers;
@Out(required = false)
- List memberBlogs;
+ List<MemberBlog> memberBlogs;
@In
private EntityManager entityManager;
@@ -65,7 +64,8 @@
/**
* Returns the 5 latest blog entries for a member
*/
- public List getLatestBlogs()
+ @SuppressWarnings("unchecked")
+ public List<MemberBlog> getLatestBlogs()
{
return entityManager.createQuery(
"from MemberBlog b where b.member = :member order by b.entryDate
desc")
@@ -77,6 +77,7 @@
/**
* Used to read all blog entries for a member
*/
+ @SuppressWarnings("unchecked")
@Factory("memberBlogs")
public void getMemberBlogs()
{
@@ -91,6 +92,7 @@
.getResultList();
}
+ @SuppressWarnings("unchecked")
@Factory("newMembers")
public void newMembers()
{
@@ -107,7 +109,8 @@
}
}
- public List getFriends()
+ @SuppressWarnings("unchecked")
+ public List<Member> getFriends()
{
return entityManager.createQuery(
"select f.friend from MemberFriend f where f.member = :member and
authorized = true")
@@ -115,7 +118,8 @@
.getResultList();
}
- public List getFriendComments()
+ @SuppressWarnings("unchecked")
+ public List<FriendComment> getFriendComments()
{
return entityManager.createQuery(
"from FriendComment c where c.member = :member order by commentDate
desc")
Modified:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/RegisterAction.java
===================================================================
---
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/RegisterAction.java 2008-05-21
03:47:34 UTC (rev 8240)
+++
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/RegisterAction.java 2008-05-21
03:47:56 UTC (rev 8241)
@@ -103,16 +103,12 @@
entityManager.persist(newMember);
new RunAsOperation() {
- @Override
- public String[] getRoles() {
- return new String[] { "admin" };
- }
-
public void execute() {
identityManager.createUser(username, password);
identityManager.grantRole(username, "user");
}
- }.run();
+ }.addRole("admin")
+ .run();
newAccount.setMember(newMember);
newAccount = entityManager.merge(newAccount);
Modified:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/BlogTest.java
===================================================================
---
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/BlogTest.java 2008-05-21
03:47:34 UTC (rev 8240)
+++
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/BlogTest.java 2008-05-21
03:47:56 UTC (rev 8241)
@@ -5,7 +5,7 @@
public class BlogTest extends SeamTest
{
- //@Test
+ @Test
public void testCreateBlog() throws Exception
{
// Log in first
Modified:
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/RegisterTest.java
===================================================================
---
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/RegisterTest.java 2008-05-21
03:47:34 UTC (rev 8240)
+++
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/RegisterTest.java 2008-05-21
03:47:56 UTC (rev 8241)
@@ -8,7 +8,7 @@
public class RegisterTest extends SeamTest
{
- //@Test
+ @Test
public void testRegister() throws Exception
{
String cid = new FacesRequest()
Modified: trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/testng.xml
===================================================================
---
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/testng.xml 2008-05-21
03:47:34 UTC (rev 8240)
+++
trunk/examples/seamspace/src/org/jboss/seam/example/seamspace/test/testng.xml 2008-05-21
03:47:56 UTC (rev 8241)
@@ -2,7 +2,7 @@
<suite name="SeamSpace" verbose="2"
parallel="false">
- <!--test name="SeamSpace: Register">
+ <test name="SeamSpace: Register">
<classes>
<class
name="org.jboss.seam.example.seamspace.test.RegisterTest"/>
</classes>
@@ -12,6 +12,6 @@
<classes>
<class name="org.jboss.seam.example.seamspace.test.BlogTest"/>
</classes>
- </test-->
+ </test>
</suite>
\ No newline at end of file
Show replies by date