Saturday, October 31, 2015

Grafické zobrazení maven závislostí

Viz http://mvnplugins.fusesource.org/maven/1.4/maven-graph-plugin/index.html

1) do pom.xml přidat

<project>
  <profiles>
  
    <profile>
      <id>graph</id>
      <pluginRepositories>
        <pluginRepository>
          <id>mvnplugins.fusesource.org</id>
          <url>http://mvnplugins.fusesource.org/repo/release</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </pluginRepository>
      </pluginRepositories>
      <build>
        <plugins>
          <plugin>
            <groupId>org.fusesource.mvnplugins</groupId>
            <artifactId>maven-graph-plugin</artifactId>
            <version>1.4</version>
          </plugin>
        </plugins>
      </build>
    </profile>
    
  </profiles>
</project> 
 
2) Nainstalovat graphviz
 
(Ubuntu 14.04) sudo apt-get install graphviz 
 
3) spustit 
 
$ mvn -P graph graph:project
 -- OR --
$ mvn -P graph graph:reactor
 
$ mvn -P graph graph:reactor -Dhide-scope=test -Dhide-optional=true 

Automatizované testy

Fitnesse

http://fitnesse.s3.amazonaws.com/tdd_net_with_fitnesse.pdf

Video Intro:
http://vimeo.com/3323573

Programování slim fixture:
http://butunclebob.com/FitNesse.UserGuide.FixtureCode

AutoIt

https://www.autoitscript.com/wiki/Best_coding_practices

Seznam užitečných knihoven

Zde jsem nalezl řešení pro naši úlohu vzdáleného volání mezi Fitnesse a AutoIt.

https://www.autoitscript.com/wiki/User_Defined_Functions

Napojení na Oracle


http://www.autoitscript.com/forum/topic/37381-connect-oracle/

JSON v AutoIt

Knihovna
http://www.autoitscript.com/forum/topic/148114-jsmn-a-non-strict-json-udf/


Zkoušel jsem také, ale moc to nefungovalo -
http://www.autoitscript.com/forum/topic/104150-json-udf-library-fully-rfc4627-compliant/
Upozornění:
- bez úpravy mi knihovna nefungovala, musel jsem:
1) V notepad++ jsem změnil kódování na UTF-8 bez BOM


HTTP v AutoIt

Client
http://brugbart.com/http-post-request-autoit
http://brugbart.com/http-get-request-autoit

Server
http://www.autoitscript.com/forum/topic/68851-powerful-http-server-in-pure-autoit/ - tento jsem použil jako základ pro implementaci RESTful service na testované straně
https://code.google.com/p/autoit-winhttp/downloads/list
http://www.autoitscript.com/forum/topic/26213-my-web-server-v01a/

WebSphere Applcation Server - how to get J2C authentication alias in Java code



Sometimes I need securely connect to external system from WebSphere Application server application. The secure connection usualy requires password as a credential. The WebSphere Application Server allows store the username and password inside its configuration as so called J2C Authentication Alias. If I need use the cofigured J2C Auth Alias I can use the following Java code fragment:

 public static final String USERNAME = "username";
 public static final String PASSWORD = "password";

 /** Return username and pasword for specific J2C authentication alias
  *
  * @param authenticationAlias
  * @return Map with "username" and "password" keys
  * @throws NotImplementedException
  * @throws LoginException
  */
      public Map<String,String> getCredentials(String authenticationAlias) throws NotImplementedException, LoginException {
     Map<String,String> map = new HashMap<String,String>();
     map.put(Constants.MAPPING_ALIAS, authenticationAlias);
     CallbackHandler callbackHandler = WSMappingCallbackHandlerFactory.getInstance().getCallbackHandler(map, null);
     LoginContext loginContext = new LoginContext("DefaultPrincipalMapping", callbackHandler);
     loginContext.login();
     Subject subject = loginContext.getSubject();
     Set credentials = subject.getPrivateCredentials();
     PasswordCredential passwordCredential = (PasswordCredential) credentials.iterator().next();
     String user = passwordCredential.getUserName();
     String password = new String(passwordCredential.getPassword());
     Map<String,String> result = new HashMap<String,String>();
     result.put(USERNAME, user);
     result.put(PASSWORD, password);
     return result;
      }