You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cs...@apache.org on 2006/04/03 20:30:55 UTC
svn commit: r391106 - in /beehive/trunk/controls:
src/api/org/apache/beehive/controls/api/bean/
src/runtime/org/apache/beehive/controls/runtime/generator/
test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/
test/src/junit-con...
Author: cschoett
Date: Mon Apr 3 11:30:53 2006
New Revision: 391106
URL: http://svn.apache.org/viewcvs?rev=391106&view=rev
Log:
Fix for BEEHIVE-1087, added optional 'interfaceHint' attribute to Control() annotation.
Added new unit tests for fix.
Added source headers to the controls junit tests which were missing them.
Added:
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/README.txt (with props)
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControl.java (with props)
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControlImpl.java (with props)
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControl.java (with props)
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControlImpl.java (with props)
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControl.java (with props)
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControlImpl.java (with props)
beehive/trunk/controls/test/src/junit-tests/org/apache/beehive/controls/test/junit/InterfaceHintTest.java (with props)
Modified:
beehive/trunk/controls/src/api/org/apache/beehive/controls/api/bean/Control.java
beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlField.java
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBuffer.java
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBufferService.java
beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/CustomerDao.java
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/bean/Control.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/bean/Control.java?rev=391106&r1=391105&r2=391106&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/bean/Control.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/bean/Control.java Mon Apr 3 11:30:53 2006
@@ -34,5 +34,10 @@
@Target({ElementType.FIELD})
public @interface Control
{
-
+ /**
+ * Optional member used to specify the control interface class.
+ * Typically only necessary to resolve ambiguities when multiple
+ * control interfaces with same name but different packages are present.
+ */
+ Class<?> interfaceHint() default Object.class;
}
Modified: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlField.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlField.java?rev=391106&r1=391105&r2=391106&view=diff
==============================================================================
--- beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlField.java (original)
+++ beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlField.java Mon Apr 3 11:30:53 2006
@@ -26,9 +26,11 @@
import com.sun.mirror.type.DeclaredType;
import com.sun.mirror.type.InterfaceType;
import com.sun.mirror.type.TypeMirror;
+import com.sun.mirror.type.MirroredTypeException;
import org.apache.beehive.controls.api.bean.ControlExtension;
import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.versioning.VersionRequired;
import org.apache.beehive.controls.runtime.generator.apt.TwoPhaseAnnotationProcessor;
@@ -48,7 +50,7 @@
_controlClient = controlClient;
_ap = ap;
_controlBean = new ControlBean(getControlInterface());
- };
+ }
/**
* Does this control field have a VersionRequired annotation?
@@ -88,18 +90,32 @@
{
String className = controlType.toString();
String intfName = className.substring(0, className.length() - 4);
+ String interfaceHint = getControlInterfaceHint();
controlIntf = (InterfaceDeclaration)_ap.getAnnotationProcessorEnvironment().getTypeDeclaration(intfName);
+
if (controlIntf == null)
{
// The specified class name may not be fully qualified. In this case, the
// best we can do is look for a best fit match against the input types
for (TypeDeclaration td :_ap.getAnnotationProcessorEnvironment().getSpecifiedTypeDeclarations())
{
- if (td instanceof InterfaceDeclaration &&
- td.getSimpleName().equals(intfName))
- {
- controlIntf = (InterfaceDeclaration)td;
- break;
+ // if an interface hint was provided, use it to find the control interface,
+ // if not provided try to find the control interface by matching simple names.
+ if (interfaceHint != null) {
+ if (td instanceof InterfaceDeclaration &&
+ td.getQualifiedName().equals(interfaceHint))
+ {
+ controlIntf = (InterfaceDeclaration)td;
+ break;
+ }
+ }
+ else {
+ if (td instanceof InterfaceDeclaration &&
+ td.getSimpleName().equals(intfName))
+ {
+ controlIntf = (InterfaceDeclaration)td;
+ break;
+ }
}
}
}
@@ -134,6 +150,23 @@
}
return new AptControlInterface(controlIntf, _ap);
+ }
+
+ /**
+ * Get the interface hint attribute value (as a string) from the Control annotation,
+ * if it wasn't specified return null.
+ */
+ private String getControlInterfaceHint() {
+
+ Control controlAnnotation = _fieldDecl.getAnnotation(Control.class);
+ String interfaceHint = null;
+ try {
+ // always excepts
+ controlAnnotation.interfaceHint();
+ } catch (MirroredTypeException mte) {
+ interfaceHint = ("java.lang.Object".equals(mte.getQualifiedName())) ? null : mte.getQualifiedName();
+ }
+ return interfaceHint;
}
/**
Modified: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBuffer.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBuffer.java?rev=391106&r1=391105&r2=391106&view=diff
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBuffer.java (original)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBuffer.java Mon Apr 3 11:30:53 2006
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
package org.apache.beehive.controls.test.controls.eventsetApt;
import org.apache.beehive.controls.spi.svc.InterceptorAnnotation;
Modified: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBufferService.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBufferService.java?rev=391106&r1=391105&r2=391106&view=diff
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBufferService.java (original)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/eventsetApt/MessageBufferService.java Mon Apr 3 11:30:53 2006
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
package org.apache.beehive.controls.test.controls.eventsetApt;
import org.apache.beehive.controls.spi.svc.Interceptor;
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/README.txt
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/README.txt?rev=391106&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/README.txt (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/README.txt Mon Apr 3 11:30:53 2006
@@ -0,0 +1,8 @@
+Some brief notes on this test:
+
+This test is setup so that the BarControl is processed last by APT so that the FooControlBean field must be resolved
+to either a.FooControlBean or b.FooControlBean (this is the right choice). In order for APT to correctly determine
+which FooControlBean to use it must correctly process the @Control annotation's control interface hint.
+
+If working properly the BarControlClientInitializer should have a reference to the correct FooControlBean, otherwise
+a compilation error occurs.
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControl.java?rev=391106&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControl.java Mon Apr 3 11:30:53 2006
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.test.controls.interfaceHint.a;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+@ControlInterface
+public interface FooControl {
+
+}
\ No newline at end of file
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControl.java
------------------------------------------------------------------------------
svn:executable = *
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControlImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControlImpl.java?rev=391106&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControlImpl.java Mon Apr 3 11:30:53 2006
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.test.controls.interfaceHint.a;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import java.io.Serializable;
+
+@ControlImplementation
+public class FooControlImpl implements FooControl, Serializable {
+ private static final long serialVersionUID = 1L;
+
+}
\ No newline at end of file
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/a/FooControlImpl.java
------------------------------------------------------------------------------
svn:executable = *
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControl.java?rev=391106&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControl.java Mon Apr 3 11:30:53 2006
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.test.controls.interfaceHint.b;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+@ControlInterface
+public interface FooControl {
+
+}
\ No newline at end of file
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControl.java
------------------------------------------------------------------------------
svn:executable = *
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControlImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControlImpl.java?rev=391106&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControlImpl.java Mon Apr 3 11:30:53 2006
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.controls.test.controls.interfaceHint.b;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import java.io.Serializable;
+
+@ControlImplementation
+public class FooControlImpl implements FooControl, Serializable {
+ private static final long serialVersionUID = 1L;
+
+}
\ No newline at end of file
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/b/FooControlImpl.java
------------------------------------------------------------------------------
svn:executable = *
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControl.java?rev=391106&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControl.java Mon Apr 3 11:30:53 2006
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.interfaceHint.c;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.test.controls.interfaceHint.a.FooControlBean;
+
+@ControlInterface
+public interface BarControl {
+
+ public Object getFooBean();
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControlImpl.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControlImpl.java?rev=391106&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControlImpl.java Mon Apr 3 11:30:53 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.controls.interfaceHint.c;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.test.controls.interfaceHint.b.FooControlBean;
+
+import java.io.Serializable;
+
+@ControlImplementation
+public class BarControlImpl implements BarControl, Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @Control(interfaceHint = org.apache.beehive.controls.test.controls.interfaceHint.b.FooControl.class)
+ public FooControlBean _fooBean;
+
+ public Object getFooBean() { return _fooBean; }
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/interfaceHint/c/BarControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/CustomerDao.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/CustomerDao.java?rev=391106&r1=391105&r2=391106&view=diff
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/CustomerDao.java (original)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/CustomerDao.java Mon Apr 3 11:30:53 2006
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
package org.apache.beehive.controls.test.controls.methodOverride;
import org.apache.beehive.controls.api.bean.ControlExtension;
Added: beehive/trunk/controls/test/src/junit-tests/org/apache/beehive/controls/test/junit/InterfaceHintTest.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/src/junit-tests/org/apache/beehive/controls/test/junit/InterfaceHintTest.java?rev=391106&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-tests/org/apache/beehive/controls/test/junit/InterfaceHintTest.java (added)
+++ beehive/trunk/controls/test/src/junit-tests/org/apache/beehive/controls/test/junit/InterfaceHintTest.java Mon Apr 3 11:30:53 2006
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ *
+ * $Header:$
+ */
+
+package org.apache.beehive.controls.test.junit;
+
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.test.controls.interfaceHint.b.FooControlBean;
+import org.apache.beehive.controls.test.controls.interfaceHint.c.BarControl;
+
+/**
+ * Test that the proper control is being associated with the control reference.
+ * There are two controls with the same name but in different java packages.
+ */
+public class InterfaceHintTest
+ extends ControlTestCase {
+
+ @Control
+ private BarControl _barControl;
+
+
+ public void testFooType() {
+ assertNotNull(_barControl);
+ assertTrue(_barControl.getFooBean() instanceof org.apache.beehive.controls.test.controls.interfaceHint.b.FooControlBean);
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-tests/org/apache/beehive/controls/test/junit/InterfaceHintTest.java
------------------------------------------------------------------------------
svn:eol-style = native