--- a/mercurial/HGStXTests.st Thu Jun 11 07:56:26 2015 +0100
+++ b/mercurial/HGStXTests.st Thu Jun 11 08:44:49 2015 +0100
@@ -2267,6 +2267,57 @@
"Created: / 04-08-2014 / 01:43:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 20-01-2015 / 11:36:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_commit_java_01c
+ "
+ Test selective commit of Java class
+ "
+
+ | repo classes pm ct changeset |
+
+ "/ Hack for rel 6.2.2 - should use 'self skipIf: ... '
+ "/ but this is not supported by 6.2.2's SUnit..."
+ (Smalltalk versionString = '6.2.2') ifTrue:[ ^ self ].
+
+ repo := self repositoryNamed: 'mocks/hg/p5'.
+ self assert: (Smalltalk loadPackage:'mocks:hg/p5').
+
+ "/ Do skipIf after package is loaded!!!!!! otherwise the
+ "/ Java extension is not loaded!!
+
+ self skipIf: (self stxlibjavaAvailableRequireReboot: false) not description: 'STX:LIBJAVA not available'.
+
+ classes := JavaCompiler compile:'
+package mocks.hg.p5;
+
+@stx.libjava.annotation.Package("mocks:hg/p5")
+class Foo {
+}
+'.
+ JavaVM registry registerClasses: classes andWait: true.
+
+
+ pm := HGPackageWorkingCopy named: #'mocks:hg/p5'.
+ ct := pm commitTask.
+ ct message: testSelector.
+ ct classes: classes.
+ ct do.
+ "
+ repo workingCopy browse
+ ct temporaryWorkingCopy browse
+ "
+ changeset := repo @ 2.
+
+ "/ Three files shall be added:
+ "/ Foo.java
+ "/ build.xml
+ "/ build.auto.xml
+ self assert: (changeset changes select:[:change | change isAdded ]) size == 3.
+
+ self assert: (changeset / 'java' / 'src' / 'mocks' / 'hg' / 'p5' / 'Foo.java' ) notNil.
+
+ "Created: / 11-06-2015 / 08:01:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!HGStXTests methodsFor:'tests - commit - nested'!