Unit Testing Embedded Glassfish on Cloudbees - glassfish

My REST application loads an embedded Glassfish before executing TestNG tests (actually make HTTP connection to REST resources). My questions are:
If I build the application on Cloudbees, will Jenkins for CI work?
Will Jenkins still run embedded Glassfish over port 8080, and execute tests using the HTTP protocol?

you should not rely hard-coded port 8080 but use a dynamically assigned port (you can use jenkins port allocator plugin). Maven also can provide such a random free port using build-helper plugin if you use it for building.

Related

How to create webpack 'bundle.js' with different websocket port for SpringBootTest

I'm running Spring Boot on the backend on port 8080 and a typescript application in the browser that needs to communicate with the server via WebSocket, also via http://localhost:8080
I also have a #SpringBootTest Selenium Integration Test to test the web app, but currently I am forced to shut down the running development server before running the Selenium Test, because otherwise the test complains that port 8080 is already in use.
I'm using frontend-maven-plugin to bundle the typescript code into bundle.js with webpack --mode production. bundle.js lives inside src/main/resources/static and contains a references to http://localhost:{port} for the websocket. the {port} number is currently replaced inside bundle.js thanks to an environment variable available to webpack during the build of bundle.js.
I'm using maven-surefire-plugin to run the #SpringBootTest.
Now, my question is, how can I have mvn package both:
create the regular bundle.js with port 8080 for use in both development and production,
AND at the same time run the SpringBootTest with port 8081 for both the server and the selenium browser/websocket?
Or, what alternative configuration would you choose to allow you to run the server on port 8080 during development, and sporadically also run the whole mvn clean package without needing to first shut down the development server to avoid getting an error that port 8080 is already in use?

ERR_PROXY_CONNECTION_FAILED when using squid proxy for connection

I have a squid proxy container on my local Docker for Mac (datadog/squid image). Essentially I use this proxy so that app containers on my local docker and the browser pod (Selenium) on another host use the same network for testing (so that the remote browser can access the app host). But with my current setup, when I run my tests the browser starts up on the remote host and then after a bit fails the test. The message on the browser is ERR_PROXY_CONNECTION_FAILED right before it closes. So I assume that there is an issue with my squid proxy config. I use the default config and on the docker hub site it says
Please note that the stock configuration available with the container is set for local access, you may need to tweak it if your network scenario is different.
I'm not really sure how my network scenario is different. What should I be looking into for more information? Thanks!

spy-js not capturing from chrome behind a corporate firewall with a proxy

I am not able to capture any information when starting spy-js on Intellij IDEA 15. I think I'm being defeated by proxies. My setup is as follows:
system:
OS X version 10.10.5
network:
I work behind a corporate firewall with proxy servers. These proxies are set at the system level and also at the bash shell level. HTTP_PROXY, http_proxy, http.proxy etc are all set.
web server: My web server runs on a remote system within the corporate network over port 80
gulp:
I run gulp serve-debug to start my local development web proxy. I use browsersync. So I have my website at localhost:3000, and this maps to some-corp-location/ui
spy-js config:
At the moment, it looks like this (though I've thrashed about and tried many things)
I followed the advice I've found to check chrome://net-internals/#proxy and it never shows the spy-js proxy settings, it always only shows the corporate proxy settings. This is why I'm pretty sure I'm getting burned by proxies. I tried looking at the chrome proxy settings to see if I could disassociate it with the system settings, but it wasn't clear if this would work out or not.

running a trinidad server (for Rails) under authbind?

I have a Rails app using Jruby that I would like to deploy for production. It's using Trinidad. I would like to run as port 80 without using root. Would authbind be a reasonable choice (on Ubuntu)? What's a good way to configure it?
You are running Jruby, ie. using a JVM? authbind intercepts the standard socket library calls (eg. bind() in socket.h). Unfortunately, Java (at least java 1.6+ in my experience) does not use the standard socket libraries, but uses much lower level syscalls, so authbind does not work with Java.
If you want to run tomcat on port ie, either use nginx or apache as a reverse proxy, or use iptables to rewrite the "destination port" on incoming packets. More details in the tomcat FAQ: http://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_privileges.3F

Using Jetty to serve a web application

I am using Jetty for the first time to deploy a GWT web app connecting to a Restlet API and I am trying to understand the best way to use it.
I want to make it embeddable so that I can update config during run-time (allowing me to add new domain names etc).
Our web server currently runs Apache to serve a PHP web app and this will be our first time deploying a GWT app and using Jetty.
Is it possible to use Jetty in parallel with Apache (both serving requests on port 80) and since I am embedding it do I use Apache before it reaches Jetty? So Apache receives request and forwards to Jetty?
Both server cannot run on same port. But you can run both on same machine. So use a separate port for jetty.
Jetty receives the request through its own port and doesn't depend on other server.