Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
314 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,50 @@ | ||
Debugging ometa.calculator Release | ||
================================== | ||
ROADMAP | ||
======= | ||
|
||
* external callables | ||
** automatically insert default parameterless ctor | ||
|
||
******** Acknowledgement Release ************** | ||
|
||
* bean properties | ||
** 'get(arg)' is the indexer (default member) | ||
* monolipse wizard: new boojay project | ||
* code completion for java library types | ||
* monolipse: windows version should not require anything other than update site | ||
* ensure pattern matching works with bean properties | ||
* refactor all primitive dependent information into a PrimitiveInfo() tuple with things like | ||
* array store opcode | ||
* array load opcode | ||
* type descriptor | ||
* move boojay to separate google project (http://code.google.com/p/boojay/) | ||
* update monolipse site | ||
|
||
|
||
********* Resolution Release *************** | ||
|
||
** resident test runner | ||
** internal macros work again | ||
** support for referencing jar files and class file directories | ||
* external callables | ||
** automatically insert default parameterless ctor | ||
* monolipse integration | ||
** "Run As JUnit Tests" | ||
* events | ||
|
||
|
||
********** Pursuance Release *************** | ||
|
||
* monolipse integration | ||
** wizard: new boojay project | ||
** wizard: new boojay source folder | ||
** resident incremental compiler | ||
*** builder just sends delta information to the compiler | ||
which maintains the dependency tree and it's able to recompile | ||
required files on demand | ||
** deferred namespace implementation on top of a directory or jar file | ||
** meta-programming by invoking the boojay compiler on temporary files generated from code literals | ||
|
||
* ant tasks | ||
|
||
* refactor all primitive dependent information into a PrimitiveInfo() tuple with things like | ||
* array store opcode | ||
* array load opcode | ||
* type descriptor | ||
|
||
* GetHashCode | ||
* events | ||
* properties | ||
* duck typing | ||
|
||
|
||
*********** Psalm Release **************** | ||
|
||
... |
76 changes: 76 additions & 0 deletions
76
boojay/src/Boojay.Compilation.Tests/BeanPropertyFinderTest.boo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
namespace Boojay.Compilation.Tests | ||
|
||
import NUnit.Framework | ||
|
||
import Boo.Lang.Compiler.TypeSystem | ||
import Boojay.Compilation.TypeSystem | ||
|
||
[TestFixture] | ||
class BeanPropertyFinderTest: | ||
|
||
[Test] def SimpleProperty(): | ||
p = expectingSingleBeanPropertyWithNameAndTypeOn(ClassWithSimpleProperty, "name", string) | ||
Assert.AreEqual("getName", p.GetGetMethod().Name) | ||
Assert.AreEqual("setName", p.GetSetMethod().Name) | ||
|
||
[Test] def ReadOnlyProperty(): | ||
p = expectingSingleBeanPropertyWithNameAndTypeOn(ClassWithReadOnlyProperty, "value", int) | ||
assert p.GetSetMethod() is null | ||
Assert.AreEqual("getValue", p.GetGetMethod().Name) | ||
|
||
[Test] def WriteOnlyProperty(): | ||
p = expectingSingleBeanPropertyWithNameAndTypeOn(ClassWithWriteOnlyProperty, "value", object) | ||
assert p.GetGetMethod() is null | ||
Assert.AreEqual("setValue", p.GetSetMethod().Name) | ||
|
||
[Test] def IndexedProperty(): | ||
pass | ||
|
||
[Test] def OverloadedIndexedProperty(): | ||
pass | ||
|
||
[Test] def ConflictingSetters(): | ||
properties = beanPropertiesFor(ClassWithConflictingSetters) | ||
assert 0 == len(properties), join(properties, ", ") | ||
|
||
class ClassWithSimpleProperty: | ||
def getName() as string: | ||
pass | ||
def setName(value as string): | ||
pass | ||
|
||
class ClassWithReadOnlyProperty: | ||
def getValue(): | ||
return 0 | ||
|
||
class ClassWithWriteOnlyProperty: | ||
def setValue(value): | ||
pass | ||
|
||
class ClassWithConflictingSetters: | ||
def setValue(value as int): | ||
pass | ||
def setValue(vaue as string): | ||
pass | ||
|
||
def expectingSingleBeanPropertyWithNameAndTypeOn(type as System.Type, expectedName as string, expectedType as System.Type): | ||
p = expectingSingleBeanPropertyFor(type) | ||
assertPropertyNameAndType p, expectedName, expectedType | ||
return p | ||
|
||
def expectingSingleBeanPropertyFor(type as System.Type): | ||
properties = beanPropertiesFor(type) | ||
assert 1 == len(properties), join(properties, ", ") | ||
return properties[0] | ||
|
||
def assertPropertyNameAndType(p as IProperty, expectedName as string, expectedType as System.Type): | ||
Assert.AreEqual(expectedName, p.Name) | ||
Assert.AreSame(bindingFor(expectedType), p.Type) | ||
|
||
typeSystem = JavaTypeSystem() | ||
|
||
def beanPropertiesFor(type as System.Type): | ||
return array(BeanPropertyFinder(bindingFor(type).GetMembers()).findAll()) | ||
|
||
def bindingFor(type as System.Type): | ||
return typeSystem.Map(type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
boojay/src/Boojay.Compilation.Tests/JavaTypeSystemTest.boo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Boojay.Compilation.Tests | ||
|
||
import NUnit.Framework | ||
|
||
import Boo.Lang.Compiler.TypeSystem | ||
import Boojay.Compilation.TypeSystem | ||
|
||
[TestFixture] | ||
class JavaTypeSystemTest: | ||
|
||
class Bean: | ||
def getName() as string: | ||
pass | ||
def setName(value as string): | ||
pass | ||
|
||
typeSystem = JavaTypeSystem() | ||
|
||
[Test] def BeanProperties(): | ||
|
||
members = typeSystem.Map(Bean).GetMembers() | ||
System.Array.Sort(members, { l as IEntity, r as IEntity | l.Name.CompareTo(r.Name) }) | ||
|
||
Assert.AreEqual("constructor, getName, name, setName", join(member.Name for member in members, ", ")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
boojay/src/Boojay.Compilation/Steps/PatchCallableConstruction.boo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
boojay/src/Boojay.Compilation/TypeSystem/BeanAwareType.boo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Boojay.Compilation.TypeSystem | ||
|
||
import Boo.Lang.Compiler.TypeSystem | ||
|
||
class BeanAwareType(ExternalType): | ||
|
||
def constructor(typeSystem as TypeSystemServices, type as System.Type): | ||
super(typeSystem, type) | ||
|
||
override def CreateMembers(): | ||
originalMembers = super() | ||
beanProperties = BeanPropertyFinder(originalMembers).findAll() | ||
return array(IEntity, cat(originalMembers, beanProperties)) |
Oops, something went wrong.