On 22 July 2010 21:15, <mben...@apache.org> wrote: > Author: mbenson > Date: Thu Jul 22 20:15:25 2010 > New Revision: 966839 > > URL: http://svn.apache.org/viewvc?rev=966839&view=rev > Log: > add new test module to exercise the defaultProxyFactory > > Added: > commons/proper/proxy/branches/version-2.0-work/test/ (with props) > commons/proper/proxy/branches/version-2.0-work/test/pom.xml
Needs svn:eol-style native > commons/proper/proxy/branches/version-2.0-work/test/src/ > commons/proper/proxy/branches/version-2.0-work/test/src/main/ > commons/proper/proxy/branches/version-2.0-work/test/src/main/java/ > commons/proper/proxy/branches/version-2.0-work/test/src/test/ > commons/proper/proxy/branches/version-2.0-work/test/src/test/java/ > commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/ > > commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/ > > commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/ > > commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy/ > > commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy/DefaultProxyFactoryTest.java Needs svn:eol-style native > Modified: > commons/proper/proxy/branches/version-2.0-work/pom.xml > > Modified: commons/proper/proxy/branches/version-2.0-work/pom.xml > URL: > http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/pom.xml?rev=966839&r1=966838&r2=966839&view=diff > ============================================================================== > --- commons/proper/proxy/branches/version-2.0-work/pom.xml (original) > +++ commons/proper/proxy/branches/version-2.0-work/pom.xml Thu Jul 22 > 20:15:25 2010 > @@ -26,6 +26,7 @@ > <module>jdk</module> > <module>javassist</module> > <module>cglib</module> > + <module>test</module> > </modules> > <parent> > <groupId>org.apache.commons</groupId> > > Propchange: commons/proper/proxy/branches/version-2.0-work/test/ > ------------------------------------------------------------------------------ > --- svn:ignore (added) > +++ svn:ignore Thu Jul 22 20:15:25 2010 > @@ -0,0 +1,4 @@ > +.classpath > +.project > +.settings > +target > > Added: commons/proper/proxy/branches/version-2.0-work/test/pom.xml > URL: > http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/test/pom.xml?rev=966839&view=auto > ============================================================================== > --- commons/proper/proxy/branches/version-2.0-work/test/pom.xml (added) > +++ commons/proper/proxy/branches/version-2.0-work/test/pom.xml Thu Jul 22 > 20:15:25 2010 > @@ -0,0 +1,60 @@ > +<?xml version="1.0" encoding="UTF-8"?> > + <!-- > + ~ 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. > + --> > + > +<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/xsd/maven-4.0.0.xsd"> > + <parent> > + <artifactId>commons-proxy-parent</artifactId> > + <groupId>org.apache.commons</groupId> > + <version>2.0-SNAPSHOT</version> > + </parent> > + <modelVersion>4.0.0</modelVersion> > + <artifactId>commons-proxy-test</artifactId> > + <name>Commons Proxy Test</name> > + <description>Tests things that depend on multiple modules</description> > + <dependencies> > + <dependency> > + <groupId>junit</groupId> > + <artifactId>junit</artifactId> > + <version>4.8.1</version> > + <scope>test</scope> > + </dependency> > + <dependency> > + <groupId>${project.groupId}</groupId> > + <artifactId>commons-proxy-jdk</artifactId> > + <version>${project.version}</version> > + <scope>test</scope> > + </dependency> > + <dependency> > + <groupId>${project.groupId}</groupId> > + <artifactId>commons-proxy-cglib</artifactId> > + <version>${project.version}</version> > + <scope>test</scope> > + </dependency> > + <dependency> > + <groupId>cglib</groupId> > + <artifactId>cglib-nodep</artifactId> > + <version>2.1_3</version> > + <scope>test</scope> > + </dependency> > + <dependency> > + <groupId>${project.groupId}</groupId> > + <artifactId>commons-proxy-javassist</artifactId> > + <version>${project.version}</version> > + <scope>test</scope> > + </dependency> > + </dependencies> > +</project> > > Added: > commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy/DefaultProxyFactoryTest.java > URL: > http://svn.apache.org/viewvc/commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy/DefaultProxyFactoryTest.java?rev=966839&view=auto > ============================================================================== > --- > commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy/DefaultProxyFactoryTest.java > (added) > +++ > commons/proper/proxy/branches/version-2.0-work/test/src/test/java/org/apache/commons/proxy/DefaultProxyFactoryTest.java > Thu Jul 22 20:15:25 2010 > @@ -0,0 +1,52 @@ > +package org.apache.commons.proxy; > + > +import static org.junit.Assert.*; > + > +import java.lang.reflect.Proxy; > + > +import org.apache.commons.proxy2.ProxyFactory; > +import org.apache.commons.proxy2.ProxyUtils; > +import org.apache.commons.proxy2.invoker.NullInvoker; > +import org.junit.Before; > +import org.junit.Test; > + > +/** > + * Test the default ProxyFactory provided by {...@link ProxyUtils}. > + */ > +public class DefaultProxyFactoryTest { > + private ProxyFactory proxyFactory; > + > + �...@before > + public void setUp() { > + proxyFactory = ProxyUtils.proxyFactory(); > + } > + > + �...@test > + public void testBasic() { > + Foo foo = proxyFactory.createInvokerProxy(NullInvoker.INSTANCE, > + Foo.class); > + assertNotNull(foo); > + assertTrue(foo instanceof Proxy); > + } > + > + �...@test > + public void testSubclassing() { > + Bar bar = proxyFactory.createInvokerProxy(NullInvoker.INSTANCE, > + Bar.class); > + assertNotNull(bar); > + } > + > + �...@test > + public void testCombined() { > + Bar bar = proxyFactory.createInvokerProxy(NullInvoker.INSTANCE, > + Bar.class, Foo.class); > + assertNotNull(bar); > + assertTrue(bar instanceof Foo); > + } > + > + public interface Foo { > + } > + > + public static class Bar { > + } > +} > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org