tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject tomee git commit: Comment out unused test
Date Thu, 24 Sep 2015 19:29:50 GMT
Repository: tomee
Updated Branches:
  refs/heads/master 41435dc10 -> c6b2044a4


Comment out unused test


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/c6b2044a
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/c6b2044a
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/c6b2044a

Branch: refs/heads/master
Commit: c6b2044a42381ce74b1ebeec99b0508e7c310e85
Parents: 41435dc
Author: andygumbrecht@apache.org <andy.is@gmx.de>
Authored: Thu Sep 24 21:29:37 2015 +0200
Committer: andygumbrecht@apache.org <andy.is@gmx.de>
Committed: Thu Sep 24 21:29:37 2015 +0200

----------------------------------------------------------------------
 examples/cucumber-jvm/pom.xml                   |   5 +
 examples/deltaspike-fullstack/pom.xml           |   6 +-
 .../deltaspike/test/MockedPageBeanTest.java     | 199 +++++++++----------
 3 files changed, 107 insertions(+), 103 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/c6b2044a/examples/cucumber-jvm/pom.xml
----------------------------------------------------------------------
diff --git a/examples/cucumber-jvm/pom.xml b/examples/cucumber-jvm/pom.xml
index 8555603..3d448e0 100644
--- a/examples/cucumber-jvm/pom.xml
+++ b/examples/cucumber-jvm/pom.xml
@@ -19,15 +19,19 @@
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
   <modelVersion>4.0.0</modelVersion>
+
   <groupId>org.superbiz</groupId>
   <artifactId>cucumber-jvm</artifactId>
   <packaging>jar</packaging>
   <version>1.1.0-SNAPSHOT</version>
   <name>OpenEJB :: Examples :: Cucumber JVM</name>
+
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
+
   <build>
     <defaultGoal>install</defaultGoal>
     <plugins>
@@ -42,6 +46,7 @@
       </plugin>
     </plugins>
   </build>
+
   <repositories>
     <repository>
       <id>apache-m2-snapshot</id>

http://git-wip-us.apache.org/repos/asf/tomee/blob/c6b2044a/examples/deltaspike-fullstack/pom.xml
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/pom.xml b/examples/deltaspike-fullstack/pom.xml
index 66ac2e8..0fd41cf 100644
--- a/examples/deltaspike-fullstack/pom.xml
+++ b/examples/deltaspike-fullstack/pom.xml
@@ -22,8 +22,8 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 
-    <version.myfaces2>2.2.5</version.myfaces2>
-    <version.deltaspike>1.0.1</version.deltaspike>
+    <version.myfaces2>2.2.7</version.myfaces2>
+    <version.deltaspike>1.3.0</version.deltaspike>
     <version.extval>2.0.8</version.extval>
     <version.openejb>7.0.0-SNAPSHOT</version.openejb>
     <version.tomee>7.0.0-SNAPSHOT</version.tomee>
@@ -162,7 +162,7 @@
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
-      <version>1.7.7</version>
+      <version>1.7.10</version>
       <scope>provided</scope>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/tomee/blob/c6b2044a/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/MockedPageBeanTest.java
----------------------------------------------------------------------
diff --git a/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/MockedPageBeanTest.java
b/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/MockedPageBeanTest.java
index 5cd51bb..72632f9 100644
--- a/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/MockedPageBeanTest.java
+++ b/examples/deltaspike-fullstack/src/test/java/org/superbiz/deltaspike/test/MockedPageBeanTest.java
@@ -1,100 +1,99 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.superbiz.deltaspike.test;
-
-import org.apache.deltaspike.core.spi.scope.window.WindowContext;
-import org.apache.deltaspike.data.api.AbstractEntityRepository;
-import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
-import org.apache.deltaspike.testcontrol.api.mock.DynamicMockManager;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.superbiz.deltaspike.WebappMessageBundle;
-import org.superbiz.deltaspike.domain.User;
-import org.superbiz.deltaspike.repository.UserRepository;
-import org.superbiz.deltaspike.view.RegistrationPage;
-import org.superbiz.deltaspike.view.config.Pages;
-
-import javax.faces.context.FacesContext;
-import javax.inject.Inject;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-@RunWith(CdiTestRunner.class)
-public class MockedPageBeanTest
-{
-    @Inject
-    private RegistrationPage registrationPage; //will use a the mocked UserRepository
-
-    @Inject
-    private WindowContext windowContext;
-
-    @Inject
-    private WebappMessageBundle webappMessageBundle;
-
-    @Inject
-    private DynamicMockManager mockManager;
-
-    @Inject
-    private UserRepository userRepository; //will inject the mocked instance
-
-    @Test
-    @Ignore("doesn't work cause DS can't mock dynamic reositories")
-    public void saveUserWithMockedBean()
-    {
-        final String userName = "gp";
-        final String firstName = "Gerhard";
-        final String lastName = "Petracek";
-
-        // mockito doesn't support interfaces...seriously? but you can mock CDI impl
-        // here we don't have one so implementing for the test the interface
-        UserRepository mockedUserRepository = (UserRepository) Proxy.newProxyInstance(
-                Thread.currentThread().getContextClassLoader(),
-                new Class<?>[]{ UserRepository.class},
-                new InvocationHandler() {
-                    @Override
-                    public Object invoke(Object proxy, Method method, Object[] args) throws
Throwable {
-                        return new User(userName, firstName, lastName.toUpperCase() /*just
to illustrate that the mock-instance is used*/);
-                    }
-                });
-        mockManager.addMock(mockedUserRepository);
-
-
-        this.windowContext.activateWindow("testWindow");
-
-        this.registrationPage.getUser().setUserName(userName);
-        this.registrationPage.getUser().setFirstName(firstName);
-        this.registrationPage.getUser().setLastName(lastName);
-        this.registrationPage.getUser().setPassword("123");
-
-        Class<? extends Pages> targetPage = this.registrationPage.register();
-
-        Assert.assertEquals(Pages.Login.class, targetPage);
-        Assert.assertFalse(FacesContext.getCurrentInstance().getMessageList().isEmpty());
-        Assert.assertEquals(webappMessageBundle.msgUserRegistered(userName), FacesContext.getCurrentInstance().getMessageList().iterator().next().getSummary());
-
-        User user = this.userRepository.findByUserName(userName);
-        Assert.assertNotNull(user);
-        Assert.assertEquals(firstName, user.getFirstName());
-        Assert.assertEquals(lastName.toUpperCase(), user.getLastName());
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.test;
+
+import org.apache.deltaspike.cdise.api.ContextControl;
+import org.apache.deltaspike.core.spi.scope.window.WindowContext;
+import org.apache.deltaspike.testcontrol.api.mock.DynamicMockManager;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.superbiz.deltaspike.WebappMessageBundle;
+import org.superbiz.deltaspike.domain.User;
+import org.superbiz.deltaspike.repository.UserRepository;
+import org.superbiz.deltaspike.view.RegistrationPage;
+import org.superbiz.deltaspike.view.config.Pages;
+
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+//@RunWith(CdiTestRunner.class)
+public class MockedPageBeanTest {
+
+    @Inject
+    private RegistrationPage registrationPage; //will use a the mocked UserRepository
+
+    @Inject
+    private WindowContext windowContext;
+
+    @Inject
+    private WebappMessageBundle webappMessageBundle;
+
+    @Inject
+    private DynamicMockManager mockManager;
+
+    @Inject
+    private UserRepository userRepository; //will inject the mocked instance
+
+    @Inject
+    private ContextControl contextControl;
+
+    @Ignore("Does no work because DS cannot mock dynamic repositories")
+    @Test
+    public void saveUserWithMockedBean() {
+        final String userName = "gp";
+        final String firstName = "Gerhard";
+        final String lastName = "Petracek";
+
+        // mockito doesn't support interfaces...seriously? but you can mock CDI impl
+        // here we don't have one so implementing for the test the interface
+        final UserRepository mockedUserRepository = (UserRepository) Proxy.newProxyInstance(
+                Thread.currentThread().getContextClassLoader(),
+                new Class<?>[]{UserRepository.class},
+                new InvocationHandler() {
+                    @Override
+                    public Object invoke(final Object proxy, final Method method, final Object[]
args) throws Throwable {
+                        return new User(userName, firstName, lastName.toUpperCase() /*just
to illustrate that the mock-instance is used*/);
+                    }
+                });
+        mockManager.addMock(mockedUserRepository);
+
+
+        this.windowContext.activateWindow("testWindow");
+
+        this.registrationPage.getUser().setUserName(userName);
+        this.registrationPage.getUser().setFirstName(firstName);
+        this.registrationPage.getUser().setLastName(lastName);
+        this.registrationPage.getUser().setPassword("123");
+
+        final Class<? extends Pages> targetPage = this.registrationPage.register();
+
+        Assert.assertEquals(Pages.Login.class, targetPage);
+        Assert.assertFalse(FacesContext.getCurrentInstance().getMessageList().isEmpty());
+        Assert.assertEquals(webappMessageBundle.msgUserRegistered(userName), FacesContext.getCurrentInstance().getMessageList().iterator().next().getSummary());
+
+        final User user = this.userRepository.findByUserName(userName);
+        Assert.assertNotNull(user);
+        Assert.assertEquals(firstName, user.getFirstName());
+        Assert.assertEquals(lastName.toUpperCase(), user.getLastName());
+    }
+}


Mime
View raw message