fixing test after flush JMX addition
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/afb44f7a Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/afb44f7a Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/afb44f7a Branch: refs/heads/tomee-1.7.x Commit: afb44f7adeb9aa2c8f8411a007ce36a949f6e1c5 Parents: 4f00d26 Author: Romain manni-Bucau <rmannibu...@gmail.com> Authored: Fri Apr 29 18:53:13 2016 +0200 Committer: Jonathan Gallimore <j...@jrg.me.uk> Committed: Tue Jul 12 11:48:56 2016 +0100 ---------------------------------------------------------------------- .../core/stateless/StatelessPoolStatsTest.java | 1 + .../org/superbiz/eclipselink/MoviesTest.java | 54 ++++++++++++++++++++ 2 files changed, 55 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/afb44f7a/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessPoolStatsTest.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessPoolStatsTest.java b/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessPoolStatsTest.java index 70539b2..3e25f43 100644 --- a/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessPoolStatsTest.java +++ b/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessPoolStatsTest.java @@ -197,6 +197,7 @@ public class StatelessPoolStatsTest extends TestCase { "FilterAttributes", "Filters the attributes that show up in the MBeanInfo. The exclude is applied first, then any attributes that match the include are re-added. It may be required to disconnect and reconnect the JMX console to force a refresh of the MBeanInfo", operations, "void", MBeanOperationInfo.UNKNOWN)); + expectedOperations.add(new MBeanOperationInfo("flush", "", new MBeanParameterInfo[0], "void", MBeanOperationInfo.UNKNOWN)); final List<MBeanOperationInfo> actualOperations = new ArrayList<MBeanOperationInfo>(); actualOperations.addAll(Arrays.asList(poolMBeanInfo.getOperations())); http://git-wip-us.apache.org/repos/asf/tomee/blob/afb44f7a/examples/jpa-eclipselink/srcstest/java/org/superbiz/eclipselink/MoviesTest.java ---------------------------------------------------------------------- diff --git a/examples/jpa-eclipselink/srcstest/java/org/superbiz/eclipselink/MoviesTest.java b/examples/jpa-eclipselink/srcstest/java/org/superbiz/eclipselink/MoviesTest.java new file mode 100644 index 0000000..f661b2d --- /dev/null +++ b/examples/jpa-eclipselink/srcstest/java/org/superbiz/eclipselink/MoviesTest.java @@ -0,0 +1,54 @@ +/** + * 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 + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * 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.eclipselink; + +import junit.framework.TestCase; + +import javax.ejb.embeddable.EJBContainer; +import javax.naming.Context; +import java.util.List; +import java.util.Properties; + +/** + * @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $ + */ +public class MoviesTest extends TestCase { + + public void test() throws Exception { + Properties p = new Properties(); + p.put("movieDatabase", "new://Resource?type=DataSource"); + p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver"); + p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb"); + + final Context context = EJBContainer.createEJBContainer(p).getContext(); + + Movies movies = (Movies) context.lookup("java:global/jpa-eclipselink/Movies"); + + movies.addMovie(new Movie("Quentin Tarantino", "Reservoir Dogs", 1992)); + movies.addMovie(new Movie("Joel Coen", "Fargo", 1996)); + movies.addMovie(new Movie("Joel Coen", "The Big Lebowski", 1998)); + + List<Movie> list = movies.getMovies(); + assertEquals("List.size()", 3, list.size()); + + for (Movie movie : list) { + movies.deleteMovie(movie); + } + + assertEquals("Movies.getMovies()", 0, movies.getMovies().size()); + } +}