tests fixes - global instance of RBNamespace for creating RBClass holds old data when the global system namespace changes its state - in this case it is old real class instance
Now is RBNamespace initialized for each instace of CustomContext
--- a/CustomBrowserContext.st Tue Nov 18 09:33:03 2014 +0000
+++ b/CustomBrowserContext.st Wed Nov 19 19:39:02 2014 +0100
@@ -107,7 +107,7 @@
].
^ protocols
- "Modified: / 05-11-2014 / 18:56:18 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+ "Modified: / 19-11-2014 / 08:45:13 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
!
selectedVariables
--- a/CustomBrowserContextTests.st Tue Nov 18 09:33:03 2014 +0000
+++ b/CustomBrowserContextTests.st Wed Nov 19 19:39:02 2014 +0100
@@ -74,10 +74,11 @@
state selectedClasses setValue: (Array with: class01 with: class02).
actualProtocols := context selectedProtocols.
-
+
self assert: expectedProtocols = actualProtocols.
"Created: / 28-10-2014 / 19:26:28 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+ "Modified: / 19-11-2014 / 09:33:30 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
!
test_selected_method_protocols_empty
--- a/CustomContext.st Tue Nov 18 09:33:03 2014 +0000
+++ b/CustomContext.st Wed Nov 19 19:39:02 2014 +0100
@@ -1,21 +1,21 @@
"{ Package: 'jn:refactoring_custom' }"
Object subclass:#CustomContext
- instanceVariableNames:''
- classVariableNames:'SmalltalkNamespace'
+ instanceVariableNames:'model'
+ classVariableNames:''
poolDictionaries:''
category:'Interface-Refactoring-Custom'
!
-!CustomContext class methodsFor:'initialization'!
+!CustomContext class methodsFor:'instance creation'!
-initialize
- "Invoked at system start or when the class is dynamically loaded."
+new
+ "Returns an initialized instance"
- SmalltalkNamespace := RBNamespace onEnvironment: BrowserEnvironment new.
+ ^ self basicNew initialize.
- "Modified: / 14-11-2014 / 19:28:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 19-11-2014 / 09:36:37 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
! !
!CustomContext class methodsFor:'queries'!
@@ -28,6 +28,24 @@
^ self == CustomContext.
! !
+!CustomContext methodsFor:'accessing'!
+
+model
+ "Returns a class model on we operate e.g. RBNamespace, CustomNamespace"
+
+ ^ model
+
+ "Modified (comment): / 19-11-2014 / 10:00:29 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+!
+
+model: anRBNamespace
+ "see model"
+
+ model := anRBNamespace
+
+ "Modified (format): / 19-11-2014 / 10:01:10 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
!CustomContext methodsFor:'accessing-selection'!
selectedClassCategories
@@ -89,18 +107,27 @@
"Created: / 05-05-2014 / 00:14:59 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
! !
+!CustomContext methodsFor:'initialization'!
+
+initialize
+
+ model := CustomNamespace onEnvironment: BrowserEnvironment new.
+
+ "Modified: / 14-11-2014 / 19:28:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 19-11-2014 / 09:35:26 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
!CustomContext methodsFor:'private'!
asRBClass: cls
- "For given real class, return a curresponding RBClass"
+ "For given real class, return a corresponding RBClass"
^ Object isMetaclass
- ifTrue:[ SmalltalkNamespace metaclassNamed: cls theNonMetaclass name]
- ifFalse:[SmalltalkNamespace classNamed: cls name ]
-
- "Ceated: / 14-11-2014 / 19:26:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ ifTrue:[ model metaclassNamed: cls theNonMetaclass name ]
+ ifFalse:[ model classNamed: cls name ]
"Created: / 14-11-2014 / 19:26:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 19-11-2014 / 09:39:15 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
!
asRBMethod: aMethod
@@ -134,5 +161,3 @@
^ '$Changeset: <not expanded> $'
! !
-
-CustomContext initialize!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/CustomContextTests.st Wed Nov 19 19:39:02 2014 +0100
@@ -0,0 +1,54 @@
+"{ Package: 'jn:refactoring_custom' }"
+
+TestCase subclass:#CustomContextTests
+ instanceVariableNames:'context model'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Interface-Refactoring-Custom-Tests'
+!
+
+!CustomContextTests methodsFor:'initialization & release'!
+
+setUp
+ super setUp.
+
+ model := CustomNamespace new.
+ context := CustomContext new
+ model: model;
+ yourself
+
+ "Modified: / 19-11-2014 / 10:01:58 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
+!CustomContextTests methodsFor:'tests'!
+
+test_as_rb_class_class
+ | expectedClass actualClass |
+
+ expectedClass := model classNamed: self class name.
+ actualClass := context asRBClass: self class.
+
+ self deny: expectedClass isMeta.
+ self assert: expectedClass == actualClass.
+ self assert: (actualClass realClass) == (self class).
+
+ "Created: / 19-11-2014 / 10:12:34 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+!
+
+test_as_rb_class_metaclass
+ | expectedMetaclass actualMetaclass class |
+
+ expectedMetaclass := model metaclassNamed: self class name.
+ actualMetaclass := context asRBClass: self class class.
+ class := context asRBClass: self class.
+
+ self assert: expectedMetaclass isMeta.
+ self deny: class isMeta.
+
+ self deny: expectedMetaclass == class.
+ self assert: expectedMetaclass == actualMetaclass.
+ self assert: (expectedMetaclass realClass) == (self class class).
+
+ "Modified: / 19-11-2014 / 10:13:33 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
--- a/CustomDefaultGetterMethodsCodeGenerator.st Tue Nov 18 09:33:03 2014 +0000
+++ b/CustomDefaultGetterMethodsCodeGenerator.st Wed Nov 19 19:39:02 2014 +0100
@@ -7,6 +7,7 @@
category:'Interface-Refactoring-Custom-Generators'
!
+
!CustomDefaultGetterMethodsCodeGenerator class methodsFor:'accessing-presentation'!
description
@@ -74,3 +75,10 @@
"Created: / 30-06-2014 / 11:11:00 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
! !
+!CustomDefaultGetterMethodsCodeGenerator class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/CustomSubContext.st Tue Nov 18 09:33:03 2014 +0000
+++ b/CustomSubContext.st Wed Nov 19 19:39:02 2014 +0100
@@ -9,16 +9,6 @@
!
-!CustomSubContext class methodsFor:'instance creation'!
-
-new
- "return an initialized instance"
-
- ^ self basicNew initialize.
-
- "Created: / 19-12-2013 / 13:56:46 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
-! !
-
!CustomSubContext methodsFor:'accessing'!
selectedClassCategories:something
@@ -124,9 +114,12 @@
!CustomSubContext methodsFor:'initialization'!
initialize
+
+ super initialize.
selectedClasses := OrderedCollection new.
"Created: / 19-12-2013 / 12:37:44 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+ "Modified: / 19-11-2014 / 10:19:21 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
! !
!CustomSubContext methodsFor:'queries'!
--- a/Make.proto Tue Nov 18 09:33:03 2014 +0000
+++ b/Make.proto Wed Nov 19 19:39:02 2014 +0100
@@ -34,7 +34,7 @@
# add the path(es) here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/changes -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/refactoring -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic3 -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libjava -I$(INCLUDE_TOP)/stx/libjava/tools -I$(INCLUDE_TOP)/stx/libjavascript -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libwidg2
+LOCALINCLUDES= -I$(INCLUDE_TOP)/jn/refactoring_custom/patches -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/changes -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/helpers -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/refactoring -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic3 -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libjava -I$(INCLUDE_TOP)/stx/libjava/tools -I$(INCLUDE_TOP)/stx/libjavascript -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libwidg2
# if you need any additional defines for embedded C code,
--- a/abbrev.stc Tue Nov 18 09:33:03 2014 +0000
+++ b/abbrev.stc Wed Nov 19 19:39:02 2014 +0100
@@ -8,6 +8,7 @@
CustomCodeGeneratorOrRefactoring CustomCodeGeneratorOrRefactoring jn:refactoring_custom 'Interface-Refactoring-Custom' 0
CustomCodeGeneratorOrRefactoringTestCase CustomCodeGeneratorOrRefactoringTestCase jn:refactoring_custom 'Interface-Refactoring-Custom-Tests' 1
CustomContext CustomContext jn:refactoring_custom 'Interface-Refactoring-Custom' 0
+CustomContextTests CustomContextTests jn:refactoring_custom 'Interface-Refactoring-Custom-Tests' 1
CustomDialog CustomDialog jn:refactoring_custom 'Interface-Refactoring-Custom-UI' 0
CustomDummyTests CustomDummyTests jn:refactoring_custom 'Interface-Refactoring-Custom-Tests' 1
CustomManager CustomManager jn:refactoring_custom 'Interface-Refactoring-Custom' 0
--- a/bc.mak Tue Nov 18 09:33:03 2014 +0000
+++ b/bc.mak Wed Nov 19 19:39:02 2014 +0100
@@ -30,12 +30,11 @@
!INCLUDE Make.spec
LIBNAME=libjn_refactoring_custom
-MODULE_PATH=refactoring_custom
RESFILES=refactoring_custom.$(RES)
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\changes -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\refactoring -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic3 -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libjava -I$(INCLUDE_TOP)\stx\libjava\tools -I$(INCLUDE_TOP)\stx\libjavascript -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libwidg -I$(INCLUDE_TOP)\stx\libwidg2
+LOCALINCLUDES= -I$(INCLUDE_TOP)\jn\refactoring_custom\patches -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\changes -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\helpers -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\refactoring -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic3 -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libjava -I$(INCLUDE_TOP)\stx\libjava\tools -I$(INCLUDE_TOP)\stx\libjavascript -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libview -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libwidg -I$(INCLUDE_TOP)\stx\libwidg2
LOCALDEFINES=
STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -varPrefix=$(LIBNAME)
--- a/jn_refactoring_custom.st Tue Nov 18 09:33:03 2014 +0000
+++ b/jn_refactoring_custom.st Wed Nov 19 19:39:02 2014 +0100
@@ -105,6 +105,7 @@
CustomCodeGeneratorOrRefactoring
(CustomCodeGeneratorOrRefactoringTestCase autoload)
CustomContext
+ (CustomContextTests autoload)
CustomDialog
(CustomDummyTests autoload)
CustomManager
--- a/patches/CustomDummyClassPatches.st Tue Nov 18 09:33:03 2014 +0000
+++ b/patches/CustomDummyClassPatches.st Wed Nov 19 19:39:02 2014 +0100
@@ -19,3 +19,10 @@
"
! !
+!CustomDummyClassPatches class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/patches/bc.mak Tue Nov 18 09:33:03 2014 +0000
+++ b/patches/bc.mak Wed Nov 19 19:39:02 2014 +0100
@@ -30,7 +30,6 @@
!INCLUDE Make.spec
LIBNAME=libjn_refactoring_custom_patches
-MODULE_PATH=refactoring_custom\patches
RESFILES=patches.$(RES)
--- a/patches/extensions.st Tue Nov 18 09:33:03 2014 +0000
+++ b/patches/extensions.st Wed Nov 19 19:39:02 2014 +0100
@@ -152,12 +152,13 @@
| categories |
categories := Set new.
- self selectors do:[:selector |
+ self selectors do:[:selector |
categories add: (self methodFor: selector) category
].
^ categories
"Created: / 14-11-2014 / 20:25:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 19-11-2014 / 18:46:47 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
! !
!RBAbstractClass methodsFor:'method accessing'!
--- a/patches/patches.rc Tue Nov 18 09:33:03 2014 +0000
+++ b/patches/patches.rc Wed Nov 19 19:39:02 2014 +0100
@@ -4,7 +4,7 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 6,2,32767,32767
- PRODUCTVERSION 6,2,5,0
+ PRODUCTVERSION 6,2,4,1420
#if (__BORLANDC__)
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
@@ -24,8 +24,8 @@
VALUE "InternalName", "jn:refactoring_custom/patches\0"
VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
VALUE "ProductName", "LibraryName\0"
- VALUE "ProductVersion", "6.2.5.0\0"
- VALUE "ProductDate", "Sun, 16 Nov 2014 16:58:06 GMT\0"
+ VALUE "ProductVersion", "6.2.4.1420\0"
+ VALUE "ProductDate", "Wed, 19 Nov 2014 17:49:45 GMT\0"
END
END
--- a/refactoring_custom.rc Tue Nov 18 09:33:03 2014 +0000
+++ b/refactoring_custom.rc Wed Nov 19 19:39:02 2014 +0100
@@ -4,7 +4,7 @@
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 6,2,32767,32767
- PRODUCTVERSION 6,2,5,0
+ PRODUCTVERSION 6,2,4,1420
#if (__BORLANDC__)
FILEFLAGSMASK VS_FF_DEBUG | VS_FF_PRERELEASE
FILEFLAGS VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
@@ -24,8 +24,8 @@
VALUE "InternalName", "jn:refactoring_custom\0"
VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
VALUE "ProductName", "ProductName\0"
- VALUE "ProductVersion", "6.2.5.0\0"
- VALUE "ProductDate", "Fri, 14 Nov 2014 19:29:20 GMT\0"
+ VALUE "ProductVersion", "6.2.4.1420\0"
+ VALUE "ProductDate", "Wed, 19 Nov 2014 17:49:42 GMT\0"
END
END