diff options
author | acolyer <acolyer> | 2004-07-29 15:04:00 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-07-29 15:04:00 +0000 |
commit | 4feb835a5339c3f63d73fbd6db2fe307e1f08ed1 (patch) | |
tree | 34ee42f12faffdb5eb0ecc4312d23333c772b788 /weaver/testsrc | |
parent | 7321d9dc015a3af650c54113883b340e4def654f (diff) | |
download | aspectj-4feb835a5339c3f63d73fbd6db2fe307e1f08ed1.tar.gz aspectj-4feb835a5339c3f63d73fbd6db2fe307e1f08ed1.zip |
Moved all weaver messages into weaver-messages.properties.
Includes fixes for Bugzilla Bug 30439
spurious "circular dependency" error
Diffstat (limited to 'weaver/testsrc')
-rw-r--r-- | weaver/testsrc/org/aspectj/weaver/BcweaverTests.java | 1 | ||||
-rw-r--r-- | weaver/testsrc/org/aspectj/weaver/WeaverMessagesTestCase.java | 50 |
2 files changed, 51 insertions, 0 deletions
diff --git a/weaver/testsrc/org/aspectj/weaver/BcweaverTests.java b/weaver/testsrc/org/aspectj/weaver/BcweaverTests.java index 1803cf2fd..ac1587b54 100644 --- a/weaver/testsrc/org/aspectj/weaver/BcweaverTests.java +++ b/weaver/testsrc/org/aspectj/weaver/BcweaverTests.java @@ -53,6 +53,7 @@ public class BcweaverTests extends TestCase { suite.addTestSuite(MemberTestCase.class); suite.addTestSuite(TypeXTestCase.class); suite.addTestSuite(WeavingURLClassLoaderTest.class); + suite.addTestSuite(WeaverMessagesTestCase.class); //$JUnit-END$ return suite; } diff --git a/weaver/testsrc/org/aspectj/weaver/WeaverMessagesTestCase.java b/weaver/testsrc/org/aspectj/weaver/WeaverMessagesTestCase.java new file mode 100644 index 000000000..99efe3dc3 --- /dev/null +++ b/weaver/testsrc/org/aspectj/weaver/WeaverMessagesTestCase.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.aspectj.weaver; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; +import java.util.MissingResourceException; + +import junit.framework.TestCase; + +/** + * @author colyer + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Generation - Code and Comments + */ +public class WeaverMessagesTestCase extends TestCase { + + public void testAllMessagesDefined() { + + Class wmClass = WeaverMessages.class; + Field[] fields = wmClass.getDeclaredFields(); + List fieldList = new ArrayList(); + for (int i = 0; i < fields.length; i++) { + Field f = fields[i]; + if (f.getType() == String.class) { + try { + String key = (String) f.get(null); + String value = WeaverMessages.format(key); + assertFalse("Each key should be unique",fieldList.contains(key)); + fieldList.add(key); +// System.out.println(key + "," + value); + } catch (IllegalAccessException ex) { + } catch(MissingResourceException mrEx) { + fail("Missing resource: " + mrEx); + } + } + } + } + +} |