This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: related to this Gist: https://gist.github.com/2790685 | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.StringWriter; | |
import java.util.HashSet; | |
import java.util.Set; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.ParserConfigurationException; | |
import javax.xml.transform.OutputKeys; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
:: https://gist.github.com/2789163 | |
del list.txt | |
del list.bak | |
dir /s /b arrest.xml > list.txt | |
::FOR /F "tokens=2,3* delims=^\" %%i in (list.txt) do ( | |
:: ECHO %%i %%j %%k | |
::) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test.ra; | |
/** | |
* TLSGMailer class | |
* INFO: This class sends smtp TLS email via the Gmail service on port 587. | |
* The port for smtp SSL email is 465 and isn't supported by this class. | |
* The POP port for SSL Gmail is 995. | |
* Always use full email address as login id. | |
* AUTHOR: Jon Thor Austen, May 2012 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test.ra; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.nio.MappedByteBuffer; | |
import java.nio.channels.FileChannel; | |
import java.nio.charset.Charset; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this method can be within any of the classes belonging to the | |
// group running from the suite, as configured in your testng.xml file | |
@AfterSuite(alwaysRun = true) | |
public void tearDown() throws Exception { | |
SendResults sr = new SendResults("frommail@gmail.com", "tomail@gmail.com", "Title email", "Message"); | |
sr.sendTestNGResult(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test(groups = {"all"}, dataProvider = "DPMethodAlias", dataProviderClass = DataProviders.class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@DataProvider(name = "DPMethodAlias") // Get A Form | |
public static Object[][] getFromFile() { | |
System.out.println("Loading data provider DPMethodAlias..."); | |
// lastRun is a timestamp value used to find the .tests file | |
File tFile = new File( "test-output/work/" + WSUtils.getTestProperty("lastRun", "testng.config") + ".tests"); | |
FileReader fileReader = null; | |
List<String> lines = new ArrayList<String>(); | |
try { | |
String line = null; | |
fileReader = new FileReader( tFile ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.Cipher | |
import java.security.* | |
import javax.crypto.* | |
// Groovy script | |
class SecurityTests { | |
static void main(String[] args) { | |
for (Provider provider : Security.getProviders()) | |
{ | |
System.out.println("Provider: " + provider.getName()) | |
for (Provider.Service service : provider.getServices() ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set JAVA_HOME1=C:\jdk1.6.0_31 | |
set JAVA_HOME2=C:\jdk1.6.0_16 | |
ECHO Listings from %JAVA_HOME1% | |
groovy.exe --javahome %JAVA_HOME1% SecurityListings.groovy > 31.result.txt | |
ECHO Listings from %JAVA_HOME2% | |
groovy.exe --javahome %JAVA_HOME2% SecurityListings.groovy > 16.result.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
:: SET JAVA_HOME=%JAVA_HOME% | |
SET WDIR=C:\CTemp | |
groovy.exe DirectoryWatcher.groovy %WDIR% | |
pause |