Skip to content

Commit

Permalink
Trying to mavenize the project.
Browse files Browse the repository at this point in the history
  • Loading branch information
az3 committed Nov 25, 2016
1 parent c229476 commit 4420b1f
Show file tree
Hide file tree
Showing 29 changed files with 509 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ Then it may be helpful to add a log4j properties setting in your JVM file and yo
To use the utility classes InProcessVoltDBServer and SQLCommandHack (which allow you to run a small VoltDB server instance in process for unit tests or debugging) in your own project, the compile_utils.sh script is provided. It compiles and outputs VoltDBProcedureTestUtils.jar, which can be added to the build path in your own project.

MORE SOON!!!

Note from az3: In the fork, I'm trying to maven-ize the project. Currently tests fail, you can compile it via skipTests option.
```
mvn clean install -DskipTests
```
Binary file removed lib/junit-4.12.jar
Binary file not shown.
221 changes: 221 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
<?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>
<groupId>com.cagricelebi</groupId>
<artifactId>app-debug-and-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.voltdb</groupId>
<artifactId>voltdb</artifactId>
<version>6.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.voltdb</groupId>
<artifactId>voltdbclient</artifactId>
<version>6.8</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>

<!-- Dependencies extracted from VoltDB lib folder -->
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
<version>4.6.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore-nio</artifactId>
<version>4.3.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.3.6.v20151106</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-continuation</artifactId>
<version>9.3.6.v20151106</version>
</dependency>
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>2.10</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.51</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.11</artifactId>
<version>0.8.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>0.8.2.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>net.jpountz.lz4</groupId>
<artifactId>lz4</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>com.yammer.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.aeonbits.owner</groupId>
<artifactId>owner</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>org.aeonbits.owner</groupId>
<artifactId>owner-java8</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.11.5</version>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-parser-combinators_2.11</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-xml_2.11</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.1.7</version>
</dependency>
<dependency>
<groupId>net.sf.supercsv</groupId>
<artifactId>super-csv</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>7.0.40</version>
</dependency>
<!--
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>7.0.40</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.extras</groupId>
<artifactId>tomcat-extras-juli</artifactId>
<version>7.0.41</version>
</dependency>
-->
</dependencies>

</project>
17 changes: 17 additions & 0 deletions src/main/java/com/cagricelebi/voltdb/sample/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.cagricelebi.voltdb.sample;

/**
*
* @author cagricelebi
*/
public class App {

public static void main(String[] args) {
System.out.println("Hi!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.cagricelebi.voltdb.sample.procedure;

import org.json_voltpatches.JSONObject;
import org.voltdb.VoltProcedure;

/**
*
* @author cagricelebi
*/
public class BaseEventProcedure extends VoltProcedure {

protected JSONObject record;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.cagricelebi.voltdb.sample.procedure;

import org.voltdb.SQLStmt;
import org.voltdb.VoltTable;

/**
*
* @author cagricelebi
*/
public class EventOne extends BaseEventProcedure {

protected static final SQLStmt simpleInsertStatement = new SQLStmt("INSERT INTO library (id) VALUES (?);");
protected static final SQLStmt getQuery = new SQLStmt("SELECT * FROM library WHERE id=? LIMIT 1;");

protected VoltTable currentRecord;
protected long uid;

public VoltTable[] run(long uid, String json) throws VoltAbortException {
this.uid = uid;

return new VoltTable[]{};
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ public static void main(String args[]) {
volt.runDDLFromString("create table foo (vz bigint);");
volt.start();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1458,4 +1458,4 @@ private static void openURL()
// ignore any error
}
}
}
}
File renamed without changes.
13 changes: 13 additions & 0 deletions ddl.sql → src/main/resources/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ CREATE PROCEDURE PARTITION ON TABLE demo COLUMN mynum FROM CLASS debugandtest.Pr
CREATE PROCEDURE PARTITION ON TABLE demo COLUMN mynum FROM CLASS debugandtest.ProcB;
CREATE PROCEDURE FROM CLASS debugandtest.Unpack;
CREATE PROCEDURE FROM CLASS debugandtest.BuggyProc;


/*
CREATE TABLE library (
id INTEGER NOT NULL,
val VARCHAR(15),
last_updated TIMESTAMP,
PRIMARY KEY (uid)
);
PARTITION TABLE library ON COLUMN id;
CREATE PROCEDURE PARTITION ON TABLE library COLUMN id FROM CLASS com.cagricelebi.voltdb.sample.procedure.EventOne;
*/
File renamed without changes.
48 changes: 48 additions & 0 deletions src/test/java/com/cagricelebi/voltdb/sample/AppTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.cagricelebi.voltdb.sample;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
*
* @author cagricelebi
*/
public class AppTest {

public AppTest() {
}

@BeforeClass
public static void setUpClass() {
}

@AfterClass
public static void tearDownClass() {
}

@Before
public void setUp() {
}

@After
public void tearDown() {
}

/**
* Test of main method, of class App.
*/
@Test
public void testMain() {
System.out.println("Hi test!");
}

}
Loading

0 comments on commit 4420b1f

Please sign in to comment.