aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authornickl- <github@jigsoft.co.za>2017-10-29 23:42:49 +0200
committernickl- <github@jigsoft.co.za>2017-11-12 23:52:01 +0200
commit53325f5637042322f1b810ad32c8ee3bad2915f4 (patch)
treed5153092d9a968d3f6e7c9ae912c0df036959c03 /src/test
parente1f0bba5de4dc03a9debfab333683f07cfbcb594 (diff)
downloadjavassist-53325f5637042322f1b810ad32c8ee3bad2915f4.tar.gz
javassist-53325f5637042322f1b810ad32c8ee3bad2915f4.zip
Fixes to javassist.scopepool
Applied parameters and squashed all compiler warnings. Changed loops to enhanced for where appropriate. Fixed SoftValueHashMap: Made it a raw type. Overwritten implementation of the `get` method correctly unwrapped the reference but the methods `containsValue` and `entrySet` needed to be fixed. Implemented the remaining outstanding methods from the `java.util.Map` contract `values`, `putAll` and `keySet`. Dropped `AbstractMap` inheritance as we were not inheriting anything anymore. Changed internal map to `ConcurrentHashMap' to be atomic and parallel safe. Found original unit tests from jboss retro which are now updated to reflect the javassist versions of the scoped pool classes. Added tests for the SoftValueHashMap including test which overloads the heap to ensure the cache cleans itself appropriately.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/scoped/ScopedRepositoryTestCase.java242
-rw-r--r--src/test/scoped/TestAnnotation.java34
-rw-r--r--src/test/scoped/UnscopedAnnotationDefaultUsage.java29
-rw-r--r--src/test/scoped/UnscopedAnnotationUsage.java29
-rw-r--r--src/test/scoped/jar1/FullyScopedAnnotationDefaultUsage.java29
-rw-r--r--src/test/scoped/jar1/FullyScopedAnnotationUsage.java29
-rw-r--r--src/test/scoped/jar1/ScopedAnnotationDefaultUsage.java31
-rw-r--r--src/test/scoped/jar1/ScopedAnnotationUsage.java31
-rw-r--r--src/test/scoped/jar1/ScopedTestAnnotation.java34
-rw-r--r--src/test/scoped/jar1/TestClass1.java26
10 files changed, 514 insertions, 0 deletions
diff --git a/src/test/scoped/ScopedRepositoryTestCase.java b/src/test/scoped/ScopedRepositoryTestCase.java
new file mode 100644
index 00000000..9dca4f56
--- /dev/null
+++ b/src/test/scoped/ScopedRepositoryTestCase.java
@@ -0,0 +1,242 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped;
+
+import java.io.File;
+import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.stream.LongStream;
+
+import javassist.ClassPool;
+import javassist.CtClass;
+import javassist.CtConstructor;
+import javassist.CtField;
+import javassist.CtMethod;
+import javassist.scopedpool.ScopedClassPool;
+import javassist.scopedpool.ScopedClassPoolRepository;
+import javassist.scopedpool.ScopedClassPoolRepositoryImpl;
+import javassist.scopedpool.SoftValueHashMap;
+import junit.framework.TestCase;
+
+
+/**
+ * ScopedRepositoryTest.
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class ScopedRepositoryTestCase extends TestCase
+{
+ private static final ScopedClassPoolRepository repository = ScopedClassPoolRepositoryImpl.getInstance();
+
+ public void testJDKClasses() throws Exception
+ {
+ ClassPool poolClass = repository.findClassPool(Class.class.getClassLoader());
+ assertNotNull(poolClass);
+ ClassPool poolString = repository.findClassPool(String.class.getClassLoader());
+ assertNotNull(poolString);
+ assertEquals(poolClass, poolString);
+ }
+
+ public void testScopedClasses() throws Exception
+ {
+ ClassLoader cl = getURLClassLoader("test-classes14-jar1");
+ ClassPool pool1 = repository.findClassPool(cl);
+ CtClass clazz = pool1.get("scoped.jar1.TestClass1");
+ assertNotNull(clazz);
+ ClassPool poolClass = repository.findClassPool(Class.class.getClassLoader());
+ assertNotNull(poolClass);
+ assertNotSame(pool1, poolClass);
+ }
+
+ public void testUnscopedAnnotationUsage() throws Exception
+ {
+ CtClass clazz = getCtClass(UnscopedAnnotationUsage.class);
+ checkTestAnnotation(clazz, "notDefault");
+ }
+
+ public void testUnscopedAnnotationDefaultUsage() throws Exception
+ {
+ CtClass clazz = getCtClass(UnscopedAnnotationDefaultUsage.class);
+ checkTestAnnotation(clazz, "defaultValue");
+ }
+
+ public void testScopedAnnotationUsage() throws Exception
+ {
+ ClassLoader cl = getURLClassLoader("test-classes14-jar1");
+ CtClass clazz = getCtClass("scoped.jar1.ScopedAnnotationUsage", cl);
+ checkTestAnnotation(clazz, "notDefault");
+ }
+
+ public void testScopedAnnotationDefaultUsage() throws Exception
+ {
+ ClassLoader cl = getURLClassLoader("test-classes14-jar1");
+ CtClass clazz = getCtClass("scoped.jar1.ScopedAnnotationDefaultUsage", cl);
+ checkTestAnnotation(clazz, "defaultValue");
+ }
+
+ public void testFullyScopedAnnotationUsage() throws Exception
+ {
+ ClassLoader cl = getURLClassLoader("test-classes14-jar1");
+ CtClass clazz = getCtClass("scoped.jar1.FullyScopedAnnotationUsage", cl);
+ checkScopedAnnotation(cl, clazz, "notDefault");
+ }
+
+ public void testFullyScopedAnnotationDefaultUsage() throws Exception
+ {
+ ClassLoader cl = getURLClassLoader("test-classes14-jar1");
+ CtClass clazz = getCtClass("scoped.jar1.FullyScopedAnnotationDefaultUsage", cl);
+ checkScopedAnnotation(cl, clazz, "defaultValue");
+ }
+
+ public void testSoftValueHashMap() throws Exception {
+ Map<String,Class<?>> map = new SoftValueHashMap<>();
+ Class<?> cls = this.getClass();
+ assertTrue(map.put(cls.getName(), cls) == null);
+ assertTrue(map.put(cls.getName(), cls) == cls);
+ assertTrue(map.size() == 1);
+ assertTrue(map.get(cls.getName()) == cls);
+ assertTrue(map.values().iterator().next() == cls);
+ assertTrue(map.entrySet().iterator().next().getValue() == cls);
+ assertTrue(map.containsValue(cls));
+ assertTrue(map.remove(cls.getName()) == cls);
+ assertTrue(map.size() == 0);
+ }
+
+ public void testSoftCache() throws Exception {
+ // Overload the heap to test that the map auto cleans
+ Map<String,long[]> map = new SoftValueHashMap<>();
+ // 12+8*30000000 = +- 252 MB
+ long[] data = LongStream.range(0, 30000000).toArray();
+ int current = map.size();
+ while (current <= map.size()) {
+ current = map.size();
+ for (int ii = 0; ii < 5; ii++) {
+ map.put(current+"-"+ii, Arrays.copyOf(data, data.length));
+ }
+ }
+ assertTrue(current > map.size());
+ }
+
+ protected CtClass getCtClass(Class<?> clazz) throws Exception
+ {
+ return getCtClass(clazz.getName(), clazz.getClassLoader());
+ }
+
+ protected CtClass getCtClass(String name, ClassLoader cl) throws Exception
+ {
+ ClassPool pool = repository.findClassPool(cl);
+ assertNotNull(pool);
+ CtClass clazz = pool.get(name);
+ assertNotNull(clazz);
+ return clazz;
+ }
+
+ protected void checkTestAnnotation(CtClass ctClass, String value) throws Exception
+ {
+ checkTestAnnotation(ctClass.getAnnotations(), value);
+ checkTestAnnotation(getFieldAnnotations(ctClass), value);
+ checkTestAnnotation(getConstructorAnnotations(ctClass), value);
+ checkTestAnnotation(getConstructorParameterAnnotations(ctClass), value);
+ checkTestAnnotation(getMethodAnnotations(ctClass), value);
+ checkTestAnnotation(getMethodParameterAnnotations(ctClass), value);
+ }
+
+ protected void checkTestAnnotation(Object[] annotations, String value) throws Exception
+ {
+ assertNotNull(annotations);
+ assertEquals(1, annotations.length);
+ assertNotNull(annotations[0]);
+ assertTrue(annotations[0] instanceof TestAnnotation);
+ TestAnnotation annotation = (TestAnnotation) annotations[0];
+ assertEquals(value, annotation.something());
+ }
+
+ protected void checkScopedAnnotation(ClassLoader cl, CtClass ctClass, String value) throws Exception
+ {
+ Class<?> annotationClass = cl.loadClass("scoped.jar1.ScopedTestAnnotation");
+ checkScopedAnnotation(annotationClass, ctClass.getAnnotations(), value);
+ checkScopedAnnotation(annotationClass, getFieldAnnotations(ctClass), value);
+ checkScopedAnnotation(annotationClass, getConstructorAnnotations(ctClass), value);
+ checkScopedAnnotation(annotationClass, getConstructorParameterAnnotations(ctClass), value);
+ checkScopedAnnotation(annotationClass, getMethodAnnotations(ctClass), value);
+ checkScopedAnnotation(annotationClass, getMethodParameterAnnotations(ctClass), value);
+ }
+
+ protected void checkScopedAnnotation(Class<?> annotationClass, Object[] annotations, String value) throws Exception
+ {
+ assertNotNull(annotations);
+ assertEquals(1, annotations.length);
+ assertNotNull(annotations[0]);
+ assertTrue(annotationClass.isInstance(annotations[0]));
+
+ Method method = annotationClass.getMethod("something", new Class<?>[0]);
+ assertEquals(value, method.invoke(annotations[0], (Object[]) null));
+ }
+
+ protected Object[] getFieldAnnotations(CtClass clazz) throws Exception
+ {
+ CtField field = clazz.getField("aField");
+ assertNotNull(field);
+ return field.getAnnotations();
+ }
+
+ protected Object[] getMethodAnnotations(CtClass clazz) throws Exception
+ {
+ CtMethod method = clazz.getMethod("doSomething", "(I)V");
+ assertNotNull(method);
+ return method.getAnnotations();
+ }
+
+ protected Object[] getMethodParameterAnnotations(CtClass clazz) throws Exception
+ {
+ CtMethod method = clazz.getMethod("doSomething", "(I)V");
+ assertNotNull(method);
+ Object[] paramAnnotations = method.getParameterAnnotations();
+ assertNotNull(paramAnnotations);
+ assertEquals(1, paramAnnotations.length);
+ return (Object[]) paramAnnotations[0];
+ }
+
+ protected Object[] getConstructorAnnotations(CtClass clazz) throws Exception
+ {
+ CtConstructor constructor = clazz.getConstructor("(I)V");
+ assertNotNull(constructor);
+ return constructor.getAnnotations();
+ }
+
+ protected Object[] getConstructorParameterAnnotations(CtClass clazz) throws Exception
+ {
+ CtConstructor constructor = clazz.getConstructor("(I)V");
+ assertNotNull(constructor);
+ Object[] paramAnnotations = constructor.getParameterAnnotations();
+ assertNotNull(paramAnnotations);
+ assertEquals(1, paramAnnotations.length);
+ return (Object[]) paramAnnotations[0];
+ }
+
+ protected ClassLoader getURLClassLoader(String context) throws Exception
+ {
+ String output = ".";
+ File file = new File(output + File.separator + context);
+ URL url = file.toURI().toURL();
+ return new URLClassLoader(new URL[] { url });
+ }
+}
diff --git a/src/test/scoped/TestAnnotation.java b/src/test/scoped/TestAnnotation.java
new file mode 100644
index 00000000..dd5c7b8c
--- /dev/null
+++ b/src/test/scoped/TestAnnotation.java
@@ -0,0 +1,34 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * TestAnnotation.
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR })
+public @interface TestAnnotation
+{
+ String something() default "defaultValue";
+}
diff --git a/src/test/scoped/UnscopedAnnotationDefaultUsage.java b/src/test/scoped/UnscopedAnnotationDefaultUsage.java
new file mode 100644
index 00000000..bcbecfe6
--- /dev/null
+++ b/src/test/scoped/UnscopedAnnotationDefaultUsage.java
@@ -0,0 +1,29 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped;
+
+@TestAnnotation
+public class UnscopedAnnotationDefaultUsage
+{
+ @TestAnnotation
+ public int aField;
+
+ @TestAnnotation
+ public UnscopedAnnotationDefaultUsage(@TestAnnotation int param) {}
+
+ @TestAnnotation
+ public void doSomething(@TestAnnotation int param) {}
+}
diff --git a/src/test/scoped/UnscopedAnnotationUsage.java b/src/test/scoped/UnscopedAnnotationUsage.java
new file mode 100644
index 00000000..e63db330
--- /dev/null
+++ b/src/test/scoped/UnscopedAnnotationUsage.java
@@ -0,0 +1,29 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped;
+
+@TestAnnotation(something="notDefault")
+public class UnscopedAnnotationUsage
+{
+ @TestAnnotation(something="notDefault")
+ public int aField;
+
+ @TestAnnotation(something="notDefault")
+ public UnscopedAnnotationUsage(@TestAnnotation(something="notDefault") int param) {}
+
+ @TestAnnotation(something="notDefault")
+ public void doSomething(@TestAnnotation(something="notDefault") int param) {}
+}
diff --git a/src/test/scoped/jar1/FullyScopedAnnotationDefaultUsage.java b/src/test/scoped/jar1/FullyScopedAnnotationDefaultUsage.java
new file mode 100644
index 00000000..663d18f8
--- /dev/null
+++ b/src/test/scoped/jar1/FullyScopedAnnotationDefaultUsage.java
@@ -0,0 +1,29 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped.jar1;
+
+@ScopedTestAnnotation
+public class FullyScopedAnnotationDefaultUsage
+{
+ @ScopedTestAnnotation
+ public int aField;
+
+ @ScopedTestAnnotation
+ public FullyScopedAnnotationDefaultUsage(@ScopedTestAnnotation int value) {}
+
+ @ScopedTestAnnotation
+ public void doSomething(@ScopedTestAnnotation int value) {}
+}
diff --git a/src/test/scoped/jar1/FullyScopedAnnotationUsage.java b/src/test/scoped/jar1/FullyScopedAnnotationUsage.java
new file mode 100644
index 00000000..c44aeb75
--- /dev/null
+++ b/src/test/scoped/jar1/FullyScopedAnnotationUsage.java
@@ -0,0 +1,29 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped.jar1;
+
+@ScopedTestAnnotation(something="notDefault")
+public class FullyScopedAnnotationUsage
+{
+ @ScopedTestAnnotation(something="notDefault")
+ public int aField;
+
+ @ScopedTestAnnotation(something="notDefault")
+ public FullyScopedAnnotationUsage(@ScopedTestAnnotation(something="notDefault") int param) {}
+
+ @ScopedTestAnnotation(something="notDefault")
+ public void doSomething(@ScopedTestAnnotation(something="notDefault") int param) {}
+}
diff --git a/src/test/scoped/jar1/ScopedAnnotationDefaultUsage.java b/src/test/scoped/jar1/ScopedAnnotationDefaultUsage.java
new file mode 100644
index 00000000..284b0868
--- /dev/null
+++ b/src/test/scoped/jar1/ScopedAnnotationDefaultUsage.java
@@ -0,0 +1,31 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped.jar1;
+
+import scoped.TestAnnotation;
+
+@TestAnnotation
+public class ScopedAnnotationDefaultUsage
+{
+ @TestAnnotation
+ public int aField;
+
+ @TestAnnotation
+ public ScopedAnnotationDefaultUsage(@TestAnnotation int param) {}
+
+ @TestAnnotation
+ public void doSomething(@TestAnnotation int param) {}
+}
diff --git a/src/test/scoped/jar1/ScopedAnnotationUsage.java b/src/test/scoped/jar1/ScopedAnnotationUsage.java
new file mode 100644
index 00000000..23400f27
--- /dev/null
+++ b/src/test/scoped/jar1/ScopedAnnotationUsage.java
@@ -0,0 +1,31 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped.jar1;
+
+import scoped.TestAnnotation;
+
+@TestAnnotation(something="notDefault")
+public class ScopedAnnotationUsage
+{
+ @TestAnnotation(something="notDefault")
+ public int aField;
+
+ @TestAnnotation(something="notDefault")
+ public ScopedAnnotationUsage(@TestAnnotation(something="notDefault") int param) {}
+
+ @TestAnnotation(something="notDefault")
+ public void doSomething(@TestAnnotation(something="notDefault") int param) {}
+}
diff --git a/src/test/scoped/jar1/ScopedTestAnnotation.java b/src/test/scoped/jar1/ScopedTestAnnotation.java
new file mode 100644
index 00000000..25a36a58
--- /dev/null
+++ b/src/test/scoped/jar1/ScopedTestAnnotation.java
@@ -0,0 +1,34 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped.jar1;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * TestAnnotation.
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR })
+public @interface ScopedTestAnnotation
+{
+ String something() default "defaultValue";
+}
diff --git a/src/test/scoped/jar1/TestClass1.java b/src/test/scoped/jar1/TestClass1.java
new file mode 100644
index 00000000..a538bf77
--- /dev/null
+++ b/src/test/scoped/jar1/TestClass1.java
@@ -0,0 +1,26 @@
+/*
+ * Javassist, a Java-bytecode translator toolkit.
+ * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. Alternatively, the contents of this file may be used under
+ * the terms of the GNU Lesser General Public License Version 2.1 or later,
+ * or the Apache License Version 2.0.
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ */
+package scoped.jar1;
+
+/**
+ * TestClass1.
+ *
+ * @author <a href="adrian@jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class TestClass1
+{
+}