I want to open a second transcript and to write to it. Turns out that it does not work the way I would expect it to:
| second |
second := ThreadSafeTranscript new.
second openLabel: 'A Second Transcript'.
second show: 'test'.
Am I missing something?
Well, that is going to be complicated as there is logic buried deep inside the system so that multiple transcript windows are using the same ThreadSafeTranscript.
So, your best bet is to make your own and reuse the streaming API.
I've done one.
You can load it from http://www.smalltalkhub.com/#!/~philippeback/HOTranscript
You may want to put some critical: around some methods but well, if you use several HOTranscripts I guess it is best for you to deal with that. My take is that one does not need the critical: bit for such transcripts.
Related
I see that there is a TestNumberer class in the OrigenTesters at https://github.com/Origen-SDK/origen_testers/blob/master/lib/origen_testers/generator/test_numberer.rb . However, it looks pretty bare, and doesn't look like its being used internally anywhere. So, my question is does this TestNumberer... do anything? I don't see anything in the guides about automatically generating test numbers. What I'd like is something like:
test_numberer.set_base(1000) # for example
test_numberer.set_offset(5)
func (..., test_number: test_numberer.next) #=> test_number = 1000
func (..., test_number: test_numberer.next) #=> test_number = 1005
Possibly even embed incrementing the test number into the func function itself in the interface.
Thanks!
(For the record, I actually already have this in one of my apps for personal use, but am wondering if OrigenTesters already has one, and if not, if it could use one)
No, that is old and dead code which should be removed.
There is a solution for generating test numbers though, and that is the TestIds plugin: http://origen-sdk.org/test_ids/
I'm still not totally happy with how it works, but I use it in production today in a large test flow module.
I would say it does solve these problems effectively:
How do you assign test (and/or bin) numbers within an IP test block, in such a way that it can be included in different SoC test programs which may each want to assign a different range or even a different numbering scheme to the tests for that IP.
How do you automatically assign test (and/or bin) numbers in such a way that they will stick and won't change when other tests are added or removed from the flow in future.
I don't really have anything specific that I know is wrong with it, just some niggles that have come up from time to time and it would be good to get other people using it and involved with it to help iron these out.
One of the things that I have come to realize is that it is easier to manage if you explicitly give tests a number (or bin) ID in the test flow like this:
func :blah, number: :blah_test1
func :blah, number: :blah_test2
This makes it easier to control when you want same-named tests to have the same number or not, whilst not locking down to any particular number.
Anyway, you should find the documentation of it pretty good and obviously ask further questions here if you have any.
I have a feature file A.feature which generates a number in the response body. Now, I have to capture that text/number and then pass it as test data to another feature file.Do we need to write step definition or is there any other way?Please suggest.
Generally, you should not do that. In fact you should try to make your test cases totally independent from each other. It's a bad sign if a single code change breaks many of your tests (in your case, whenever the first feature breaks, the second one would as well.) It's also a bad sign that, as a starting point, your second feature needs a special response that is not easy to construct.
How do I decide between creating several WebJobs with 1 function each and bundling several functions into one or only a few WebJobs?
Thanks
There is no straight answer to your question. Sorry.
Usually you group functions by workflow or role. For example if you have a workflow that contains a function that resizes an image, then a function that applies a watermark and another one that replicates the images then it makes sense to put all the functions together because they are related. You are more likely to change all of them when you modify the flow.
On the other hand, you might argue that functions should be separated. Unless you change the input/output, there is no reason to modify more than one function. However, if you need to change more than one function, you will end up editing more projects.
As you see, both arguments have pros/cons and there is really no right answer.
Try to experiment and see which approach works better for your solution.
PS: The only guideline that I can give is: if the functions are really small (a few lines of code), probably it is easier to put them in the same webjob because there is quite some overhead in maintaining multiple assemblies.
I have a requirement to add fields onto a form based on data from another set of entities. Is this possible using an event script or does it require a plugin?
Given that I understand your assignment correctly, it can be done using JavaScript as well as a plugin. There is a significant difference that you need to take into consideration.
Is the change to the other entities to be made only when an actual user loads a form? If so, JS is the right way.
Or perhaps you need to ensure that those values are written even if a console client or system process retrieves the value of the primary entity? In that case, C# is your only option.
EDIT:
Simply accessing the values from any entity in the onload event can be done using a call to oData. I believe someone else asked a similar question recently. The basic format will look like this.
http://Server:Port/Organization
/XrmServices/2011/OrganizationData.svc
/TheEntityLogicalNameOfYoursSet()?$filter=FieldName eq 'ValueOfIt'
Some extra remarks.
If you're targeting on-line installation, the syntax will differ, of course, because the Schema-Server-Port-Organization are provided in a different pattern (https, orgName.crm4.something.something.com etc.). You can look it up on Settings.
Perhaps it should go without saying and I'm sure you realize it but for completeness' sake, TheEntityLogicalNameOfYours needs to be substituted for the actual name (unless that is your actual name, in which case I'll be worried, haha).
If you're new to this whole oData thingy, keep asking. I got the impression that the info I'm giving you is appreciated but not really producing "aha!" experience for you. You might want to ask separate questions, though. Some examples right off the top of my head.
a. "How do I perform oData call in JavaScript?"
b. "How do I access the fetched data?"
c. "How do I add/remove/hide a field programmatically on a form?"
d. "How do I combine data from...?"
I am having a method in which there are more then 7 parameters ,type of all the parameters are different.
Well my question is it fine or i should replace all parameters with the single class(which will contaion all parameters as a instance variable).
Well my question is it fine or i should replace all parameters with the single class
7 is way too much. Replace with a class. With my VS custom theme and fonts settings Intellisense wouldn't fit on the screen when there is a method with so many parameters :-) I find it more readable and easier to understand when working with classes.
Of course those are just my 2 cents and it's subjective. I've seen people writing methods with many many parameters.
Well, there are places where I'd consider that okay - but they're few and far between. I would generally consider using a "parameter class" instead.
Note that it doesn't have to be an "all or nothing" approach - would it make more sense to encapsulate, say, 4 of the parameters together? Would that allow the new class to be used in other methods?
Other thing to consider is whether the method might be doing too much - does the functionality of the method definitely feel right as a single cohesive unit?
Thare are Microsoft APIs with even more parameters; anyway I agree with #Darin, a class could be a good solution, clear and efficient that can avoid passing parameters in the right order... so for example if you change order for oen without using refactoring you're in a mess...
Consider also if that class can be used in other parts of the program...
I somewhat agree with all given answers. However it might be a good idea to break down the method into smaller parts as Jon is suggesting. Usually when you have a situation like this means that the method is doing too much. Typically methods should have 1 or 2 parameters at most. While you would achieve the same by replacing all your parameters with a class parameter you might just be hiding the bigger issue. Is there any chance you can post the method or describe what it's doing?
As a rule of thumb, if you can't fit the entire method, including declaration onto 1 screen, it's too big. Programmers will normally recommend to break down methods to make them reusable. But, it also makes perfect sense to break them down to increase readability.