-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<name>Common</name> | ||
<parent> | ||
<groupId>com.ing</groupId> | ||
<artifactId>ingenious-playwright</artifactId> | ||
<version>1.2</version> | ||
</parent> | ||
<artifactId>Common</artifactId> | ||
<properties> | ||
<file.path.target.POM>${project.parent.basedir}\Resources\Engine\pom.xml</file.path.target.POM> | ||
<file.path.source.POM>${project.parent.basedir}\pom.xml</file.path.source.POM> | ||
<file.path.storyWriter.POM>${project.parent.basedir}\StoryWriter\pom.xml</file.path.storyWriter.POM> | ||
<file.path.datalib.POM>${project.parent.basedir}\Datalib\pom.xml</file.path.datalib.POM> | ||
<file.path.testdata.POM>${project.parent.basedir}\TestData - Csv\pom.xml</file.path.testdata.POM> | ||
<file.path.engine.POM>${project.parent.basedir}\Engine\pom.xml</file.path.engine.POM> | ||
<file.path.ide.POM>${project.parent.basedir}\IDE\pom.xml</file.path.ide.POM> | ||
|
||
</properties> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
<configuration> | ||
<source>11</source> | ||
<target>11</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.6.0</version> | ||
<executions> | ||
<execution> | ||
<id>generate-merged-pom</id> | ||
<phase>compile</phase> | ||
<goals> | ||
<goal>java</goal> | ||
</goals> | ||
<configuration> | ||
<mainClass>com.ing.parent.createParentPOM</mainClass> | ||
<arguments> | ||
<argument>${file.path.target.POM}</argument> | ||
<argument>${file.path.source.POM}</argument> | ||
<argument>${file.path.storyWriter.POM}</argument> | ||
<argument>${file.path.datalib.POM}</argument> | ||
<argument>${file.path.testdata.POM}</argument> | ||
<argument>${file.path.engine.POM}</argument> | ||
<argument>${file.path.ide.POM}</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencies> | ||
|
||
</dependencies> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
package com.ing.parent; | ||
|
||
import java.io.File; | ||
import java.io.FileWriter; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
import java.util.HashSet; | ||
import javax.xml.XMLConstants; | ||
import javax.xml.parsers.DocumentBuilder; | ||
import javax.xml.parsers.DocumentBuilderFactory; | ||
import javax.xml.parsers.ParserConfigurationException; | ||
import javax.xml.transform.Transformer; | ||
import javax.xml.transform.TransformerException; | ||
import javax.xml.transform.TransformerFactory; | ||
import javax.xml.transform.dom.DOMSource; | ||
import javax.xml.transform.stream.StreamResult; | ||
import javax.xml.xpath.XPath; | ||
import javax.xml.xpath.XPathConstants; | ||
import javax.xml.xpath.XPathExpression; | ||
import javax.xml.xpath.XPathExpressionException; | ||
import javax.xml.xpath.XPathFactory; | ||
import org.w3c.dom.Document; | ||
import org.w3c.dom.Element; | ||
import org.w3c.dom.Node; | ||
import org.w3c.dom.NodeList; | ||
import org.xml.sax.SAXException; | ||
|
||
public class createParentPOM { | ||
|
||
public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException { | ||
try { | ||
//Get target pom and source pom for properties | ||
String targetPath = args[0]; | ||
System.out.println("Target Path (Copy to)" + targetPath); | ||
String propertiesSourcePath = args[1]; | ||
System.out.println("Properties Source Path (Copy to)" + propertiesSourcePath); | ||
|
||
//copy properties from main pom to target pom | ||
String sourcePomContent = Files.readString(Paths.get(propertiesSourcePath)); | ||
String[] pomSections = sourcePomContent.split("<properties>|</properties>"); | ||
String propertiesContent = pomSections[1]; | ||
String destinationPomContent = Files.readString(Paths.get(targetPath)); | ||
pomSections = destinationPomContent.split("<properties>|</properties>"); | ||
String updatedDestinationPomContent = destinationPomContent.replace(pomSections[1], propertiesContent); | ||
Files.write(Paths.get(targetPath), updatedDestinationPomContent.getBytes()); | ||
System.out.println("Properties copied successfully!"); | ||
String targetPomPath = targetPath; | ||
|
||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); | ||
DocumentBuilder document = dbFactory.newDocumentBuilder(); | ||
TransformerFactory transformerFactory = TransformerFactory.newInstance(); | ||
Transformer transformer = transformerFactory.newTransformer(); | ||
|
||
//copy dependencies from modules pom to target pom | ||
for (int i = 2; i < args.length; i++) { | ||
|
||
String sourcePath = args[i]; | ||
System.out.println("Source Path (Copy from)" + sourcePath); | ||
String sourcePomPath = sourcePath; | ||
|
||
// Load source pom.xml file | ||
// DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); | ||
//DocumentBuilder document = dbFactory.newDocumentBuilder(); | ||
//TransformerFactory transformerFactory = TransformerFactory.newInstance(); | ||
//Transformer transformer = transformerFactory.newTransformer(); | ||
//Formatting of XML | ||
Document doc = document.parse(new File(sourcePomPath)); | ||
NodeList dependencyList = doc.getElementsByTagName("dependency"); | ||
|
||
// Create a new document for the target pom.xml file | ||
Document targetDocument = document.parse(new File(targetPomPath)); | ||
Element dependenciesTag = (Element) targetDocument.getElementsByTagName("dependencies").item(0); | ||
|
||
// Copy specific tags from source to target document | ||
for (int j = 0; j < dependencyList.getLength(); j++) { | ||
Node dependency = dependencyList.item(j); | ||
Node copiedNode = targetDocument.importNode(dependency, true); | ||
dependenciesTag.appendChild(copiedNode); | ||
} | ||
|
||
// Write the target pom.xml document to file | ||
transformer.transform(new DOMSource(targetDocument), new StreamResult(new File(targetPomPath))); | ||
|
||
System.out.println("Tags copied from " + sourcePath + " to " + targetPath); | ||
} | ||
//Remove Duplicate dependency | ||
Document finalPom = document.parse(new File(targetPomPath)); | ||
Element finalDependenciesTag = (Element) finalPom.getElementsByTagName("dependencies").item(0); | ||
NodeList finalDependencyList = finalDependenciesTag.getElementsByTagName("dependency"); | ||
HashSet<String> uniqueEntries = new HashSet<>(); | ||
for (int k = finalDependencyList.getLength() - 1; k >= 0; k--) { | ||
Element dependency = (Element) finalDependencyList.item(k); | ||
String entry = ""; | ||
String groupId = dependency.getElementsByTagName("groupId").item(0).getTextContent(); | ||
String artifactId = dependency.getElementsByTagName("artifactId").item(0).getTextContent(); | ||
try{ | ||
String classifier = dependency.getElementsByTagName("classifier").item(0).getTextContent(); | ||
entry = groupId + ":" + artifactId + ":" + classifier; | ||
} | ||
catch(NullPointerException e) | ||
{ | ||
entry = groupId + ":" + artifactId; | ||
} | ||
// If the entry already exists, remove the duplicate dependency | ||
if (uniqueEntries.contains(entry)) { | ||
finalDependenciesTag.removeChild(dependency); | ||
} else { | ||
uniqueEntries.add(entry); | ||
} | ||
} | ||
System.out.println("Duplicate entries removed successfully."); | ||
//Removing engine artifact | ||
XPathFactory xpathFactory = XPathFactory.newInstance(); | ||
XPath xpath = xpathFactory.newXPath(); | ||
String artifactId = "ingenious-engine"; | ||
|
||
XPathExpression expression = xpath.compile("//dependency[artifactId='" + artifactId + "']"); | ||
NodeList dependencyNodes = (NodeList) expression.evaluate(finalPom, XPathConstants.NODESET); | ||
for (int i = 0; i < dependencyNodes.getLength(); i++) { | ||
Node dependencyNode = dependencyNodes.item(i); | ||
Node parent = dependencyNode.getParentNode(); | ||
parent.removeChild(dependencyNode); | ||
} | ||
// Save the modified POM XML file | ||
transformer.transform(new DOMSource(finalPom), new StreamResult(new File(targetPomPath))); | ||
System.out.println("Removed Engine artifact"); | ||
|
||
} catch (ParserConfigurationException | SAXException | IOException | TransformerException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.ing</groupId> | ||
<artifactId>ingenious-playwright</artifactId> | ||
<version>1.2</version> | ||
</parent> | ||
<artifactId>ingenious-datalib</artifactId> | ||
<packaging>jar</packaging> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
<configuration> | ||
<source>${maven.compiler.source}</source> | ||
<target>${maven.compiler.target}</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-csv</artifactId> | ||
<version>${commonscsv.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-xml</artifactId> | ||
<version>${jackson.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-core</artifactId> | ||
<version>${jackson.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>eu.infomas</groupId> | ||
<artifactId>annotation-detector</artifactId> | ||
<version>${annon.detect}</version> | ||
</dependency> | ||
<!-- https://mvnrepository.com/artifact/org.testng/testng --> | ||
<dependency> | ||
<groupId>org.testng</groupId> | ||
<artifactId>testng</artifactId> | ||
<version>${testng.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<name>Datalib</name> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
package com.ing.datalib.component; | ||
|
||
import com.ing.datalib.undoredo.UndoRedoModel; | ||
|
||
/** | ||
* | ||
* | ||
*/ | ||
public abstract class DataModel extends UndoRedoModel { | ||
|
||
public abstract void loadTableModel(); | ||
|
||
public abstract Boolean rename(String newName); | ||
|
||
public abstract Boolean delete(); | ||
|
||
public abstract Boolean addRow(); | ||
|
||
@Override | ||
public void insertColumnAt(int colIndex, String name, Object[] values) { | ||
throw new UnsupportedOperationException("Not supported yet."); | ||
} | ||
|
||
@Override | ||
public void removeColumn(int colIndex) { | ||
throw new UnsupportedOperationException("Not supported yet."); | ||
} | ||
|
||
} |