repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
gaffo/scumd | src/main/java/com/asolutions/scmsshd/ldap/LDAPProjectAuthorizer.java | // Path: src/main/java/com/asolutions/scmsshd/authenticators/LDAPUsernameResolver.java
// public class LDAPUsernameResolver {
// LDAPBindingProvider provider;
// private String userBase;
// private String matchingElement;
// public LDAPUsernameResolver(LDAPBindingProvider provider, String userBase) {
// this(prov... | import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.authenticators.LDAPUsernameResolver;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolu... | package com.asolutions.scmsshd.ldap;
public class LDAPProjectAuthorizer implements IProjectAuthorizer {
protected final Logger log = LoggerFactory.getLogger(getClass());
private String groupBaseDN;
private String groupSuffix;
private AuthorizationLevel authorizationLevel;
private LDAPBindingProvider binding;
... | // Path: src/main/java/com/asolutions/scmsshd/authenticators/LDAPUsernameResolver.java
// public class LDAPUsernameResolver {
// LDAPBindingProvider provider;
// private String userBase;
// private String matchingElement;
// public LDAPUsernameResolver(LDAPBindingProvider provider, String userBase) {
// this(prov... | throws UnparsableProjectException { |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolutions.s... | package com.asolutions.scmsshd.commands.git;
public class GitSCMCommandHandlerTest extends MockTestCase {
@Test
public void testExecuteWithUploadPack() throws Exception { | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | final FilteredCommand filteredCommand = new FilteredCommand("git-upload-pack", "proj-2/git.git"); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolutions.s... | package com.asolutions.scmsshd.commands.git;
public class GitSCMCommandHandlerTest extends MockTestCase {
@Test
public void testExecuteWithUploadPack() throws Exception {
final FilteredCommand filteredCommand = new FilteredCommand("git-upload-pack", "proj-2/git.git");
final InputStream mockInputStream = con... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | final ISCMCommandHandler mockUploadPackHandler = context.mock(ISCMCommandHandler.class, "mockUploadPackHandler"); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import com.asolutions.MockTestCase;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolutions.s... | package com.asolutions.scmsshd.commands.git;
public class GitSCMCommandHandlerTest extends MockTestCase {
@Test
public void testExecuteWithUploadPack() throws Exception {
final FilteredCommand filteredCommand = new FilteredCommand("git-upload-pack", "proj-2/git.git");
final InputStream mockInputStream = con... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | one(mockUploadPackHandler).execute(filteredCommand, mockInputStream, mockOutputStream, mockErrorStream, mockExitCallback, mockProperties, AuthorizationLevel.AUTH_LEVEL_READ_WRITE); |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/converters/path/regexp/AMatchingGroupPathToProjectNameConverter.java | // Path: src/main/java/com/asolutions/scmsshd/converters/path/IPathToProjectNameConverter.java
// public interface IPathToProjectNameConverter {
//
// public abstract String convert(String toParse)
// throws UnparsableProjectException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProje... | import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.asolutions.scmsshd.converters.path.IPathToProjectNameConverter;
import com.asolutions.scmsshd.sshd.UnparsableProjectException; | package com.asolutions.scmsshd.converters.path.regexp;
public abstract class AMatchingGroupPathToProjectNameConverter implements IPathToProjectNameConverter{
public AMatchingGroupPathToProjectNameConverter() {
super();
}
| // Path: src/main/java/com/asolutions/scmsshd/converters/path/IPathToProjectNameConverter.java
// public interface IPathToProjectNameConverter {
//
// public abstract String convert(String toParse)
// throws UnparsableProjectException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProje... | public String convert(String toParse) throws UnparsableProjectException { |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/authenticators/LDAPBindingProviderTest.java | // Path: src/main/java/com/asolutions/scmsshd/ldap/LDAPBindingProvider.java
// public class LDAPBindingProvider {
// private String lookupUserDN;
// private String lookupUserPassword;
// private String url;
// private boolean promiscuous;
//
// public LDAPBindingProvider(String lookupUserDN, String lookupUserPas... | import static org.junit.Assert.assertEquals;
import java.util.Properties;
import javax.naming.Context;
import org.junit.Test;
import com.asolutions.scmsshd.ldap.LDAPBindingProvider;
import com.asolutions.scmsshd.ssl.PromiscuousSSLSocketFactory; | package com.asolutions.scmsshd.authenticators;
public class LDAPBindingProviderTest {
private static final String PASSWORD = "password";
private static final String USERNAME = "username";
private static final String URL = "ldaps://server.lan";
@Test
public void testGettingPropertiesNonPromiscuous() throws... | // Path: src/main/java/com/asolutions/scmsshd/ldap/LDAPBindingProvider.java
// public class LDAPBindingProvider {
// private String lookupUserDN;
// private String lookupUserPassword;
// private String url;
// private boolean promiscuous;
//
// public LDAPBindingProvider(String lookupUserDN, String lookupUserPas... | LDAPBindingProvider provider = new LDAPBindingProvider(USERNAME, PASSWORD, URL, false); |
gaffo/scumd | src/test/java/com/asolutions/asynchrony/customizations/AsynchronyPathToProjectNameConverterTest.java | // Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectException.java
// public class UnparsableProjectException extends Exception {
//
// private static final long serialVersionUID = 643951700141491862L;
//
// public UnparsableProjectException(String reason) {
// super(reason);
// }
//
// }
| import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.asolutions.scmsshd.sshd.UnparsableProjectException; | package com.asolutions.asynchrony.customizations;
public class AsynchronyPathToProjectNameConverterTest {
@Test
public void testProjectGetter() throws Exception {
assertEquals("proj-2", new AsynchronyPathToProjectNameConverter().convert("'/proj-2/git.git'"));
}
@Test
public void testGetterThrowsUnparsable... | // Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectException.java
// public class UnparsableProjectException extends Exception {
//
// private static final long serialVersionUID = 643951700141491862L;
//
// public UnparsableProjectException(String reason) {
// super(reason);
// }
//
// }
// P... | catch (UnparsableProjectException e){ |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/factories/GitCommandFactoryTest.java | // Path: src/main/java/com/asolutions/scmsshd/commands/filters/git/GitBadCommandFilter.java
// public class GitBadCommandFilter implements IBadCommandFilter {
//
// // private static final Pattern commandFilter = Pattern.compile("^'/*(?P<path>[a-zA-Z0-9][a-zA-Z0-9@._-]*(/[a-zA-Z0-9][a-zA-Z0-9@._-]*)*)'$");
// privat... | import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.asolutions.scmsshd.commands.filters.git.GitBadCommandFilter;
| package com.asolutions.scmsshd.commands.factories;
public class GitCommandFactoryTest {
@Test
public void testUsesCorrectFilterAndFactory() throws Exception {
CommandFactoryBase factory = new GitCommandFactory();
| // Path: src/main/java/com/asolutions/scmsshd/commands/filters/git/GitBadCommandFilter.java
// public class GitBadCommandFilter implements IBadCommandFilter {
//
// // private static final Pattern commandFilter = Pattern.compile("^'/*(?P<path>[a-zA-Z0-9][a-zA-Z0-9@._-]*(/[a-zA-Z0-9][a-zA-Z0-9@._-]*)*)'$");
// privat... | assertEquals(GitBadCommandFilter.class, factory.getBadCommandFilter().getClass());
|
gaffo/scumd | src/main/java/com/asolutions/scmsshd/authenticators/JavaxNamingLDAPAuthLookupProvider.java | // Path: src/main/java/com/asolutions/scmsshd/ldap/ILDAPAuthLookupProvider.java
// public interface ILDAPAuthLookupProvider {
//
// Object provide(String url, String username, String password, boolean promiscuous) throws NamingException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSoc... | import java.util.Properties;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import org.slf4j.Logger;
import org.slf4j.Logge... | package com.asolutions.scmsshd.authenticators;
public class JavaxNamingLDAPAuthLookupProvider implements
ILDAPAuthLookupProvider {
protected final Logger log = LoggerFactory.getLogger(getClass());
public Object provide(String url, String username, String password,
boolean promiscuous) throws NamingExceptio... | // Path: src/main/java/com/asolutions/scmsshd/ldap/ILDAPAuthLookupProvider.java
// public interface ILDAPAuthLookupProvider {
//
// Object provide(String url, String username, String password, boolean promiscuous) throws NamingException;
//
// }
//
// Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSoc... | properties.setProperty("java.naming.ldap.factory.socket", PromiscuousSSLSocketFactory.class.getName()); |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/AllowedCommandChecker.java | // Path: src/main/java/com/asolutions/scmsshd/commands/filters/BadCommandException.java
// public class BadCommandException extends Exception {
//
// private static final long serialVersionUID = 4904880805323643780L;
//
// public BadCommandException(String reason) {
// super(reason);
// }
//
// public BadComma... | import com.asolutions.scmsshd.commands.filters.BadCommandException;
import com.asolutions.scmsshd.commands.filters.git.GitCommandSeamer; | package com.asolutions.scmsshd.commands;
public class AllowedCommandChecker {
private static String commands[] = {"git-upload-pack", "git-receive-pack", };
| // Path: src/main/java/com/asolutions/scmsshd/commands/filters/BadCommandException.java
// public class BadCommandException extends Exception {
//
// private static final long serialVersionUID = 4904880805323643780L;
//
// public BadCommandException(String reason) {
// super(reason);
// }
//
// public BadComma... | public AllowedCommandChecker(String cmd) throws BadCommandException { |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/AllowedCommandChecker.java | // Path: src/main/java/com/asolutions/scmsshd/commands/filters/BadCommandException.java
// public class BadCommandException extends Exception {
//
// private static final long serialVersionUID = 4904880805323643780L;
//
// public BadCommandException(String reason) {
// super(reason);
// }
//
// public BadComma... | import com.asolutions.scmsshd.commands.filters.BadCommandException;
import com.asolutions.scmsshd.commands.filters.git.GitCommandSeamer; | package com.asolutions.scmsshd.commands;
public class AllowedCommandChecker {
private static String commands[] = {"git-upload-pack", "git-receive-pack", };
public AllowedCommandChecker(String cmd) throws BadCommandException { | // Path: src/main/java/com/asolutions/scmsshd/commands/filters/BadCommandException.java
// public class BadCommandException extends Exception {
//
// private static final long serialVersionUID = 4904880805323643780L;
//
// public BadCommandException(String reason) {
// super(reason);
// }
//
// public BadComma... | cmd = new GitCommandSeamer(cmd).toString(); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitUploadPackSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.UploadPack;
import com.aso... | package com.asolutions.scmsshd.commands.git;
public class GitUploadPackSCMCommandHandlerTest extends MockTestCase {
@Test
public void testUploadPackPassesCorrectStuffToJGIT() throws Exception {
final String pathtobasedir = "pathtobasedir";
| // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | final FilteredCommand filteredCommand = new FilteredCommand( |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitUploadPackSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.UploadPack;
import com.aso... | final InputStream mockInputStream = context.mock(InputStream.class);
final OutputStream mockOutputStream = context.mock(OutputStream.class,
"mockOutputStream");
final OutputStream mockErrorStream = context.mock(OutputStream.class,
"mockErrorStream");
final ExitCallback mockExitCallback = context.mock(Ex... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | GitSCMCommandFactory.REPOSITORY_BASE); |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/commands/git/GitUploadPackSCMCommandHandlerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import org.jmock.Expectations;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.UploadPack;
import com.aso... | final Repository mockRepoistory = context.mock(Repository.class);
final File base = new File(pathtobasedir);
final GitUploadPackProvider mockUploadPackProvider = context
.mock(GitUploadPackProvider.class);
final UploadPack mockUploadPack = context.mock(UploadPack.class);
final Properties mockConfig = cont... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | AuthorizationLevel.AUTH_LEVEL_READ_ONLY); |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/factories/GitCommandFactory.java | // Path: src/main/java/com/asolutions/scmsshd/commands/filters/git/GitBadCommandFilter.java
// public class GitBadCommandFilter implements IBadCommandFilter {
//
// // private static final Pattern commandFilter = Pattern.compile("^'/*(?P<path>[a-zA-Z0-9][a-zA-Z0-9@._-]*(/[a-zA-Z0-9][a-zA-Z0-9@._-]*)*)'$");
// privat... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.asolutions.scmsshd.commands.filters.git.GitBadCommandFilter; | package com.asolutions.scmsshd.commands.factories;
public class GitCommandFactory extends CommandFactoryBase {
protected final Logger log = LoggerFactory.getLogger(getClass());
public GitCommandFactory() { | // Path: src/main/java/com/asolutions/scmsshd/commands/filters/git/GitBadCommandFilter.java
// public class GitBadCommandFilter implements IBadCommandFilter {
//
// // private static final Pattern commandFilter = Pattern.compile("^'/*(?P<path>[a-zA-Z0-9][a-zA-Z0-9@._-]*(/[a-zA-Z0-9][a-zA-Z0-9@._-]*)*)'$");
// privat... | setBadCommandFilter(new GitBadCommandFilter()); |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/handlers/ISCMCommandHandler.java | // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;
import org.apache.sshd.server.CommandFactory.ExitCallback;
import com.asolutions.scmsshd.authorizors.AuthorizationLevel;
import com.asolutions.scmsshd.commands.FilteredCommand;
| package com.asolutions.scmsshd.commands.handlers;
public interface ISCMCommandHandler {
void execute(FilteredCommand filteredCommand, InputStream inputStream,
OutputStream outputStream, OutputStream errorStream,
| // Path: src/main/java/com/asolutions/scmsshd/authorizors/AuthorizationLevel.java
// public enum AuthorizationLevel {
// AUTH_LEVEL_READ_ONLY,
// AUTH_LEVEL_READ_WRITE;
// }
//
// Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String com... | ExitCallback exitCallback, Properties configuration, AuthorizationLevel authorizationLevel);
|
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/filters/git/GitBadCommandFilter.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import java.util.regex.Pattern;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
import com.asolutions.scmsshd.commands.filters.IBadCommandFilter; | package com.asolutions.scmsshd.commands.filters.git;
public class GitBadCommandFilter implements IBadCommandFilter {
// private static final Pattern commandFilter = Pattern.compile("^'/*(?P<path>[a-zA-Z0-9][a-zA-Z0-9@._-]*(/[a-zA-Z0-9][a-zA-Z0-9@._-]*)*)'$");
private static final String commandFilter = "^'.+'$";
... | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | public FilteredCommand filterOrThrow(String command) throws BadCommandException { |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/commands/filters/git/GitBadCommandFilter.java | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | import java.util.regex.Pattern;
import com.asolutions.scmsshd.commands.FilteredCommand;
import com.asolutions.scmsshd.commands.filters.BadCommandException;
import com.asolutions.scmsshd.commands.filters.IBadCommandFilter; | package com.asolutions.scmsshd.commands.filters.git;
public class GitBadCommandFilter implements IBadCommandFilter {
// private static final Pattern commandFilter = Pattern.compile("^'/*(?P<path>[a-zA-Z0-9][a-zA-Z0-9@._-]*(/[a-zA-Z0-9][a-zA-Z0-9@._-]*)*)'$");
private static final String commandFilter = "^'.+'$";
... | // Path: src/main/java/com/asolutions/scmsshd/commands/FilteredCommand.java
// public class FilteredCommand {
//
// private String command;
// private String argument;
//
// public FilteredCommand() {
// }
//
// public FilteredCommand(String command, String argument) {
// this.command = command;
/... | public FilteredCommand filterOrThrow(String command) throws BadCommandException { |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/ldap/LDAPProjectAuthorizerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import javax.naming.NamingEnumeration;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.InitialDirContext;
import org.jmock.Expectations;
import org.junit.Before;
impor... | package com.asolutions.scmsshd.ldap;
public class LDAPProjectAuthorizerTest extends MockTestCase {
final private String groupBaseDN = "cn=Groups,DC=ldapserver,DC=lan";
final private String userBaseDN = "cn=User,DC=ldapserver,DC=lan";
private LDAPBindingProvider ldapBinding;
private String usernameToCheck = "m... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | private LDAPUsernameResolver ldapUsernameResolver; |
gaffo/scumd | src/test/java/com/asolutions/scmsshd/ldap/LDAPProjectAuthorizerTest.java | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import javax.naming.NamingEnumeration;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.InitialDirContext;
import org.jmock.Expectations;
import org.junit.Before;
impor... |
final Attributes mockAttrs = context.mock(Attributes.class);
final Attribute mockAttribute = context.mock(Attribute.class);
final NamingEnumeration<?> mockEnum = context.mock(NamingEnumeration.class);
checking(new Expectations(){{
one(ldapUsernameResolver).resolveUserName(usernameToCheck);
will(return... | // Path: src/test/java/com/asolutions/MockTestCase.java
// public class MockTestCase {
//
// protected Mockery context = new JUnit4Mockery();
//
// @Before
// public void setupMockery() {
// context.setImposteriser(ClassImposteriser.INSTANCE);
// }
//
// @After
// public void mockeryAssertIsSatisfied(){
// ... | AuthorizationLevel.AUTH_LEVEL_READ_ONLY, |
threerings/nexus | server/src/main/java/com/threerings/nexus/server/GlobalMap.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DistribUtil.java
// public class DistribUtil
// {
// public static void init (NexusObject object, int id, EventSink sink) {
// object.init(id, sink);
// }
//
// public static void clear (NexusObject object) {
// object.clear();
// ... | import com.threerings.nexus.distrib.DistribUtil;
import com.google.common.collect.Maps; | //
// Nexus Server - server-side support for Nexus distributed application framework
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* A map whose contents are mirrored across all servers in the network.
*/
class GlobalMap<K,V> extends react.RMap<K,V>
{
publi... | // Path: core/src/main/java/com/threerings/nexus/distrib/DistribUtil.java
// public class DistribUtil
// {
// public static void init (NexusObject object, int id, EventSink sink) {
// object.init(id, sink);
// }
//
// public static void clear (NexusObject object) {
// object.clear();
// ... | if (oldValue == DistribUtil.<V>sentinelValue()) { |
threerings/nexus | gwt-server/src/main/java/com/threerings/nexus/server/GWTConnectionManager.java | // Path: gwt-io/src/main/java/com/threerings/nexus/client/GWTClient.java
// public class GWTClient extends NexusClient
// {
// /** The default (root-relative) path at which we will make our WebSocket connections. */
// public static final String DEFAULT_WS_PATH = "/nexusws";
//
// /**
// * Creates a N... | import java.io.File;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.server.handler.ResourceHandler;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
impo... | //
// Nexus GWTServer - server-side support for Nexus GWT/WebSockets services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Handles starting a Jetty server and configuring it to listen for GWTIO WebSocket requests on a
* specified port. For systems that don'... | // Path: gwt-io/src/main/java/com/threerings/nexus/client/GWTClient.java
// public class GWTClient extends NexusClient
// {
// /** The default (root-relative) path at which we will make our WebSocket connections. */
// public static final String DEFAULT_WS_PATH = "/nexusws";
//
// /**
// * Creates a N... | public GWTConnectionManager (SessionManager smgr, Serializer szer, String hostname, int port) { |
threerings/nexus | gwt-server/src/main/java/com/threerings/nexus/server/GWTConnectionManager.java | // Path: gwt-io/src/main/java/com/threerings/nexus/client/GWTClient.java
// public class GWTClient extends NexusClient
// {
// /** The default (root-relative) path at which we will make our WebSocket connections. */
// public static final String DEFAULT_WS_PATH = "/nexusws";
//
// /**
// * Creates a N... | import java.io.File;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.server.handler.ResourceHandler;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
impo... | //
// Nexus GWTServer - server-side support for Nexus GWT/WebSockets services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Handles starting a Jetty server and configuring it to listen for GWTIO WebSocket requests on a
* specified port. For systems that don'... | // Path: gwt-io/src/main/java/com/threerings/nexus/client/GWTClient.java
// public class GWTClient extends NexusClient
// {
// /** The default (root-relative) path at which we will make our WebSocket connections. */
// public static final String DEFAULT_WS_PATH = "/nexusws";
//
// /**
// * Creates a N... | this(smgr, szer, hostname, port, GWTClient.DEFAULT_WS_PATH); |
threerings/nexus | server/src/main/java/com/threerings/nexus/server/EntityContext.java | // Path: core/src/main/java/com/threerings/nexus/util/Log.java
// public static Logger log = new JavaLogger("nexus");
| import java.util.concurrent.Executor;
import static com.threerings.nexus.util.Log.log;
import java.util.ArrayDeque;
import java.util.Queue; | //
// Nexus Server - server-side support for Nexus distributed application framework
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Contains an execution queue for one or more Nexus entities. Distributed events, actions and
* requests are all executed in order... | // Path: core/src/main/java/com/threerings/nexus/util/Log.java
// public static Logger log = new JavaLogger("nexus");
// Path: server/src/main/java/com/threerings/nexus/server/EntityContext.java
import java.util.concurrent.Executor;
import static com.threerings.nexus.util.Log.log;
import java.util.ArrayDeque;
import ... | log.warning("Entity operation failed: " + op, t); |
threerings/nexus | gwt-io/src/main/java/com/threerings/nexus/io/ClientInput.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusService;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.UnsafeNativeLong; | //
// Nexus GWTIO - I/O and network services for Nexus built on GWT and WebSockets
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.io;
/**
* Handles the decoding of an input payload (from the server) into proper values.
*/
class ClientInput extends Streamable.Input
{
pub... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | @Override public <T extends NexusService> DService.Factory<T> readService () { |
threerings/nexus | gwt-io/src/main/java/com/threerings/nexus/io/ClientInput.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusService;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.UnsafeNativeLong; | //
// Nexus GWTIO - I/O and network services for Nexus built on GWT and WebSockets
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.io;
/**
* Handles the decoding of an input payload (from the server) into proper values.
*/
class ClientInput extends Streamable.Input
{
pub... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | @Override public <T extends NexusService> DService.Factory<T> readService () { |
threerings/nexus | gwt-io/src/main/java/com/threerings/nexus/io/ClientOutput.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import com.threerings.nexus.distrib.DService;
import com.google.gwt.lang.LongLib; | //
// Nexus GWTIO - I/O and network services for Nexus built on GWT and WebSockets
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.io;
/**
* Handles the encoding of streamable data into a string payload (for delivery to the server).
*/
class ClientOutput extends Streamable.O... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | @Override public void writeService (DService<?> service) { |
threerings/nexus | core/src/main/java/com/threerings/nexus/distrib/DistribUtil.java | // Path: core/src/main/java/com/threerings/nexus/util/Log.java
// public static Logger log = new JavaLogger("nexus");
| import react.Try;
import static com.threerings.nexus.util.Log.log;
import react.RFuture;
import react.Slot; | //
// Nexus Core - a framework for developing distributed applications
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.distrib;
/**
* Provides access to interfaces that should not be called by normal clients, but which must be
* accessible to the Nexus implementation code, w... | // Path: core/src/main/java/com/threerings/nexus/util/Log.java
// public static Logger log = new JavaLogger("nexus");
// Path: core/src/main/java/com/threerings/nexus/distrib/DistribUtil.java
import react.Try;
import static com.threerings.nexus.util.Log.log;
import react.RFuture;
import react.Slot;
//
// Nexus Core ... | else log.warning("Service call failed", "obj", object, "attr", disp, |
threerings/nexus | server/src/test/java/com/threerings/nexus/server/NexusJavaTest.java | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import com.threerings.nexus.distrib.Action;
import com.threerings.nexus.distrib.Singleton; | //
// Nexus Server - server-side support for Nexus distributed application framework
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
public class NexusJavaTest
{
@Before public void createServer () {
System.setProperty("nexus.safety_checks", "true");
... | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | class EntityA implements Singleton { |
threerings/nexus | server/src/test/java/com/threerings/nexus/server/NexusJavaTest.java | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import com.threerings.nexus.distrib.Action;
import com.threerings.nexus.distrib.Singleton; | //
// Nexus Server - server-side support for Nexus distributed application framework
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
public class NexusJavaTest
{
@Before public void createServer () {
System.setProperty("nexus.safety_checks", "true");
... | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | _server.invoke(EntityA.class, new Action<EntityA>() { |
threerings/nexus | core/src/main/java/com/threerings/nexus/io/Streamable.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusService;
import java.util.Collection;
import java.util.Iterator; | }
return data;
}
/**
* Reads a single value from the input (which must have been written via a call to {@link
* Output#writeValue}).
*/
public <T> T readValue () {
return this.<T>readStreamer().readObject(this);
}
/... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | public abstract <T extends NexusService> DService.Factory<T> readService (); |
threerings/nexus | core/src/main/java/com/threerings/nexus/io/Streamable.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusService;
import java.util.Collection;
import java.util.Iterator; | }
return data;
}
/**
* Reads a single value from the input (which must have been written via a call to {@link
* Output#writeValue}).
*/
public <T> T readValue () {
return this.<T>readStreamer().readObject(this);
}
/... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | public abstract <T extends NexusService> DService.Factory<T> readService (); |
threerings/nexus | jvm-server/src/test/java/com/threerings/nexus/server/SimpleServerTest.java | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.threerings.nexus.distrib.Action;
import com.threerings.nexus.distrib.DValue;
import com.threerings.nexus.distrib.TestObject;
import org.junit.*;
import static org.junit.Assert.*;
import static com.... | //
// Nexus JVMServer - server-side support for Nexus java.nio-based services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Tests basic Nexus server functionality.
*/
public class SimpleServerTest
{
@Before
public void suppressLogging () { | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | log.setWarnOnly(true); |
threerings/nexus | jvm-server/src/test/java/com/threerings/nexus/server/SimpleServerTest.java | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.threerings.nexus.distrib.Action;
import com.threerings.nexus.distrib.DValue;
import com.threerings.nexus.distrib.TestObject;
import org.junit.*;
import static org.junit.Assert.*;
import static com.... | public void testStartupShutdownWithConMgr () throws IOException {
// create a server with a thread pool
NexusConfig config = TestUtil.createTestConfig();
final ExecutorService exec = Executors.newFixedThreadPool(3);
NexusServer server = new NexusServer(config, exec);
// set ... | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | TestObject test = new TestObject(TestUtil.createTestServiceAttr()); |
threerings/nexus | jvm-server/src/test/java/com/threerings/nexus/server/SimpleServerTest.java | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.threerings.nexus.distrib.Action;
import com.threerings.nexus.distrib.DValue;
import com.threerings.nexus.distrib.TestObject;
import org.junit.*;
import static org.junit.Assert.*;
import static com.... |
// run a simple event dispatch through
testEventDispatchAndShutdown(server, new Runnable() {
public void run () {
// since JUnit forcibly terminates the JVM on test completion, wait a few
// milliseconds to give the reader and writer threads time to go away
... | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | test.value.connect(new DValue.Listener<String>() { |
threerings/nexus | jvm-server/src/test/java/com/threerings/nexus/server/SimpleServerTest.java | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.threerings.nexus.distrib.Action;
import com.threerings.nexus.distrib.DValue;
import com.threerings.nexus.distrib.TestObject;
import org.junit.*;
import static org.junit.Assert.*;
import static com.... | });
// now wait for everything to run to completion
TestUtil.awaitTermination(exec);
}
protected void testEventDispatchAndShutdown (NexusServer server, final Runnable onComplete) {
TestObject test = new TestObject(TestUtil.createTestServiceAttr());
server.register(TestO... | // Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
// public abstract class Action<E>
// {
// /** A variant of {@link Action} that can be used when you know that the action will not cross
// * server boundaries. This allows things to be referenced from the enclosing scope <em>when
// *... | server.invoke(TestObject.class, new Action<TestObject>() { |
threerings/nexus | core/src/main/java/com/threerings/nexus/io/AbstractSerializer.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusException;
import com.threerings.nexus.distrib.NexusService; | //
// Nexus Core - a framework for developing distributed applications
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.io;
/**
* A basic {@link Serializer} implementation that handles standard types. This is extended by
* generated serializers to add support for project clas... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | public DService.Factory<?> getServiceFactory (short code) { |
threerings/nexus | core/src/main/java/com/threerings/nexus/io/AbstractSerializer.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusException;
import com.threerings.nexus.distrib.NexusService; | //
// Nexus Core - a framework for developing distributed applications
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.io;
/**
* A basic {@link Serializer} implementation that handles standard types. This is extended by
* generated serializers to add support for project clas... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | public short getServiceCode (Class<? extends NexusService> clazz) { |
threerings/nexus | core/src/main/java/com/threerings/nexus/io/AbstractSerializer.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusException;
import com.threerings.nexus.distrib.NexusService; | return nonNull(_serviceCodes.get(clazz), "Unknown service class ", clazz);
}
// from interface Serializer
public <T> Streamer<T> writeStreamer (Streamable.Output out, T value) {
if (value == null) {
return this.<T>writeClass(out, (short)0); // null streamer has code 0
}
... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | throw new NexusException("Requested to stream unknown type " + vclass); |
threerings/nexus | server/src/main/java/com/threerings/nexus/distrib/Action.java | // Path: core/src/main/java/com/threerings/nexus/util/Log.java
// public static Logger log = new JavaLogger("nexus");
| import static com.threerings.nexus.util.Log.log; | //
// Nexus Server - server-side support for Nexus distributed application framework
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.distrib;
/**
* An action invoked in the context of a Nexus entity. The sender does not block awaiting a
* response. TODO: this needs to become ... | // Path: core/src/main/java/com/threerings/nexus/util/Log.java
// public static Logger log = new JavaLogger("nexus");
// Path: server/src/main/java/com/threerings/nexus/distrib/Action.java
import static com.threerings.nexus.util.Log.log;
//
// Nexus Server - server-side support for Nexus distributed application fram... | log.warning("Dropping action on unknown entity", "eclass", eclass.getName(), "key", key, |
threerings/nexus | jvm-server/src/main/java/com/threerings/nexus/server/JVMConnectionManager.java | // Path: core/src/main/java/com/threerings/nexus/util/Log.java
// public static Logger log = new JavaLogger("nexus");
| import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Lin... | //
// Nexus JVMServer - server-side support for Nexus java.nio-based services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Handles listening for Nexus connections and reading and writing over the sockets. Interacts with
* a {@link SessionManager} to source... | // Path: core/src/main/java/com/threerings/nexus/util/Log.java
// public static Logger log = new JavaLogger("nexus");
// Path: jvm-server/src/main/java/com/threerings/nexus/server/JVMConnectionManager.java
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SelectionKey;
import jav... | log.info("Server listening on " + addr); |
threerings/nexus | gwt-server/src/main/java/com/threerings/nexus/io/ServerOutput.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import com.google.gwt.user.server.Base64Utils;
import com.threerings.nexus.distrib.DService; | _output.appendSeparator();
}
@Override public void writeLong (long value) {
_output._buffer.append('\'').append(Base64Utils.toBase64(value)).append('\'');
_output.appendSeparator();
}
@Override public void writeFloat (float value) {
writeDouble(value);
}
@Overr... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | @Override public void writeService (DService<?> service) { |
threerings/nexus | core/src/main/java/com/threerings/nexus/io/Serializer.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusService; | //
// Nexus Core - a framework for developing distributed applications
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.io;
/**
* An automatically generated class that knows about all {@link Streamable} and
* {@link NexusService} classes that will be used by a client. This is ... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | DService.Factory<?> getServiceFactory (short code); |
threerings/nexus | core/src/main/java/com/threerings/nexus/io/Serializer.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusService; | //
// Nexus Core - a framework for developing distributed applications
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.io;
/**
* An automatically generated class that knows about all {@link Streamable} and
* {@link NexusService} classes that will be used by a client. This is ... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | short getServiceCode (Class<? extends NexusService> clazz); |
threerings/nexus | gwt-server/src/main/java/com/threerings/nexus/io/ServerInput.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import java.util.Iterator;
import java.util.NoSuchElementException;
import com.google.gwt.user.server.Base64Utils;
import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusService; |
@Override public char readChar () {
return (char)readInt();
}
@Override public int readInt () {
return Integer.parseInt(_valiter.next());
}
@Override public long readLong () {
return Base64Utils.longFromBase64(_valiter.next());
}
@Override public float readFloat (... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | @Override public <T extends NexusService> DService.Factory<T> readService () { |
threerings/nexus | gwt-server/src/main/java/com/threerings/nexus/io/ServerInput.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import java.util.Iterator;
import java.util.NoSuchElementException;
import com.google.gwt.user.server.Base64Utils;
import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.NexusService; |
@Override public char readChar () {
return (char)readInt();
}
@Override public int readInt () {
return Integer.parseInt(_valiter.next());
}
@Override public long readLong () {
return Base64Utils.longFromBase64(_valiter.next());
}
@Override public float readFloat (... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | @Override public <T extends NexusService> DService.Factory<T> readService () { |
threerings/nexus | gwt-server/src/main/java/com/threerings/nexus/server/GWTIOJettyServlet.java | // Path: core/src/main/java/com/threerings/nexus/io/Serializer.java
// public interface Serializer
// {
// /** Returns the class assigned the supplied code.
// * @throws NexusException if no class is registered for the supplied code. */
// Class<?> getClass (short code);
//
// /** Returns the streamer... | import org.eclipse.jetty.websocket.api.UpgradeRequest;
import org.eclipse.jetty.websocket.api.UpgradeResponse;
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
import com.threerin... | //
// Nexus GWTServer - server-side support for Nexus GWT/WebSockets services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Wires our GWT/IO into Jetty WebSockets.
*/
public class GWTIOJettyServlet extends WebSocketServlet
{ | // Path: core/src/main/java/com/threerings/nexus/io/Serializer.java
// public interface Serializer
// {
// /** Returns the class assigned the supplied code.
// * @throws NexusException if no class is registered for the supplied code. */
// Class<?> getClass (short code);
//
// /** Returns the streamer... | public GWTIOJettyServlet (SessionManager smgr, Serializer szer) { |
threerings/nexus | jvm-server/src/test/java/com/threerings/nexus/server/TestUtil.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import react.RFuture;
import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.Factory_TestService;
import com.threerings.nexus.distrib.TestService;
import org.junit.Assert; | //
// Nexus JVMServer - server-side support for Nexus java.nio-based services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Test-related utility methods.
*/
public class TestUtil
{
public static NexusConfig createTestConfig () {
Properties props... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | public static DService.Factory<TestService> createTestServiceAttr () { |
threerings/nexus | jvm-server/src/test/java/com/threerings/nexus/server/TestUtil.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import react.RFuture;
import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.Factory_TestService;
import com.threerings.nexus.distrib.TestService;
import org.junit.Assert; | //
// Nexus JVMServer - server-side support for Nexus java.nio-based services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Test-related utility methods.
*/
public class TestUtil
{
public static NexusConfig createTestConfig () {
Properties props... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | public static DService.Factory<TestService> createTestServiceAttr () { |
threerings/nexus | jvm-server/src/test/java/com/threerings/nexus/server/TestUtil.java | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import react.RFuture;
import com.threerings.nexus.distrib.DService;
import com.threerings.nexus.distrib.Factory_TestService;
import com.threerings.nexus.distrib.TestService;
import org.junit.Assert; | //
// Nexus JVMServer - server-side support for Nexus java.nio-based services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Test-related utility methods.
*/
public class TestUtil
{
public static NexusConfig createTestConfig () {
Properties props... | // Path: core/src/main/java/com/threerings/nexus/distrib/DService.java
// public abstract class DService<T extends NexusService> implements DAttribute
// {
// /** Used to create service attributes. */
// public interface Factory<T extends NexusService>
// {
// /** Creates a service attribute with th... | return Factory_TestService.createDispatcher(new TestService () { |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/data/AttributeValueListImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import static com.google.common.base.Preconditions.checkArgument;
import java.util.ArrayList;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeValue;
import com.ojn.gexf4j.core.data.AttributeValueList; | package com.ojn.gexf4j.core.impl.data;
public class AttributeValueListImpl extends ArrayList<AttributeValue> implements AttributeValueList {
private static final long serialVersionUID = 7730475001078826140L;
public AttributeValueListImpl() {
// do nothing
}
@Override | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | public AttributeValueList addValue(Attribute attribute, String value) { |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/Edge.java | // Path: src/main/java/com/ojn/gexf4j/core/viz/Color.java
// public interface Color {
//
// int getR();
// Color setR(int r);
//
// int getG();
// Color setG(int g);
//
// int getB();
// Color setB(int b);
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/viz/EdgeShape.java
// public enum EdgeShape {
//
/... | import com.ojn.gexf4j.core.viz.Color;
import com.ojn.gexf4j.core.viz.EdgeShape; | package com.ojn.gexf4j.core;
public interface Edge extends SlicableDatum<Edge> {
String getId();
Node getSource();
Node getTarget();
Edge setTarget(Node target);
boolean hasLabel();
Edge clearLabel();
String getLabel();
Edge setLabel(String label);
boolean hasWeight();
Edge clearWeight();
float ge... | // Path: src/main/java/com/ojn/gexf4j/core/viz/Color.java
// public interface Color {
//
// int getR();
// Color setR(int r);
//
// int getG();
// Color setG(int g);
//
// int getB();
// Color setB(int b);
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/viz/EdgeShape.java
// public enum EdgeShape {
//
/... | Color getColor(); |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/Edge.java | // Path: src/main/java/com/ojn/gexf4j/core/viz/Color.java
// public interface Color {
//
// int getR();
// Color setR(int r);
//
// int getG();
// Color setG(int g);
//
// int getB();
// Color setB(int b);
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/viz/EdgeShape.java
// public enum EdgeShape {
//
/... | import com.ojn.gexf4j.core.viz.Color;
import com.ojn.gexf4j.core.viz.EdgeShape; | package com.ojn.gexf4j.core;
public interface Edge extends SlicableDatum<Edge> {
String getId();
Node getSource();
Node getTarget();
Edge setTarget(Node target);
boolean hasLabel();
Edge clearLabel();
String getLabel();
Edge setLabel(String label);
boolean hasWeight();
Edge clearWeight();
float ge... | // Path: src/main/java/com/ojn/gexf4j/core/viz/Color.java
// public interface Color {
//
// int getR();
// Color setR(int r);
//
// int getG();
// Color setG(int g);
//
// int getB();
// Color setB(int b);
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/viz/EdgeShape.java
// public enum EdgeShape {
//
/... | EdgeShape getShape(); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/HierarchyPIDBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class HierarchyPIDBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "hierarchyPID";
}
@Override | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | public Gexf buildGexf() { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/HierarchyPIDBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class HierarchyPIDBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "hierarchyPID";
}
@Override
public Gexf buildGexf() { | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | Gexf gexf = new GexfImpl(); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/HierarchyPIDBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class HierarchyPIDBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "hierarchyPID";
}
@Override
public Gexf buildGexf() {
Gexf gexf = new GexfImpl();
gexf.getGraph() | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | .setMode(Mode.STATIC) |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/HierarchyPIDBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class HierarchyPIDBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "hierarchyPID";
}
@Override
public Gexf buildGexf() {
Gexf gexf = new GexfImpl();
gexf.getGraph()
.setMode(Mode.STATIC) | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | .setDefaultEdgeType(EdgeType.DIRECTED); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/HierarchyPIDBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class HierarchyPIDBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "hierarchyPID";
}
@Override
public Gexf buildGexf() {
Gexf gexf = new GexfImpl();
gexf.getGraph()
.setMode(Mode.STATIC)
.setDefaultEdgeType(EdgeType.DIR... | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | Node g = gexf.getGraph().createNode("g"); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/impl/GraphImplTest.java | // Path: src/main/java/com/ojn/gexf4j/core/Graph.java
// public interface Graph extends Dynamic<Graph>, HasNodes {
//
// EdgeType getDefaultEdgeType();
// Graph setDefaultEdgeType(EdgeType edgeType);
//
// IDType getIDType();
// Graph setIDType(IDType idType);
//
// Mode getMode();
// Graph setMode(Mode graph... | import com.ojn.gexf4j.core.Graph;
import com.ojn.gexf4j.core.GraphTest; | package com.ojn.gexf4j.core.impl;
public class GraphImplTest extends GraphTest {
@Override | // Path: src/main/java/com/ojn/gexf4j/core/Graph.java
// public interface Graph extends Dynamic<Graph>, HasNodes {
//
// EdgeType getDefaultEdgeType();
// Graph setDefaultEdgeType(EdgeType edgeType);
//
// IDType getIDType();
// Graph setIDType(IDType idType);
//
// Mode getMode();
// Graph setMode(Mode graph... | protected Graph newGraph() { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/VisualizationBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.impl.GexfImpl;
import com.ojn.gexf4j.core.impl.viz.ColorImpl;
import com.ojn.gexf4j.core.impl.viz.PositionImpl;
import com.ojn.gexf4j.core.viz.NodeShape; | package com.ojn.gexf4j.core.testgraphs;
public class VisualizationBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "viz";
}
@Override | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | public Gexf buildGexf() { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/VisualizationBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.impl.GexfImpl;
import com.ojn.gexf4j.core.impl.viz.ColorImpl;
import com.ojn.gexf4j.core.impl.viz.PositionImpl;
import com.ojn.gexf4j.core.viz.NodeShape; | package com.ojn.gexf4j.core.testgraphs;
public class VisualizationBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "viz";
}
@Override
public Gexf buildGexf() { | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | Gexf gexf = new GexfImpl(); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/impl/StaxGraphWriterTest.java | // Path: src/main/java/com/ojn/gexf4j/core/GexfWriter.java
// public interface GexfWriter {
//
// void writeToStream(Gexf gexf, OutputStream out) throws IOException;
// }
//
// Path: src/test/java/com/ojn/gexf4j/core/GraphWriterTest.java
// @RunWith(Parameterized.class)
// public abstract class GraphWriterTest {
// ... | import com.ojn.gexf4j.core.GexfWriter;
import com.ojn.gexf4j.core.GraphWriterTest;
import com.ojn.gexf4j.core.testgraphs.GexfBuilder; | package com.ojn.gexf4j.core.impl;
public class StaxGraphWriterTest extends GraphWriterTest {
public StaxGraphWriterTest(GexfBuilder builder) {
super(builder);
}
@Override
protected String getFileNamePrefix() {
return "stax";
}
@Override | // Path: src/main/java/com/ojn/gexf4j/core/GexfWriter.java
// public interface GexfWriter {
//
// void writeToStream(Gexf gexf, OutputStream out) throws IOException;
// }
//
// Path: src/test/java/com/ojn/gexf4j/core/GraphWriterTest.java
// @RunWith(Parameterized.class)
// public abstract class GraphWriterTest {
// ... | protected GexfWriter newGraphWriter() { |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/NodeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.viz.NodeShapeImpl;
... | package com.ojn.gexf4j.core.impl;
public class NodeImpl extends SliceableDatumBase<Node> implements Node {
private String id = "";
private String label = ""; | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | private Color color = null; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/NodeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.viz.NodeShapeImpl;
... | package com.ojn.gexf4j.core.impl;
public class NodeImpl extends SliceableDatumBase<Node> implements Node {
private String id = "";
private String label = "";
private Color color = null;
private String pid = null; | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | private Position position = null; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/NodeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.viz.NodeShapeImpl;
... | package com.ojn.gexf4j.core.impl;
public class NodeImpl extends SliceableDatumBase<Node> implements Node {
private String id = "";
private String label = "";
private Color color = null;
private String pid = null;
private Position position = null; | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | private NodeShapeEntity shape = null; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/NodeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.viz.NodeShapeImpl;
... | package com.ojn.gexf4j.core.impl;
public class NodeImpl extends SliceableDatumBase<Node> implements Node {
private String id = "";
private String label = "";
private Color color = null;
private String pid = null;
private Position position = null;
private NodeShapeEntity shape = null;
private float size = Fl... | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | private List<Edge> edges = null; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/NodeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.viz.NodeShapeImpl;
... |
@Override
public Position getPosition() {
checkState(hasPosition(), "Position has not been set.");
return position;
}
@Override
public NodeShapeEntity getShapeEntity() {
return shape;
}
@Override
public float getSize() {
checkState(hasSize(), "Size has not been set.");
return size;
}
@Override
... | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | return (shape.getNodeShape() != NodeShape.NOTSET); |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/GexfImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Graph;
import com.ojn.gexf4j.core.Metadata; | package com.ojn.gexf4j.core.impl;
public class GexfImpl implements Gexf {
private static final String VERSION = "1.1";
private String variant = null; | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | private Graph graph = null; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/GexfImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Graph;
import com.ojn.gexf4j.core.Metadata; | package com.ojn.gexf4j.core.impl;
public class GexfImpl implements Gexf {
private static final String VERSION = "1.1";
private String variant = null;
private Graph graph = null; | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | private Metadata meta = null; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/EdgeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import static com.google.common.base.Preconditions.*;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.viz.Color;
import com.ojn.gexf4j.core.viz.EdgeShape; | package com.ojn.gexf4j.core.impl;
public class EdgeImpl extends SliceableDatumBase<Edge> implements Edge {
private String id = "";
private String label = null; | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | private Node source = null; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/EdgeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import static com.google.common.base.Preconditions.*;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.viz.Color;
import com.ojn.gexf4j.core.viz.EdgeShape; | package com.ojn.gexf4j.core.impl;
public class EdgeImpl extends SliceableDatumBase<Edge> implements Edge {
private String id = "";
private String label = null;
private Node source = null;
private Node target = null; | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | private Color color = null; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/EdgeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import static com.google.common.base.Preconditions.*;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.viz.Color;
import com.ojn.gexf4j.core.viz.EdgeShape; | package com.ojn.gexf4j.core.impl;
public class EdgeImpl extends SliceableDatumBase<Edge> implements Edge {
private String id = "";
private String label = null;
private Node source = null;
private Node target = null;
private Color color = null; | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | private EdgeShape shape = EdgeShape.NOTSET; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/EdgeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import static com.google.common.base.Preconditions.*;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.viz.Color;
import com.ojn.gexf4j.core.viz.EdgeShape; | package com.ojn.gexf4j.core.impl;
public class EdgeImpl extends SliceableDatumBase<Edge> implements Edge {
private String id = "";
private String label = null;
private Node source = null;
private Node target = null;
private Color color = null;
private EdgeShape shape = EdgeShape.NOTSET;
private float thickne... | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | private EdgeType edgeType = EdgeType.UNDIRECTED; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/data/AttributeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.List;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeType;
import com.ojn.gexf4j.core.data.AttributeValue; | package com.ojn.gexf4j.core.impl.data;
public class AttributeImpl implements Attribute {
private String id = "";
private String defaultValue = null; | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | private AttributeType type = AttributeType.STRING; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/data/AttributeImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.List;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeType;
import com.ojn.gexf4j.core.data.AttributeValue; | public List<String> getOptions() {
return options;
}
@Override
public String getTitle() {
return title;
}
@Override
public boolean hasDefaultValue() {
return (defaultValue != null);
}
@Override
public Attribute setDefaultValue(String defaultValue) {
checkArgument(defaultValue != null, "Default Valu... | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | public AttributeValue createValue(String value) { |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/writer/EdgeEntityWriter.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.viz.EdgeShape; | package com.ojn.gexf4j.core.impl.writer;
public class EdgeEntityWriter extends SlicableDatumEntityWriter<Edge> {
private static final String ENTITY = "edge";
private static final String ATTRIB_ID = "id";
private static final String ATTRIB_LABEL = "label";
private static final String ATTRIB_SOURCE = "source";
pr... | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | if (entity.getShape() != EdgeShape.NOTSET) { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/BasicGraphBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Graph;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class BasicGraphBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "basic";
}
@Override | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | public Gexf buildGexf() { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/BasicGraphBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Graph;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class BasicGraphBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "basic";
}
@Override
public Gexf buildGexf() { | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | Gexf gexf = new GexfImpl(); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/BasicGraphBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Graph;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class BasicGraphBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "basic";
}
@Override
public Gexf buildGexf() {
Gexf gexf = new GexfImpl(); | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | Graph g = gexf.getGraph(); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/BasicGraphBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Graph;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class BasicGraphBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "basic";
}
@Override
public Gexf buildGexf() {
Gexf gexf = new GexfImpl();
Graph g = gexf.getGraph();
| // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | Node hello = g.createNode("0") |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/data/AttributeListImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Mode.java
// public enum Mode {
//
// STATIC,
// DYNAMIC,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.Date;
import java.util.UUID;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.Attribute... | package com.ojn.gexf4j.core.impl.data;
public class AttributeListImpl extends ArrayList<Attribute> implements AttributeList {
private static final long serialVersionUID = 8240096318919688740L;
private Date endDate = null;
private Date startDate = null; | // Path: src/main/java/com/ojn/gexf4j/core/Mode.java
// public enum Mode {
//
// STATIC,
// DYNAMIC,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType... | private AttributeClass attrClass = AttributeClass.NODE; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/data/AttributeListImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Mode.java
// public enum Mode {
//
// STATIC,
// DYNAMIC,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.Date;
import java.util.UUID;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.Attribute... | package com.ojn.gexf4j.core.impl.data;
public class AttributeListImpl extends ArrayList<Attribute> implements AttributeList {
private static final long serialVersionUID = 8240096318919688740L;
private Date endDate = null;
private Date startDate = null;
private AttributeClass attrClass = AttributeClass.NODE; | // Path: src/main/java/com/ojn/gexf4j/core/Mode.java
// public enum Mode {
//
// STATIC,
// DYNAMIC,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType... | private Mode mode = Mode.STATIC; |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/data/AttributeListImpl.java | // Path: src/main/java/com/ojn/gexf4j/core/Mode.java
// public enum Mode {
//
// STATIC,
// DYNAMIC,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType... | import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import java.util.ArrayList;
import java.util.Date;
import java.util.UUID;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.Attribute... | public Date getStartDate() {
checkState(startDate != null, "Start Date has not been set.");
return startDate;
}
@Override
public boolean hasEndDate() {
return (endDate != null);
}
@Override
public boolean hasStartDate() {
return (startDate != null);
}
@Override
public AttributeList setEndDate(Date ... | // Path: src/main/java/com/ojn/gexf4j/core/Mode.java
// public enum Mode {
//
// STATIC,
// DYNAMIC,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType... | public Attribute createAttribute(AttributeType type, String title) { |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/data/AttributeList.java | // Path: src/main/java/com/ojn/gexf4j/core/Mode.java
// public enum Mode {
//
// STATIC,
// DYNAMIC,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/dynamic/Dynamic.java
// public interface Dynamic<T extends Object> {
//
// boolean hasStartDate();
// T clearStartDate();
// Date getStartDate();
// T setStart... | import java.util.List;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.dynamic.Dynamic; | package com.ojn.gexf4j.core.data;
public interface AttributeList extends List<Attribute>, Dynamic<AttributeList> {
AttributeClass getAttributeClass();
| // Path: src/main/java/com/ojn/gexf4j/core/Mode.java
// public enum Mode {
//
// STATIC,
// DYNAMIC,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/dynamic/Dynamic.java
// public interface Dynamic<T extends Object> {
//
// boolean hasStartDate();
// T clearStartDate();
// Date getStartDate();
// T setStart... | Mode getMode(); |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/StaxGraphReader.java | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | import java.io.IOException;
import java.io.InputStream;
import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.GexfReader; | package com.ojn.gexf4j.core.impl;
public class StaxGraphReader implements GexfReader {
@Override | // Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVariant();
// Gexf setVariant(String variant);
//
// Metadata getMetadata();
//
// Graph getGraph();
//
// boolean hasVisualization... | public Gexf readFromStream(InputStream in) throws IOException { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/impl/EdgeImplTest.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import java.util.UUID;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.EdgeTest;
import com.ojn.gexf4j.core.Node; | package com.ojn.gexf4j.core.impl;
public class EdgeImplTest extends EdgeTest {
@Override | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | protected Edge newEdge(String id, Node source, Node target) { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/impl/EdgeImplTest.java | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | import java.util.UUID;
import com.ojn.gexf4j.core.Edge;
import com.ojn.gexf4j.core.EdgeTest;
import com.ojn.gexf4j.core.Node; | package com.ojn.gexf4j.core.impl;
public class EdgeImplTest extends EdgeTest {
@Override | // Path: src/main/java/com/ojn/gexf4j/core/Edge.java
// public interface Edge extends SlicableDatum<Edge> {
//
// String getId();
//
// Node getSource();
//
// Node getTarget();
// Edge setTarget(Node target);
//
// boolean hasLabel();
// Edge clearLabel();
// String getLabel();
// Edge setLabel(String l... | protected Edge newEdge(String id, Node source, Node target) { |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/writer/AbstractEntityWriter.java | // Path: src/main/java/com/ojn/gexf4j/core/dynamic/TimeType.java
// public enum TimeType {
//
// DATE,
// FLOAT,
// }
| import static com.google.common.base.Preconditions.checkArgument;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import com.ojn.gexf4j.core.dynamic.TimeType; | package com.ojn.gexf4j.core.impl.writer;
public abstract class AbstractEntityWriter<T extends Object> {
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | // Path: src/main/java/com/ojn/gexf4j/core/dynamic/TimeType.java
// public enum TimeType {
//
// DATE,
// FLOAT,
// }
// Path: src/main/java/com/ojn/gexf4j/core/impl/writer/AbstractEntityWriter.java
import static com.google.common.base.Preconditions.checkArgument;
import java.text.SimpleDateFormat;
import java.uti... | protected static TimeType writerTimeType = TimeType.DATE; |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/impl/data/AttributeImplTest.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeClass;
import com.ojn.gexf4j.core.data.AttributeTest;
import com.ojn.gexf4j.core.data.AttributeType; | package com.ojn.gexf4j.core.impl.data;
public class AttributeImplTest extends AttributeTest {
@Override | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | protected Attribute newAttribute(AttributeType type, String id, AttributeClass attribClass) { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/impl/data/AttributeImplTest.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeClass;
import com.ojn.gexf4j.core.data.AttributeTest;
import com.ojn.gexf4j.core.data.AttributeType; | package com.ojn.gexf4j.core.impl.data;
public class AttributeImplTest extends AttributeTest {
@Override | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | protected Attribute newAttribute(AttributeType type, String id, AttributeClass attribClass) { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/impl/data/AttributeImplTest.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeClass;
import com.ojn.gexf4j.core.data.AttributeTest;
import com.ojn.gexf4j.core.data.AttributeType; | package com.ojn.gexf4j.core.impl.data;
public class AttributeImplTest extends AttributeTest {
@Override | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | protected Attribute newAttribute(AttributeType type, String id, AttributeClass attribClass) { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/EdgeTest.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import java.util.Random;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeClass;
import com.ojn.gexf4j.core.data.AttributeType;
imp... | Node newTarget = newNode();
e.setTarget(newTarget);
assertThat(e.getTarget(), is(equalTo(newTarget)));
}
@Test(expected=IllegalArgumentException.class)
public void setTargetNull() {
e.setTarget(null);
}
@Test
public void setWeight() {
Random rnd = new Random();
float weight = rnd.nextFloat();
... | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | Attribute attrib = new AttributeImpl(AttributeType.STRING, "test", AttributeClass.EDGE); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/EdgeTest.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import java.util.Random;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeClass;
import com.ojn.gexf4j.core.data.AttributeType;
imp... | Node newTarget = newNode();
e.setTarget(newTarget);
assertThat(e.getTarget(), is(equalTo(newTarget)));
}
@Test(expected=IllegalArgumentException.class)
public void setTargetNull() {
e.setTarget(null);
}
@Test
public void setWeight() {
Random rnd = new Random();
float weight = rnd.nextFloat();
... | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | Attribute attrib = new AttributeImpl(AttributeType.STRING, "test", AttributeClass.EDGE); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/EdgeTest.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import java.util.Random;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeClass;
import com.ojn.gexf4j.core.data.AttributeType;
imp... | Node newTarget = newNode();
e.setTarget(newTarget);
assertThat(e.getTarget(), is(equalTo(newTarget)));
}
@Test(expected=IllegalArgumentException.class)
public void setTargetNull() {
e.setTarget(null);
}
@Test
public void setWeight() {
Random rnd = new Random();
float weight = rnd.nextFloat();
... | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | Attribute attrib = new AttributeImpl(AttributeType.STRING, "test", AttributeClass.EDGE); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/EdgeTest.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import java.util.Random;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeClass;
import com.ojn.gexf4j.core.data.AttributeType;
imp... | Node newTarget = newNode();
e.setTarget(newTarget);
assertThat(e.getTarget(), is(equalTo(newTarget)));
}
@Test(expected=IllegalArgumentException.class)
public void setTargetNull() {
e.setTarget(null);
}
@Test
public void setWeight() {
Random rnd = new Random();
float weight = rnd.nextFloat();
... | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | Attribute attrib = new AttributeImpl(AttributeType.STRING, "test", AttributeClass.EDGE); |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/EdgeTest.java | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import java.util.Random;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeClass;
import com.ojn.gexf4j.core.data.AttributeType;
imp... | e.setTarget(newTarget);
assertThat(e.getTarget(), is(equalTo(newTarget)));
}
@Test(expected=IllegalArgumentException.class)
public void setTargetNull() {
e.setTarget(null);
}
@Test
public void setWeight() {
Random rnd = new Random();
float weight = rnd.nextFloat();
e.setWeight(weight);
ass... | // Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
//
// String getId();
//
// String getTitle();
// Attribute setTitle(String title);
//
// AttributeType getAttributeType();
//
// boolean hasDefaultValue();
// Attribute clearDefaultValue();
// String getDefault... | AttributeValue av = attrib.createValue("testing"); |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/writer/GraphEntityWriter.java | // Path: src/main/java/com/ojn/gexf4j/core/Graph.java
// public interface Graph extends Dynamic<Graph>, HasNodes {
//
// EdgeType getDefaultEdgeType();
// Graph setDefaultEdgeType(EdgeType edgeType);
//
// IDType getIDType();
// Graph setIDType(IDType idType);
//
// Mode getMode();
// Graph setMode(Mode graph... | import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import com.ojn.gexf4j.core.Graph;
import com.ojn.gexf4j.core.data.AttributeList; |
@Override
protected String getElementName() {
return ENTITY;
}
@Override
protected void writeAttributes() throws XMLStreamException {
writer.writeAttribute(
ATTRIB_EDGETYPE,
entity.getDefaultEdgeType().toString().toLowerCase());
writer.writeAttribute(
ATTRIB_IDTYPE,
entity.getIDType().to... | // Path: src/main/java/com/ojn/gexf4j/core/Graph.java
// public interface Graph extends Dynamic<Graph>, HasNodes {
//
// EdgeType getDefaultEdgeType();
// Graph setDefaultEdgeType(EdgeType edgeType);
//
// IDType getIDType();
// Graph setIDType(IDType idType);
//
// Mode getMode();
// Graph setMode(Mode graph... | for (AttributeList attList : entity.getAttributeLists()) { |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/GraphReaderTest.java | // Path: src/main/java/com/ojn/gexf4j/core/impl/StaxGraphReader.java
// public class StaxGraphReader implements GexfReader {
//
// @Override
// public Gexf readFromStream(InputStream in) throws IOException {
// // TODO Auto-generated method stub
// return null;
// }
//
// }
| import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.stream.XMLStreamException;
import org.junit.Test;
import com.ojn.gexf4j.core.impl.StaxGraphReader; | package com.ojn.gexf4j.core;
public class GraphReaderTest {
@Test
public void quickTest() throws XMLStreamException, IOException { | // Path: src/main/java/com/ojn/gexf4j/core/impl/StaxGraphReader.java
// public class StaxGraphReader implements GexfReader {
//
// @Override
// public Gexf readFromStream(InputStream in) throws IOException {
// // TODO Auto-generated method stub
// return null;
// }
//
// }
// Path: src/test/java/com/ojn/gex... | GexfReader gr = new StaxGraphReader(); |
jmcampanini/gexf4j-core | src/main/java/com/ojn/gexf4j/core/impl/reader/NodesEntityParser.java | // Path: src/main/java/com/ojn/gexf4j/core/Graph.java
// public interface Graph extends Dynamic<Graph>, HasNodes {
//
// EdgeType getDefaultEdgeType();
// Graph setDefaultEdgeType(EdgeType edgeType);
//
// IDType getIDType();
// Graph setIDType(IDType idType);
//
// Mode getMode();
// Graph setMode(Mode graph... | import java.util.List;
import javax.xml.stream.XMLStreamReader;
import com.ojn.gexf4j.core.Graph;
import com.ojn.gexf4j.core.Node; | package com.ojn.gexf4j.core.impl.reader;
public class NodesEntityParser extends AbstractEntityParser<List<Node>> {
private static final String ENTITY_NODE = "node";
| // Path: src/main/java/com/ojn/gexf4j/core/Graph.java
// public interface Graph extends Dynamic<Graph>, HasNodes {
//
// EdgeType getDefaultEdgeType();
// Graph setDefaultEdgeType(EdgeType edgeType);
//
// IDType getIDType();
// Graph setIDType(IDType idType);
//
// Mode getMode();
// Graph setMode(Mode graph... | private Graph graph = null; |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/testgraphs/HierarchyInlineBuilder.java | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | import com.ojn.gexf4j.core.EdgeType;
import com.ojn.gexf4j.core.Gexf;
import com.ojn.gexf4j.core.Mode;
import com.ojn.gexf4j.core.Node;
import com.ojn.gexf4j.core.impl.GexfImpl; | package com.ojn.gexf4j.core.testgraphs;
public class HierarchyInlineBuilder extends GexfBuilder {
@Override
public String getSuffix() {
return "hierarchyInline";
}
@Override | // Path: src/main/java/com/ojn/gexf4j/core/EdgeType.java
// public enum EdgeType {
//
// DIRECTED,
// UNDIRECTED,
// MUTUAL,
// }
//
// Path: src/main/java/com/ojn/gexf4j/core/Gexf.java
// public interface Gexf {
//
// String getVersion();
//
// boolean hasVariant();
// Gexf clearVariant();
// String getVar... | public Gexf buildGexf() { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.