RSS

Monthly Archives: October 2012

Jmeter for Create users in LDAP


Download Jmeter project here. You have to change the configuration parameters in this project and put the thread count as your need.

 
Leave a comment

Posted by on October 23, 2012 in wso2

 

Tags: , ,

XACML Conformance Policies Testing in WSO2IS


Take this maven project and build it. This is a java client written for XACML Conformance testing, what it does is just read the mapping.txt file and enable the mention policies and send the given request then evaluate the response with expected results.

 
Leave a comment

Posted by on October 23, 2012 in Other

 

Create Multiple XACML policies by changing policy ID


This example is very useful for the wso2is xacml testing. This is just java client for create the multiple policies from one sample policy. Here you can create any number of policies and directly upload it to the WSO2IS by changing the config.properties file under the java client.

Instructions : this is java maven project you can just build it and open it from any IDE

Change the config.properties file according to your settings
Then you can create the multiple policies by running the MultiplePolicyCreator
You can upload the created policies by running the PolicyUploader

Specially: You can replace the sample.xml policy file as you wish and generate the policies according to that

 
Leave a comment

Posted by on October 23, 2012 in java, wso2

 

Tags: , , ,

Read the whole file and return the content without newlines in Java


This is a simple method to read whole file and take as a string without newlines

    public static String readFile(String filename) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader(filename));
        String nextLine = "";
        StringBuffer sb = new StringBuffer();
        while ((nextLine = br.readLine()) != null) {
            sb.append(nextLine);
        }
        //remove newlines
        String newString = sb.toString().replace('\n', ' ');

        return newString;
    }
 
Leave a comment

Posted by on October 17, 2012 in java

 

Tags: , ,

Java Themes with JTattoo


First download the JTattoo.jar and add into your project classpath then you have to put the following code into your main method

public static void main(String []args){
    try {
            //here you can put the selected theme class name in JTattoo
            UIManager.setLookAndFeel("com.jtattoo.plaf.texture.TextureLookAndFeel");

        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(PC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PC.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
}

These are the JTattoo themes

1. TextureLookAndFeel – “com.jtattoo.plaf.texture.TextureLookAndFeel”

2. SmartLookAndFeel – “com.jtattoo.plaf.smart.SmartLookAndFeel”

3. NoireLookAndFeel – “com.jtattoo.plaf.noire.NoireLookAndFeel”

4. AcrylLookAndFeel – “com.jtattoo.plaf.acryl.AcrylLookAndFeel”

5. AeroLookAndFeel – “com.jtattoo.plaf.aero.AeroLookAndFeel”

6. AluminiumLookAndFeel – “com.jtattoo.plaf.aluminium.AluminiumLookAndFeel”

7. BernsteinLookAndFeel – “com.jtattoo.plaf.bernstein.BernsteinLookAndFeel”

8. FastLookAndFeel – “com.jtattoo.plaf.fast.FastLookAndFeel”

9. GraphiteLookAndFeel – “com.jtattoo.plaf.graphite.GraphiteLookAndFeel”

10. HiFiLookAndFeel – “com.jtattoo.plaf.hifi.HiFiLookAndFeel”

11. LunaLookAndFeel – “com.jtattoo.plaf.luna.LunaLookAndFeel”

12. McWinLookAndFeel – “com.jtattoo.plaf.mcwin.McWinLookAndFeel”

13. MintLookAndFeel – “com.jtattoo.plaf.mint.MintLookAndFeel”

 
5 Comments

Posted by on October 16, 2012 in java

 

Tags: , , ,

Set Icon in Java Frames


Set the icon image in JFrame – you have to put the following code in to your constructor and change the image path most probably we are using 24 * 24 pixels .png image (here “/images/” is one of my packages)

public void Constuctor(){
    this.setIconImage(new ImageIcon(getClass().getResource("/images/payroll.png")).getImage());
}

Example of Jframe

Set the icon image in JInternalFrame

public void Constuctor(){
     this.setFrameIcon(new ImageIcon(getClass().getResource("/images/Profile-24.png")));
}

Example for JInternalFrame

 
Leave a comment

Posted by on October 16, 2012 in java

 

Tags: , , ,

Consuming a SOAP service using WSO2 API Manager with Consumer Key And Consumer Secret


First you have to follow the Charitha’s blog Consuming a SOAP service using WSO2 API Manager
and create the API for your service.

In the above example its using the given “Access Token” to invoke the API now here what I’m going to explain how to invoke the API using “Access Token” generated by using  “Consumer Key”,”Consumer Secret”

Take the “Consumer Key”,”Consumer Secret” and Encode to Base64 format. You can do this with the following  web site http://www.base64encode.org/ What you have to do is give the  “<Consumer Key>:<Consumer Secret>” as follows and take the encoded value

Download the Jmeter project created for invoke the login API in API manager In this project you have to replace the Authorization value as follows

“Basic<Space>Your Encode Base64 Value” and run the jmeter script then take the “access_token” as follows

This access token you can use to access the API

 
1 Comment

Posted by on October 9, 2012 in wso2

 

Tags: , , ,

 
%d bloggers like this: