Currently, I would need to create a bundle that sends an event with eventAdmin.sendEvent(event). However, for testing purposes it would be nice to be able to send events manually. Is that possible, using one or another OSGi shell?
Yes, you can create a console extension that adds specific commands - in your case commands that create & send specific events. See this documentation page.
I found that the Apache Felix Web Console also allows to manually send events.
Related
I am trying to use LocalStack for my end to end tests but I cannot read the emails sent via LocalStack/SES. Is there a way to do that?
I want my Cypress e2e tests to invoke my backend services, the backend services compose an email containing a link and send the email via LocalStack/SES. I then want my e2e tests to wait for that email, read the link sent in it, and proceed.
I managed to invoke LocalStack's SES to send the email, and I am aware that the moto library backing LocalStack stores the sent messages in memory. Is there a way to read those messages?
The sent messages can be retrieved via a service API endpoint (GET
/_localstack/ses) or from the filesystem.
Messages are also saved to the data directory (DATA_DIR, see
Configuration). If data directory is not available, the temporary
directory (TMPDIR) is used. The files are saved as JSON in the ses/
subdirectory and organised by message ID.
Reference:
https://docs.localstack.cloud/aws/ses/
Localstack uses Moto and Moto does expose the ability to check the sent emails. It is discussed here
https://github.com/spulec/moto/issues/1392
Taking a look at the code for localstack doesn’t look like they expose a function to access this information.
https://github.com/localstack/localstack/blob/master/localstack/services/ses/ses_starter.py
You will need to make a pull request to Localstack and add a function which exposes the ses_backend or specifically the sent_messages array.
from moto.ses import ses_backend
ses_backend.sent_messages
I am not using localstack for SES I am running the E2E tests against our real Quality Assurance Testing environment (real SES). In that case you can use one of the following.
What you need is a programmatic way of reading the inbox and checking the emails by title and maybe the body too.
Mailosaur https://mailosaur.com/
The API is simple to use with Java which fit our use case. In addition to that the response from their sales /support. They also have SMS services too which we are not using.
MailSlurp https://www.mailslurp.com/
This was our first choice just because it’s the first one we found and it looked pretty good. But we tried to contact them and never go a reply. They still haven’t replied and we sent half a dozen emails.
MailTrap https://mailtrap.io/
There was a third service which is suitable if your working with JavaScript (please use Typescript) as it’s REST based. But for Java REST APIs end up being quite verbose with the code which I am not a fan of. But if you are in JavaScript this option is suitable.
The prices of each are all comparable MailTrap has a free option too.
I'm using Spring-Insight and Pivotal tc server to deploy and monitor two Spring applications but I have to create some alerts in case of threshold violation. Do you know if this is possible to make this alerting system without creating a customized plugin? I just can't find anything in the documentation.
Finally, I didn't find any solution to my problem but I think this is possible with a customized plugin. I personally chose another option : monitor my application with Dynatrace even if Dynatrace isn't free.
I'll try to explain my goal as good as I can;
I want to trigger a script whenever there is a new computer added to a Organizational Unit.
To do this i need to activate the logging of this event under the local security policy/audit policy. I guess my question is, do I need to do this on all the domain controllers, or is it enough to do it one just one?
Also, is it possible to see the event from a member server with the Management Tools pack installed? As I don't want to put too much work on the Domain Controllers.
Here is the Microsoft article that gives 4 ways of tracking changes in Microsoft Active-Directory. You will find everything you need from configuring the eventlog to receiving notifications by way of different kind of polling.
Is there any realtime API functionality which would allow me to know when an application has been pushed and completed? I didn't see anything in the documentation. Essentially, I'd like to write an add-on that could receive push events and than do something with them (trigger selenium tests, etc).
You can use deploy hooks. The HTTP POST hook is the most versatile one.
I'm trying to write the most basic application for windows phone 7 and want to be able to send files (specifically XML in case that changes anything) to my app. Currently I have a WCF service setup so I can send push notifications through it. The problem is that there is a limit on the amount of raw data I can send via a push notification.
My solution to this is to send the initial push notification (either tile or raw) to alert my application that I want to send a file to it and then make the app somehow communicate with a server (everything is on my personal computer btw - I'm just trying to figure out how things work) - from which the app will recieve/download the files.
What is the easiest way to accomplish this? Note that I'm not concerned with security or anything like that.
Clarification - the question is essentialy: how do I transfer files from/to a server to/from the phone? Assume everything else was handled - the app is up and running and the user has given or will give permissions to every possible thing he may give his permission to.
Unfortunately, the total size of a push notification (including HTTP headers) is 1kb. This means that it can't be used to send large amounts of data.
Instead of sending the whole file, send a notification (raw or toast—as appropriate) which should be treated by the application as a trigger to go and retrieve the new file/data/whatever from the server. It may also be worth checking for new messages when your app starts. However, if when you start the app it will notify the server that it is ready to receive raw notifications and such messages will be sent indicating new content is available, it may be unnecessary to add this extra check.
To transfer files to/from the phone you will need to use either HttpWebRequest or WebClient as this is the only way to use HTTP on the device and HTTP is the only protocol currently available to transfer data.
While WebClient may appear to be easier to use than HttpWebRequest it is less flexible and will automatically perform it's callback on the UI thread and if you're downloading files in the background you almost certainly don't want this.
There is no way to transfer files to/from a conencted PC and have them exclusively available to your app.
First of all: you won't be able to do this approach automatically - the user will have to open your app to do that because WP7 SDK doesn't allow your app to run on background/start automatically once a push notification is received.
The only way to communicate with your server, at this point in time, is web services. If I were you, I would check for new information available once the app is started, if there is new info, I would call one or more web services which would return me all the information that I need.
If you want, you can use a timer to check for information periodically.
As I said, it will only work while your app is running (check the app lifecycle if you don't know it yet), WP7 doesn't allow apps to run in background, that is a serious limitation IMHO.
Good Luck,
Oscar
Maybe a little bit off topic but when I was thinking about file sharing in my WP7 app, I found two approaches:
Integrate an app with Dropbox
Use advanced explorer for WP7
You can use the WebClient class and the DownloadStringAsync method in order to download data from a web service .
A good example of this is Scott Guthrie's Twitter app from MIX10 .
George