-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fcb8d9
commit f2a472c
Showing
13 changed files
with
115 additions
and
106 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
src/org/**/*.class | ||
src/org/json | ||
test/*.class | ||
test/*.jar | ||
target/ | ||
*.ipr | ||
*.iws | ||
*.iml |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<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>org</groupId> | ||
<artifactId>etherpad_lite_client</artifactId> | ||
<version>1.2</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>Etherpad Lite Client</name> | ||
<url>http://github.com/jhollinger/java-etherpad-lite</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.googlecode.json-simple</groupId> | ||
<artifactId>json-simple</artifactId> | ||
<version>1.1.1</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>3.8.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
61 changes: 61 additions & 0 deletions
61
src/test/java/org/etherpad_lite_client/EPLiteClientTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package org.etherpad_lite_client; | ||
|
||
import java.util.List; | ||
import java.util.HashMap; | ||
|
||
import junit.framework.Test; | ||
import junit.framework.TestCase; | ||
import junit.framework.TestSuite; | ||
|
||
/** | ||
* Unit test for simple App. | ||
*/ | ||
public class EPLiteClientTest extends TestCase { | ||
private EPLiteClient client; | ||
|
||
/** | ||
* Create the test case | ||
* | ||
* @param testName name of the test case | ||
*/ | ||
public EPLiteClientTest( String testName ) { | ||
super( testName ); | ||
} | ||
|
||
/** | ||
* @return the suite of tests being tested | ||
*/ | ||
public static Test suite() { | ||
return new TestSuite( EPLiteClientTest.class ); | ||
} | ||
|
||
/** | ||
* Rigourous Testing | ||
*/ | ||
public void testEPLiteClient() { | ||
this.client = new EPLiteClient("http://localhost:9001", "K8OF91QMQYUvrNu3e9rJ7FnnVgaB3m9q"); | ||
assertTrue( this.testPadContents() ); | ||
assertTrue( this.testListAllPads() ); | ||
} | ||
|
||
private boolean testPadContents() { | ||
client.createPad("java_test_pad"); | ||
client.setText("java_test_pad", "foo!!!"); | ||
HashMap pad = client.getText("java_test_pad"); | ||
client.deletePad("java_test_pad"); | ||
|
||
String text = pad.get("text").toString(); | ||
return text.equals("foo!!!\n"); | ||
} | ||
|
||
private boolean testListAllPads() { | ||
client.createPad("java_test_pad_1"); | ||
client.createPad("java_test_pad_2"); | ||
HashMap result = client.listAllPads(); | ||
client.deletePad("java_test_pad_1"); | ||
client.deletePad("java_test_pad_2"); | ||
|
||
List padIDs = (List) result.get("padIDs"); | ||
return padIDs.get(0).equals("java_test_pad_1"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.