-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from moaxcp/fix-plugins
Fix plugins
- Loading branch information
Showing
15 changed files
with
137 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
19 changes: 19 additions & 0 deletions
19
src/integrationTest/java/com/github/moaxcp/x11client/QueryVersionIT.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,19 @@ | ||
package com.github.moaxcp.x11client; | ||
|
||
import com.github.moaxcp.x11client.protocol.record.QueryVersion; | ||
import com.github.moaxcp.x11client.protocol.record.QueryVersionReply; | ||
import java.io.IOException; | ||
import lombok.extern.java.Log; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@Log | ||
public class QueryVersionIT { | ||
@Test | ||
void record() throws IOException { | ||
try (X11Client client = X11Client.connect()) { | ||
QueryVersion queryVersion = QueryVersion.builder().majorVersion((short) 1).minorVersion((short) 13).build(); | ||
QueryVersionReply reply = client.send(queryVersion); | ||
log.info(reply.toString()); | ||
} | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
src/integrationTest/java/com/github/moaxcp/x11client/RecordIT.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,60 @@ | ||
package com.github.moaxcp.x11client; | ||
|
||
import com.github.moaxcp.x11client.protocol.record.*; | ||
import lombok.extern.java.Log; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
import java.util.Collections; | ||
|
||
@Log | ||
public class RecordIT { | ||
@Test | ||
void test() { | ||
try (X11Client client = X11Client.connect()) { | ||
int rc = client.nextResourceId(); | ||
Range8 empty = Range8.builder().build(); | ||
ExtRange emptyExtRange = ExtRange.builder() | ||
.major(empty) | ||
.minor(Range16.builder().build()) | ||
.build(); | ||
Range range = Range.builder() | ||
.deviceEvents(Range8.builder().first((byte) 2).last((byte) 6).build()) | ||
.coreRequests(empty) | ||
.coreReplies(empty) | ||
.extRequests(emptyExtRange) | ||
.extReplies(emptyExtRange) | ||
.deliveredEvents(empty) | ||
.clientStarted(false) | ||
.errors(empty) | ||
.clientDied(false) | ||
.build(); | ||
|
||
CreateContext createContext = CreateContext.builder() | ||
.context(rc) | ||
.clientSpecs(Collections.singletonList(Cs.ALL_CLIENTS.getValue())) | ||
.elementHeader((byte) 0) | ||
.ranges(Collections.singletonList(range)) | ||
.build(); | ||
|
||
log.info(String.format("createContext: %s, size: %d, length: %d", createContext, createContext.getSize(), createContext.getLength())); | ||
|
||
client.send(createContext); | ||
|
||
client.sync(); | ||
|
||
EnableContext enableContext = EnableContext | ||
.builder() | ||
.context(rc) | ||
.build(); | ||
EnableContextReply enableContextReply = client.send(enableContext); | ||
if (enableContextReply.getCategory() == 0) { | ||
for (Byte datum : enableContextReply.getData()) { | ||
System.out.println(datum); | ||
} | ||
} | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
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
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