Sample Jmeter – HAPI integration

Featured

Tags

,

hapi Jemeter

hapi Jemeter


package org.apache.jmeter.protocol.java.test;

import java.io.IOException;
import java.io.Serializable;
import java.io.StringReader;
import java.util.Iterator;

import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient;
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;

import ca.uhn.hl7v2.DefaultHapiContext;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.HapiContext;
import ca.uhn.hl7v2.app.Connection;
import ca.uhn.hl7v2.hoh.sockets.CustomCertificateTlsSocketFactory;
import ca.uhn.hl7v2.hoh.util.HapiSocketTlsFactoryWrapper;
import ca.uhn.hl7v2.llp.LLPException;
import ca.uhn.hl7v2.llp.MinLowerLayerProtocol;
import ca.uhn.hl7v2.model.Message;
import ca.uhn.hl7v2.util.Hl7InputStreamMessageIterator;

public class SendMLLPTest extends AbstractJavaSamplerClient implements Serializable {

	private static final Logger LOG = LoggingManager.getLoggerForClass();
	
	private static final long serialVersionUID = 1L;
	
    /** The label to store in the sample result. */
    private String label;

    /** The default value of the Label parameter. */
    private static final String LABEL_DEFAULT = "SendMLLPTest";
    
    /** The name used to store the Label parameter. */
    private static final String LABEL_NAME = "Label";
	
    /** The response message to store in the sample result. */
    private String responseMessage;
    /**
     * The default value of the ip parameter.
     */
    public static final String DEFAULT_MLLP_IP_ADDRESS = "10.69.5.164";

    /**
     * The default value of the port parameter.
     */
    public static final long DEFAULT_MLLP_PORT_NUMBER = 7878;
    
    /**
     * The default value of the timeout parameter in milliseconds.
     */
    public static final int DEFAULT_TIMEOUT = 10000;
    
    /**
     * The default value of the certificate parameter.
     */
    public static final String DEFAULT_CERTIFICATE = "C:\\keystores\\client_DIT.jks";
    
    /**
     * The default value of the certificate password parameter.
     */
    public static final String DEFAULT_PASSWORD = "Keys04QA";
    
    private static String eol = System.getProperty("line.separator");
    
    /**
     * The default value of the request parameter that is parameterized for using with JMeter.
     */
    public static final String DEFAULT_REQUEST = "MSH|^~\\&|SendingApplication|SendingFacility|ReceivingApplication|RceivingFacility|20101004143744||QBP^Q22^QBP_Q21|NIST-101004143744188|T|2.5" + eol +
"QPD|IHE PDQ Query|${tcn}_${tcName}|@PID.3.1^${Extension}~@PID.3.4.2^${OID}~@PID.3.4.3^ISO~@PID.5.1^${lName}~@PID.5.2^${fName}~@PID.5.3^${mName}~@PID.5.4^${Sufname}~@PID.5.5^${Prefname}~@PID.5.6^${Degree}~@PID.5.7^${NameType}~@PID.7.1^${BirthTime}~@PID.8.1^${Sex}~@PID.11.1^${StrLAddr}~@PID.11.2^${StrLine2}~@PID.11.3^${City}~@PID.11.4^${Province}~@PID.11.5^${Zip}~@PID.11.6^${Country}~@PID.11.7^${AddrType}~@PID.13.2^${TelUseCode}~@PID.13.4^${Email}~@PID.13.5^${CntrCode}~@PID.13.6^${Area}~@PID.13.7^${LocalNum}~@PID.13.8^${Extens}|" + eol +
"RCP|I";
     
    private int timeout;
    private String ip;
    private long port;
    private String certificate;
    private String password;
    private String request;


    // The name of the sampler
    private String name;

    /** The response message to store in the sample result. */
    private String response;

    /** The default value of the ResponseMessage parameter. */
    private static final String DEFAULT_RESPONSE_MESSAGE = "";
    
    /** The default value of the ResponseMessage parameter. */
    private static final String RESPONSE_MESSAGE_DEFAULT = "";
    
    /** The name used to store the ResponseMessage parameter. */
    private static final String RESPONSE_MESSAGE_NAME = "ResponseMessage";
    
    /** The response code to be stored in the sample result. */
    private String responseCode;
    
    /** The default value of the ResponseCode parameter. */
    private static final String RESPONSE_CODE_DEFAULT = "AA";
    
    /** The name used to store the ResponseCode parameter. */
    private static final String RESPONSE_CODE_NAME = "ResponseCode";
    
    /** The sampler data (shown as Request Data in the Tree display). */
    private String samplerData;

    /** The default value of the SamplerData parameter. */
    private static final String SAMPLER_DATA_DEFAULT = "";

    /** The name used to store the SamplerData parameter. */
    private static final String SAMPLER_DATA_NAME = "SamplerData";
        
    /** Holds the result data (shown as Response Data in the Tree display). */
    private String resultData;

    /** The default value of the ResultData parameter. */
    private static final String RESULT_DATA_DEFAULT = "";

    /** The name used to store the ResultData parameter. */
    private static final String RESULT_DATA_NAME = "ResultData";
    
    /** The success status to be stored in the sample result. */
    private boolean success;

    /** The default value of the Success Status parameter. */
    private static final String SUCCESS_DEFAULT = "OK";

    /** The name used to store the Success Status parameter. */
    private static final String SUCCESS_NAME = "Status";
    
    /**
     * Default constructor for <code>SleepTest</code>.
     *
     * The Java Sampler uses the default constructor to instantiate an instance
     * of the client class.
     */
    public SendMLLPTest() {
        LOG.debug(whoAmI() + "\tConstruct");
    }
    
    /**
     * Do any initialization required by this client. In this case,
     * initialization consists of getting the values of the IP and
     * Port parameters plus other. It is generally recommended to do any
     * initialization such as getting parameter values in the setupTest method
     * rather than the runTest method in order to add as little overhead as
     * possible to the test.
     *
     * @param context
     *            the context to run with. This provides access to
     *            initialization parameters.
     */
    @Override
    public void setupTest(JavaSamplerContext context) {
        if (LOG.isDebugEnabled()) {
            LOG.debug(whoAmI() + "\tsetupTest()");
            listParameters(context);
        }
        timeout = context.getIntParameter("TIMEOUT", DEFAULT_TIMEOUT);
        ip = context.getParameter("IP", DEFAULT_MLLP_IP_ADDRESS);
        port = context.getLongParameter("PORT", DEFAULT_MLLP_PORT_NUMBER);
        certificate = context.getParameter("CERTIFICATE", DEFAULT_CERTIFICATE);
        password = context.getParameter("PASSWORD", DEFAULT_PASSWORD);
        request = context.getParameter("REQUEST", DEFAULT_REQUEST);
        response = context.getParameter("RESPONSE", DEFAULT_RESPONSE_MESSAGE);

        name = context.getParameter(TestElement.NAME);
    }
    
	public static String sendMLLPTest(int timeoutArg, String ipArg, long portNoArg, String certArg, String pwdArg, String reqArg) throws HL7Exception, LLPException, InterruptedException, IOException {

		int timeout = timeoutArg;
		String ip = ipArg;
		long portNo = portNoArg;
		String certif = certArg;
		String parola = pwdArg;
		String request = reqArg;
		String resp = null;
		
		System.setProperty("ca.uhn.hl7v2.app.initiator.timeout", Integer.toString(timeout));

		StringReader reader = new StringReader(request);
		// Create an iterator to iterate over all the messages
		Hl7InputStreamMessageIterator iter = new Hl7InputStreamMessageIterator(
				reader);

		// Create a HapiContext
		HapiContext context = new DefaultHapiContext();
		MinLowerLayerProtocol mllp = new MinLowerLayerProtocol();
		mllp.setCharset("UTF-8");
		context.setLowerLayerProtocol(mllp);

		Connection conn = null;
		 while (iter.hasNext()) {

			if (conn == null) {
				boolean useTls = true;
				long port = portNo;

				CustomCertificateTlsSocketFactory sfac = new CustomCertificateTlsSocketFactory();
				// using jks certificates
				sfac.setKeystoreFilename(certif);
				// default pwd is "Keys04QA"
				sfac.setKeystorePassphrase(parola);
				// Use the following adapter to pass the socket factory to the context
				context.setSocketFactory(new HapiSocketTlsFactoryWrapper(sfac));
				conn = context.newClient(ip, (int) port, useTls);
			}

			try {
								
				//see if timeout has been set
				String time_out = System.getProperty("ca.uhn.hl7v2.app.initiator.timeout");
				if (time_out != null) {
				    try {
				        Integer timeoutMillis = Integer.parseInt(time_out);
				        System.out.println("Setting Initiator timeout to " + timeoutMillis + " ms");
				    }
				    catch (NumberFormatException e) {
				    	System.out.println(time_out + " is not a valid integer - Initiator is using default timeout");
				    }
				}
				
				Message next = iter.next();
		        System.out.println("Request:" + eol + next.toString());
				Message response = conn.getInitiator().sendAndReceive(next);
				System.out.println("Response encoded message is:" + eol + response.toString());
				
		        conn.close();
		        conn = null;
		        
		        context.close();
				resp = response.toString();
				
			} catch (HL7Exception e) {
				System.out.println("Didn't send out this message or didn't properly handled the HL7 message!");
				e.printStackTrace();
				
				// Since we failed, close the connection
				conn.close();
				conn = null;
			}
		}
			return resp;		
	}
	
    /*
     * Utility method to set up all the values
     */
    private void setupValues(JavaSamplerContext context) {

        response = context.getParameter(RESPONSE_MESSAGE_NAME, DEFAULT_RESPONSE_MESSAGE);
        responseCode = context.getParameter(RESPONSE_CODE_NAME, RESPONSE_CODE_DEFAULT);
        responseMessage = context.getParameter(RESPONSE_MESSAGE_NAME, RESPONSE_MESSAGE_DEFAULT);

        success = context.getParameter(SUCCESS_NAME, SUCCESS_DEFAULT).equalsIgnoreCase("OK");

        label = context.getParameter(LABEL_NAME, LABEL_DEFAULT);
        if (label.length() == 0) {
            label = context.getParameter(TestElement.NAME); // default to name of element
        }

        samplerData = context.getParameter(SAMPLER_DATA_NAME, SAMPLER_DATA_DEFAULT);
        resultData = context.getParameter(RESULT_DATA_NAME, RESULT_DATA_DEFAULT);
    }

	@Override
	public SampleResult runTest(JavaSamplerContext context) {
		setupValues(context);
		
		request = context.getParameter("REQUEST", DEFAULT_REQUEST);
		
		SampleResult results = new SampleResult();
        
		results.setSampleLabel(name);      
		results.setSuccessful(success);
        results.setResponseMessage(responseMessage);
        results.setSampleLabel(label);
        
        samplerData = request;
        
        if (samplerData != null && samplerData.length() > 0) {
            results.setSamplerData(samplerData);
        }
        
        // Record sample start time.
        results.sampleStart();
		
		try {
			response = sendMLLPTest(timeout,ip,port,certificate,password,request);			
			resultData = response;
	        if (resultData != null && resultData.length() > 0) {
	            results.setResponseData(resultData, null);
	            results.setDataType(SampleResult.TEXT);
	        }
			results.setSuccessful(success);
	        
			
		} catch (HL7Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (LLPException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InterruptedException e) {
            LOG.warn("JavaTest: interrupted.");
            results.setSuccessful(true);
			e.printStackTrace();
		} catch (IOException e) {
            LOG.error("JavaTest: error during sample", e);
            results.setSuccessful(false);
			e.printStackTrace();
        } finally {
            // Record end time and populate the results.
            results.sampleEnd();
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug(whoAmI() + "\trunTest()" + "\tTime:\t" + results.getTime());
            listParameters(context);
        }

		return results;
	}
	
    /**
     * Provide a list of parameters which this test supports. Any parameter
     * names and associated values returned by this method will appear in the
     * GUI by default so the user doesn't have to remember the exact names. The
     * user can add other parameters which are not listed here. If this method
     * returns null then no parameters will be listed. If the value for some
     * parameter is null then that parameter will be listed in the GUI with an
     * empty value.
     *
     * @return a specification of the parameters used by this test which should
     *         be listed in the GUI, or null if no parameters should be listed.
     */
    @Override
    public Arguments getDefaultParameters() {
        Arguments params = new Arguments();
        params.addArgument(LABEL_NAME, LABEL_DEFAULT);
        params.addArgument("IP", String.valueOf(DEFAULT_MLLP_IP_ADDRESS));
        params.addArgument("PORT", String.valueOf(DEFAULT_MLLP_PORT_NUMBER));
        params.addArgument("TIMEOUT", String.valueOf(DEFAULT_TIMEOUT));
        params.addArgument("CERTIFICATE", String.valueOf(DEFAULT_CERTIFICATE));
        params.addArgument("PASSWORD", String.valueOf(DEFAULT_PASSWORD));
        params.addArgument("REQUEST", String.valueOf(DEFAULT_REQUEST));
        params.addArgument(SUCCESS_NAME, SUCCESS_DEFAULT);
        params.addArgument(RESPONSE_CODE_NAME, RESPONSE_CODE_DEFAULT);
        
        return params;
    }
		
    /**
     * Dump a list of the parameters in this context to the debug log.
     * Should only be called if debug is enabled.
     *
     * @param context
     *            the context which contains the initialization parameters.
     */
    private void listParameters(JavaSamplerContext context) {
        Iterator<String> argsIt = context.getParameterNamesIterator();
        while (argsIt.hasNext()) {
            String name = argsIt.next();
            LOG.debug(name + "=" + context.getParameter(name));
        }
    }
    
    /**
     * Generate a String identifier of this test for debugging purposes.
     * @return a String identifier for this test instance
     */
    private String whoAmI() {
        StringBuilder sb = new StringBuilder();
        sb.append(Thread.currentThread().toString());
        sb.append("@");
        sb.append(Integer.toHexString(hashCode()));
        return sb.toString();
    }
}

Advertisements

Service Level Agreement – a HIAL implementation proposal for eHealth Ontario

Featured

Tags

, , , ,

eHealth Ontario

eHealth Ontario

The SLA is a formal document outlining a service commitment provided by an IT service provider to one or more customers. The Service Level Management mission statement is to “plan, coordinate, negotiate, report and manage the quality of IT services at acceptable cost”.

The scope of the SLA project is to implement an enterprise framework that adapts to changing business priorities and service levels, define clear goals to shape the service offered by the provider, and avoid the back and forth associated with service level disagreements.

SLA benefits include open communication and the ability to manage the customers’ expectations. IT organizations also benefit from a clearer picture of what the users need, the ability to balance and adjust their resources to meet those expectations, as well as explicitly detail the costs associated with any given level of service.

For more details check the following attached PDF document:

pdf-icon

Running soapUI parameterized JUnit tests in parallel

Featured

Tags

,

I’m using JUnit 4.0 in tandem with SoapUI4.0, not just for unit tests, but also for integration or conformance tests. Typically, we iterate over all test cases of a given test suite in a soapUI project and validate each test case.

parallel processing

parallel processing

One article that really inspired me to write this blog is located here: http://hwellmann.blogspot.com/2009/12/running-parameterized-junit-tests-in.html
As soapUI tests are not heavily relying on CPU power on the client machine the increase of performance is significant when running tests in parallel. If running hundreds of such test the performance can increase hundreds of times. This is just a rough estimate and nothing is set in stone.

So, enough with empty words and let’s see how things are working:

Parameterized tests
Structure of a parameterized test class
To mark a test class as a parameterized test, you must first annotate it with @RunWith(Parameterized.class). The class must then provide at least three entities:

1. A static method that generates and returns test data,
2. A single constructor that stores the test data, and
3. A test

In our case instead of using the @RunWith(Parameterized.class) we are going to use the @RunWith(Parallelized.class)without changing anything else in the actual parameterized class. Actually to test the performance is good to have both declarations in the header and comment them alternatively before running the test cases to measure the performance.
So, use the below class as is without making any changes and place the class into the same package as your JUnit test class. Eventually you can change the number of threads from 16 to another number.

public class Parallelized extends Parameterized
{
    
    private static class ThreadPoolScheduler implements RunnerScheduler
    {
        private ExecutorService executor; 
        
        public ThreadPoolScheduler()
        {
            String threads = System.getProperty("junit.parallel.threads", "16");
            int numThreads = Integer.parseInt(threads);
            executor = Executors.newFixedThreadPool(numThreads);
        }
        
        @Override
        public void finished()
        {
            executor.shutdown();
            try
            {
                executor.awaitTermination(10, TimeUnit.MINUTES);
            }
            catch (InterruptedException exc)
            {
                throw new RuntimeException(exc);
            }
        }

        @Override
        public void schedule(Runnable childStatement)
        {
            executor.submit(childStatement);
        }
    }

    public Parallelized(Class klass) throws Throwable
    {
        super(klass);
        setScheduler(new ThreadPoolScheduler());
    }
}

Now the JUnit test class will look something like this:

import static org.junit.Assert.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.apache.xmlbeans.XmlException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.model.support.PropertiesMap;
import com.eviware.soapui.model.testsuite.TestCase;
import com.eviware.soapui.model.testsuite.TestRunner;
import com.eviware.soapui.model.testsuite.TestRunner.Status;
import com.eviware.soapui.model.testsuite.TestSuite;
import com.eviware.soapui.support.SoapUIException;

@RunWith(value = Parameterized.class)
//@RunWith(Parallelized.class)
public class soapUITest { // This is the parameter for each instance of the test.
    private TestSuite suite;

    public soapUITest(TestSuite suite) {
	this.suite = suite;
    }

    @Parameters
    public static Collection getParameters() throws XmlException, IOException, SoapUIException {
	WsdlProject project = new WsdlProject("c://Projects//QA//sometest.xml");
	Collection testSuites = project.getTestSuiteList();
	
	Collection parameters = new ArrayList(testSuites.size());
	for (TestSuite suite : testSuites) {
	    parameters.add(new Object[] {suite});
	 }
	 return parameters;
    }

    @Test
    public void testOneTestSuite() {
	List testCases = suite.getTestCaseList();
		for (TestCase testCase : testCases) {
		    System.out.println("Running SoapUI test [" + testCase.getName() + "]");
		    TestRunner runner2 = testCase.run(new PropertiesMap(), false);
		    assertEquals(Status.FINISHED, runner2.getStatus());
    }
}

Groovy SoapUI Assertion

regularexpression

// Sample Regex
// Regex to find hl7 inthe reponse at lease 10 times : hl7{10,}
// Regex to find email : (“(\\w+@\\w+\\.[A-Za-z]{2,4})”)
// Regex to find various types of phone number: regexChecker(“( [0-9]( |-)?)?(\\(?[0-9]{3}\\)?)(( |-)?[0-9]{3})(( |-)?[0-9]{4})”, Response);

import java.util.regex.*;

def rawResponse = messageExchange.getResponseContent().toString()
def Response = rawResponse.replaceAll(“\\r\\n|\\r|\\n”, “”);
def valString = “45612368.*45612388” // These are two values from the Response

String myRegex = valString
Matcher digitMatcher = Pattern.compile(myRegex).matcher(Response)
boolean eval = digitMatcher.find();

if (eval == true )

{ log.info “Passed”}
else
{ log.info “Failed”}

assert eval == true

Necredinciosul

lacrimi-pocainta

Cred Doamne şi mărturisesc,
Din nou a nu ştiu câta oară
Iertare de păcat să-mi dai 
La fel ca şi odinioară

În neagra-mi chibzuinţă
Meschină şi lumească
Te-am ignorat pe Tine
Şi Pronia Cerească

Lucrat-am zile multe
Bogate, îmbelşugate
Şi când vorbeam de Tine
Te lucram pe la spate

Cu vorbele-mi puţine
Ce Tu le înmulţeşti
Ma rog eu ţie Doamne
O, cât de darnic eşti

M-am sumeţit în faţa Ta
Împins fiind de pierzare
Nesocotitute-am pe Tine
Cel care-mi eşti salvare

Nu-s vrednic să-ţi grăiesc
Şi-n versurile-mi fade
Şă-ţi cer iertare cu-n talant
Ce gândul meu sloboade

Dar după cum vezi nu mai rabd
Tăcerea-ţi e asurzitoare
Căci într-atât eu Ţi-am greşit
Încât şi liniştea mă doare

Iată mă spovedesc în poezie
Şi lumea-ntreagă o să ştie
Necredinciosul
Ce mult rău ţi-a făcut el Ţie

Dan Bârsan

Watch your language

Tags

Dear Google Translator,
I’m writing to you in English and not in Romanian not because you wouldn’t understand what I want to tell you but because my friends, the programmers, who developed your algorithms, prefer to read their daily news in English. I didn’t tell you until now how much I appreciate the job you are doing. You have mastered already 97 distinct languages, being by far the most famous polyglot of all times. Not even ancient Babel compares to you. Also, I appreciate you being so obliging and available every time we are looking for you.

I also admire you because you have detected, at some point in time, that Moldavian and Romanian languages are same and you’ve dropped the false pretended language, giving shit this way to all those politicians claiming the opposite. I’m proud of you because of this. Not many “politically correct” entities, like you, have the courage to do this. For instance your Romanian fellow the Romanian DEX, is full of shit. You know what you should do? You should actually teach some lessons at the Romanian academy of literature. The academicians there are some extremely large guys, actually obese people, who ate too much bullshit while writing their theses. Therefore they can’t move anything, anymore in the field of linguistics and are striving to survive, collecting their large wages from the academy.

I really enjoy spending time with your relative, Ngram Viewer as well. What an individual he is. What a character. He managed to collect information from over 25 million books and more than 5 billion pages. That made him really smart but not as clever as you are. You are still holding the key to solve the mystery of language evolution and the Origin of Language. In 1866, the Linguistic Society of Paris went so far as to ban debates on the subject. The origin of language in the human species is a widely discussed topic today. Despite this, there is no consensus on ultimate origin or age because of the fat politicians ignoring you. But I know you have it in you. You can prove it with the help of some shrewd programmers. I hope you know that I’m not trying to flatter you. You know why I’m saying this, right? I actually beat the saddle so the horse understands. Those fat guys I was telling about might actually read what I’m writing to you and reconsider their position about the Romanian dictionary. You, Google Search and Ngram Viewer are capable of showing the whole world a new perspective of the origin of language. If those fat guys are going to lose their wages because of you, then maybe they’ll reconsider their work and start fixing some obvious gaps in the Romanian dictionary.

For instance you can easily show and tell those fat useless scientists about the number of homonyms that exists in the Romanian language but doesn’t exist in any other language. Romanian language contains over 400 such homonym words. This tells us something about the age of the language if you know how to interpret the different meanings of the same word. Also the Romanian language has lots of interjections pronounced and spelled exactly as the animals pronounce them. We all know that animals don’t lie but those beasts called linguistic scientists do. We find in the Romanian language over 900 monosyllabic, easy to pronounce words. This language simplicity forges over time when people speak their language for over 5000 years without writing it down on paper. They have simply refined it and keep it simple, so it looks like a brilliant diamond today. If you don’t mind I’m going to show you a Romanian poem depicting its own language.

Romanian church in Jerusalem - Mihai Eminescu

Romanian church in Jerusalem – Mihai Eminescu

A treasure is our language that surges
From deep shadows of the past,
Chain of precious stones that scattered
All over our ancient land.

A burning flame is our language
Amidst a people waking
From a deathly sleep, no warning,
Like the brave man of the stories.

Our language is made of songs
From our soul’s deepest desires,
Flash of lighting striking swiftly
Through dark clouds and blue horizons.

Our language is the tongue of bread
When the winds blow through the summer,
Uttered by our forefathers who
Blessed the country through their labour.

Our language is the greenest leaf
Of the everlasting forests,
Gentle river Dniester’s ripples
Hiding starlight bright and shining.

Utter no more bitter cries now
That your language is too poor,
And you will see with what abundance
Flow the words of our precious country.

Our language is full of legends,
Stories from the days of old.
Reading one and then another
Makes one shudder, tremble and moan.

Our language is singled out
To lift praises up to heaven,
Uttering with constant fervour
Truths that never cease to beckon.

Our language is more than holy,
Words of homilies of old
Wept and sung perpetually
In the homesteads of our folks.

Resurrect now this our language,
Rusted through the years that have passed,
Wipe off filth and mould that gathered
When forgotten through our land.

Gather now the sparkling stone,
Catching bright light from the sun.
You will see the endless flooding
Of new words that overflow.

A treasure will spring up swiftly
From deep shadows of the past,
Chain of precious stones that scattered
All over our ancient land.

In the end I would like to thank you again Google for everything you already did for us. It’s not going to take long until people will realize how many lies have been told about their language, history and customs. You helped us making huge leaps, coming from the medieval ages to the times of the modern era. Now space is the final frontier. These are the voyages of the Romanian DEX. Its five-thousand years mission: to explore strange new words, to seek out new forms and new civilizations, to boldly go where no language has gone before.
Cheers,
Yours Truly, Dan

Open Services Gateway initiative – OSGi

Tags

,

Alianţa OSGi este un consorţiu internaţional de inovatori in domeniul tehnologiei software. Acest grup promovează un proces matur si fiabil care asigură interoperabilitatea aplicaţiilor şi servicilor. Interoperabilitatea se realizeaza pe baza unei platfome de integrare a componentelor. Platforma de servicii OSGi este distribuită în multe aplicaţii şi servicii ale companiilor de top cât şi pe diverse pieţe din industria informatică. Astfel piaţa telefoniei mobile cea a automatizărilor sau piaţa telecomunicaţiilor sunt câteva dintre industriile care folosesc această tehnologie.

Pentru parcurgerea acestui material sunt necesare cunoştinţe prealabile din disciplinele de programare: Programarea în limbajul Java.

pdf-icon
Tehnologia OSGi

Inspirat de Iustin Pârvu

Tags

,

PARINTELE IUSTIN – “Cuvânt cu putere multă” despre PERVERTIREA ROMÂNILOR: “Omul nostru se lasă minţit, cauta senzaţionalul, dacă un lucru nu i se prezintă ca iesit din comun, umflat, mincinos, nici nu-l ia în seamă”. “Nenorocirea este că întotdeauna ţara noastră a fost repartizată să fie dirijată de oameni fără inimă. Au o inimă, dar e o inimă secătuită, o inimă din material plastic… Păi numai numele mai e de român, că românul nu mai este, săracul, s-a pierdut… Şi Europa, la ora actuală, este o mare Rusie. Nu putem să vorbim altfel, că este acelaşi lucru”

Parintele Iustin Parvu si Monahii

Parintele Iustin Parvu si Monahii

Inspirat de Iustin Pârvu

Nenorocirea este că întotdeauna,
ţara noastră a fost repartizată,
puterilor, ca să fie dirijată,
de oameni fără inima curată.

De fapt ei au o inimă,
dar e o inimă secătuită,
o inimă din plastic sluţită,
de dragoste de neam părăsită.

Numai numele-l mai au de român,
că românul din ei nu mai este,
săracul, s-a pierdut sufleteşte,
el neamul nu-şi mai ocroteşte.

Europa a ajuns la ora actuală,
asemenea Rusiei, un mare imperiu,
Nu putem să facem alt comentariu,
este acelaşi lucru derizoriu.

Tinerii noştri termină şcoala,
şi nu au alte gânduri decât,
să plece-n străinătate numaidecât,
slugă la străini pe orişicât.

Ei nu se gândesc că pământul ăsta,
este aşa bogat, frumos, şi fertil,
încât s-ar putea apuca posibil,
să facă agricultură profitabil.

Bine măi, dar voi sunteţi de aici,
părinţii voştri v-au ţinut la şcoală,
de-aţi învăţat, şi-o socoteală,
O facultate, un doctorat şi o morală.

Cum îi laşi pe toţi ai nimănui aici?
Care este rostul tău în viaţă?
Să te aşezi numai tu în faţă?
Si pentru aproape, o inimă de gheaţă.

Iubeşte-l pe aproapele tău,
ca pe tine însuţi să-l iubeşti!
Asta-i porunca, să pleci dacă doreşti,
în lume, la străini să argăţeşti.

versificarea Dan Bârsan

Interviu transcris după filmul “Cuvânt cu putere multă”: http://www.cuvantul-ortodox.ro/2013/07/04/parintele-iustin-cuvant-cu-putere-multa-video/

Mintea de metal

Tags

,

Mintea de metal

Această minte de metal,
dezvoltată de lumea actuală,
este noua deghizare morală,
a demonicului mental.

Este ceva cu care noi, creştinii,
ne-am mai confruntat până acum,
şi fiecare generaţie oricum,
sa confruntat la vremea ei cu opinii.

Dar am aflat modele potrivite,
de contracarare a acţiunii demonice,
care se impune cu forţe diabolice,
asupra minţii omeneşti ademenite.

versificarea Dan Bârsan

Inspirat după articolul lui Paul Cocei: http://www.crestinortodox.ro/editoriale/mintea-metal-142213.html

Running SoapUI Standard version with DataSource and DataLoop groovy

Tags

, ,

soapUI_groovy
Running SoapUI Standard version with DataSource and DataLoop groovy

This is what goes into the DataSource groovy file.


/*
@Author : Dan Birsan
@Description : Data Source to read .csv file and pass the value to corresponding property.
@GroovyTestStepName : "DataSource"
*/

import com.eviware.soapui.support.XmlHolder
def myTestCase = context.testCase
def counter,next,previous,size
File tickerEnumFile = new File("T:\\Dan\\FTC HL7 - UC8 Test Data 2014-05-21 Random_2.csv")
//make sure input.txt file already exists and contains different set of values sepearted by new line (CR).
List lines = tickerEnumFile.readLines()
size = lines.size.toInteger()
propTestStep = myTestCase.getTestStepByName("Properties") // get the Property TestStep
propTestStep.setPropertyValue("Total", size.toString())
counter = propTestStep.getPropertyValue("Count").toString()
counter= counter.toInteger()
next = (counter &gt; size-2? 0: counter+1)
tempValue = lines[counter]

//Split the first line into a string array and assign the array elements to various test case properties
String[] propData = tempValue.split(",")

propTestStep.setPropertyValue("HL7EventType", propData[0])
propTestStep.setPropertyValue("SendingFacility", propData[2])
propTestStep.setPropertyValue("memIDNum", propData[4])
propTestStep.setPropertyValue("PatientIDAssigningAuthority1", propData[5])
propTestStep.setPropertyValue("PatientIDAssigningAuthority2", propData[8])
propTestStep.setPropertyValue("PatientIDAssigningAuthority3", propData[12])
propTestStep.setPropertyValue("PID", propData[7])
propTestStep.setPropertyValue("PIDType", propData[11])
propTestStep.setPropertyValue("Surname", propData[13])
propTestStep.setPropertyValue("Givename", propData[14])
propTestStep.setPropertyValue("DOB", propData[15])
propTestStep.setPropertyValue("Gender", propData[16])
propTestStep.setPropertyValue("StreetAddress", propData[17])
propTestStep.setPropertyValue("City", propData[18])
propTestStep.setPropertyValue("State", propData[19])
propTestStep.setPropertyValue("PostalCode", propData[20])
propTestStep.setPropertyValue("Telephone", propData[21])
propTestStep.setPropertyValue("AreaCode", propData[22])
propTestStep.setPropertyValue("PID_OID", propData[23])

propTestStep.setPropertyValue("Count", next.toString())
next++
// log.info "Reading line : ${(counter+1)} / $lines.size"
propTestStep.setPropertyValue("Next", next.toString())
// log.info "Value '$tempValue' -- updated in $propTestStep.name"
if (counter == size-1)
{
propTestStep.setPropertyValue("StopLoop", "T")
// log.info "Setting the stoploop property now..."
}
else if (counter==0)
{
def runner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testRunner.testCase, null)
propTestStep.setPropertyValue("StopLoop", "F")
}
else
{
propTestStep.setPropertyValue("StopLoop", "F")
}

And this is what goes into the DataLoop groovy file.


/*
@Author : Dan Birsan
@Description : Data Source Looper responsible for looping a specific teststep.
@GroovyTestStepName : "DataLoop"
*/

def myTestCase = context.testCase
def runner
propTestStep = myTestCase.getTestStepByName("Properties") // get the Property TestStep
endLoop = propTestStep.getPropertyValue("StopLoop").toString()

if (endLoop.toString() == "T" || endLoop.toString()=="True" || endLoop.toString()=="true")
{
 log.info ("Exit Groovy Data Source Looper")
 assert true
}
else
{
 testRunner.gotoStepByName("DataSource") //setStartStep
}

Mandatory Elements Required to Create a TCO Assessment

Tags

,

Total Cost of Ownership

Total Cost of Ownership

Regardless of the objective of the analysis, several mandatory elements must be included for the analysis to qualify as a Gartner TCO:
• Identify the domain or activity for which an annual TCO is required (for example, distributed computing, telecommunications or data center), or to make a specific decision, such as, “Will server consolidation really save us money?”
• Develop a chart of accounts, which is a list of cost elements that refers to TCO as
defined above. For IT costs, this must include or evaluate the following:
• Direct cost elements relating to assets or activities that are relevant to the analysis;
for example:
• Client, server, storage and all peripheral hardware costs
• Software and related support costs
• Maintenance and development costs
• Networking and communications costs
• IT operations and support costs
• Associated indirect cost elements — for example, labor costs associated with the end user’s use of an asset or activity, and any subsequent downtime involved.
• Ensure that the chart of accounts contains cost elements that satisfy the TCO definition’s criteria for “holistic view” and “enterprise boundaries” — that is, taking a wider view of costs than normally occurs. Rather than simply being concerned about identifying and listing the costs within a specific function or department, the chart of accounts must also contain cost elements or cost categories that could be affected by activities or changes in the domain. For example, the chart of accounts for a help desk TCO may include cost elements outside of IT operations or IT support. Limiting the chart of accounts to cost elements only contained within IT operations is misleading, because help desk users incur a cost in the form of time spent and, thus, opportunity lost. Indirect costs may be associated with other departmental budgets, but they are still part of a properly constructed TCO. It’s easy to turn a blind eye to such costs — for example, assuming that they’re too small to be relevant, while ignoring the multiplication factor caused by the many individuals who are involved.
• Review the chart of accounts to ensure that all of its elements represent an annualized view of the TCO in question. The chart of accounts should contain details on critical affecting factors (such as depreciation periods) because these will significantly affect any annualized view.
• Review all chart-of-accounts elements to ensure that critical cost elements have been included and don’t overlap, thus avoiding double counting.
• Collect and validate information regarding the costs and other data required to populate the chart of accounts. Use the enterprise’s financial management system, asset management system and HR records to detail unit costs, and use survey questionnaires to establish people’s use of time.
• Amortize all cost elements in the chart of accounts during a specified time period (such as annual, quarterly and so on). For example, a server with a three-year depreciation period would be included in the chart of accounts as one-third of the total server cost.

pdf-icon