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
leonardoanalista/java2word
java2word/src/test/java/word/w2004/AbstractHeadingTest.java
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
import junit.framework.Assert; import org.junit.Test; import word.utils.TestUtils; import word.w2004.elements.AbstractHeading;
package word.w2004; public class AbstractHeadingTest extends Assert{ //### TODO: I won't test the method applyStyle because I will pull this off to another class in order to reuse this for all other "stylable" class. //anonymous implementation - this is the way I leaned how to test abstract classes. @Suppre...
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
AbstractHeading heading1 = new AbstractHeading("Heading1", "h111") {
leonardoanalista/java2word
java2word/src/test/java/word/w2004/AbstractHeadingTest.java
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
import junit.framework.Assert; import org.junit.Test; import word.utils.TestUtils; import word.w2004.elements.AbstractHeading;
package word.w2004; public class AbstractHeadingTest extends Assert{ //### TODO: I won't test the method applyStyle because I will pull this off to another class in order to reuse this for all other "stylable" class. //anonymous implementation - this is the way I leaned how to test abstract classes. @Suppre...
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
assertEquals(1, TestUtils.regexCount(heading1.getTemplate(), "<w:p wsp:rsidR*"));
leonardoanalista/java2word
java2word/src/main/java/word/w2004/Footer2004.java
// Path: java2word/src/main/java/word/api/interfaces/IElement.java // public interface IElement { // // /** // * <p>This method returns the content (XML or HTML) of the Element and the content.</p> // * <p>If you are using W2004, the return will be the XML required to generate the element.</p> // * // * <p>Im...
import word.api.interfaces.IElement; import word.api.interfaces.IFooter;
package word.w2004; public class Footer2004 implements IFooter{ StringBuilder txt = new StringBuilder(""); private boolean hasBeenCalledBefore = false; // if getContent has already been called, I cached the result for future invocations private boolean showPageNumber = true;
// Path: java2word/src/main/java/word/api/interfaces/IElement.java // public interface IElement { // // /** // * <p>This method returns the content (XML or HTML) of the Element and the content.</p> // * <p>If you are using W2004, the return will be the XML required to generate the element.</p> // * // * <p>Im...
public void addEle(IElement e) {
leonardoanalista/java2word
java2word/src/main/java/word/utils/Utils.java
// Path: java2word/src/main/java/word/api/interfaces/IDocument.java // public interface IDocument extends IHasElement { // // /** // * @return the URI ready to be added to the document // */ // String getUri(); // // /** // * @return the body of the document // */ // IBody getBody(...
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.Map; import word.api.interfaces.IDocument;
* * @return String with the content of the file */ public static String readFile(String file) { BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(file)); } catch (FileNotFoundException e) { e.printStackTrace(); throw new RuntimeException("Can't find the file", e); }...
// Path: java2word/src/main/java/word/api/interfaces/IDocument.java // public interface IDocument extends IHasElement { // // /** // * @return the URI ready to be added to the document // */ // String getUri(); // // /** // * @return the body of the document // */ // IBody getBody(...
public static String replaceSpecialCharacters(IDocument myDoc) {
leonardoanalista/java2word
java2word/src/test/java/word/w2004/PageBreakTest.java
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
import junit.framework.Assert; import org.junit.Test; import word.utils.TestUtils; import word.w2004.elements.PageBreak;
package word.w2004; public class PageBreakTest extends Assert{ @Test public void testPageBreak(){
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
PageBreak pb = new PageBreak();
leonardoanalista/java2word
java2word/src/test/java/word/w2004/PageBreakTest.java
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
import junit.framework.Assert; import org.junit.Test; import word.utils.TestUtils; import word.w2004.elements.PageBreak;
package word.w2004; public class PageBreakTest extends Assert{ @Test public void testPageBreak(){ PageBreak pb = new PageBreak();
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
assertEquals(1, TestUtils.regexCount(pb.getContent(), "<w:br w:type=\"page\" />"));
leonardoanalista/java2word
java2word/src/test/java/word/TestUtilsTest.java
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
import junit.framework.Assert; import org.junit.Test; import word.utils.TestUtils;
package word; public class TestUtilsTest extends Assert{ @Test public void testRegex(){
// Path: java2word/src/main/java/word/utils/TestUtils.java // public class TestUtils { // // public static int regexCount(String text, String regex){ // if(text == null || regex == null){ // throw new IllegalArgumentException("Can't be null."); // } // Pattern pattern = Pattern.compile(regex); // Matcher m...
assertNotNull(new TestUtils());
leonardoanalista/java2word
j2w-webtest/src/test/java/java2word/TestingTest.java
// Path: j2w-webtest/src/main/java/java2word/actions/Testing.java // public class Testing extends ActionSupport implements ServletResponseAware, ServletRequestAware { // // @Override // public String execute() throws Exception { // // System.out.println("### About to generate Word doc..."); // // // System....
import java2word.actions.Testing; import org.apache.struts2.StrutsTestCase; import org.apache.struts2.dispatcher.SessionMap; import org.apache.struts2.interceptor.SessionAware; import org.junit.Test; import com.opensymphony.xwork2.ActionProxy; import static com.opensymphony.xwork2.ActionSupport.*;
package java2word; public class TestingTest extends StrutsTestCase{ @Test public void testSanity() throws Exception{ //pre requirements request.setParameter("xml", "this is the xml"); //kinda of replay() ActionProxy proxy = getActionProxy("/testing");
// Path: j2w-webtest/src/main/java/java2word/actions/Testing.java // public class Testing extends ActionSupport implements ServletResponseAware, ServletRequestAware { // // @Override // public String execute() throws Exception { // // System.out.println("### About to generate Word doc..."); // // // System....
Testing testingAction = (Testing) proxy.getAction();
leonardoanalista/java2word
java2word/src/main/java/word/w2004/elements/AbstractHeading.java
// Path: java2word/src/main/java/word/api/interfaces/IElement.java // public interface IElement { // // /** // * <p>This method returns the content (XML or HTML) of the Element and the content.</p> // * <p>If you are using W2004, the return will be the XML required to generate the element.</p> // * // * <p>Im...
import word.api.interfaces.IElement; import word.api.interfaces.IFluentElementStylable; import word.w2004.style.HeadingStyle;
package word.w2004.elements; /** * @author leonardo * @param <E> * Heading is utilized to organize documents the same way you do for web pages. * You can use Heading1 to 3. */ public abstract class AbstractHeading<E> implements IElement, IFluentElementStylable<E>{ /** * this is actual heading1, headin...
// Path: java2word/src/main/java/word/api/interfaces/IElement.java // public interface IElement { // // /** // * <p>This method returns the content (XML or HTML) of the Element and the content.</p> // * <p>If you are using W2004, the return will be the XML required to generate the element.</p> // * // * <p>Im...
private HeadingStyle style = new HeadingStyle();
makubi/avrohugger-maven-plugin
src/test/java/at/makubi/maven/plugin/avrohugger/GeneratorMojoTest.java
// Path: src/test/java/at/makubi/maven/plugin/avrohugger/TestHelper.java // public static void failTestIfFilesDiffer(Path expectedFile, Path actualFile) throws IOException { // String fileDiff = TestHelper.fileDiff(expectedFile.toFile(), actualFile.toFile()); // if (!fileDiff.isEmpty()) { // fail("Expec...
import org.apache.commons.io.FileUtils; import org.junit.After; import org.junit.Before; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import static at.makubi.maven.plugin.avrohugger.TestHelper.failTestIfFilesDiffer;
/* * Copyright 2016 the original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Path: src/test/java/at/makubi/maven/plugin/avrohugger/TestHelper.java // public static void failTestIfFilesDiffer(Path expectedFile, Path actualFile) throws IOException { // String fileDiff = TestHelper.fileDiff(expectedFile.toFile(), actualFile.toFile()); // if (!fileDiff.isEmpty()) { // fail("Expec...
failTestIfFilesDiffer(defaultTestResourcesDir.resolve("Record.scala"), testRunnerProjectBuildDir.resolve(Defaults.relativeOutputDirectory).resolve("at/makubi/maven/plugin/model/Record.scala"));
makubi/avrohugger-maven-plugin
src/main/java/at/makubi/maven/plugin/avrohugger/typeoverride/TypeOverrides.java
// Path: src/main/java/at/makubi/maven/plugin/avrohugger/typeoverride/logical/AvroScalaTimestampMillisType.java // public enum AvroScalaTimestampMillisType { // // JAVA_TIME_INSTANT(JavaTimeInstant$.MODULE$), // JAVA_SQL_TIMESTAMP(JavaSqlTimestamp$.MODULE$); // // public final avrohugger.types.AvroScalaTi...
import at.makubi.maven.plugin.avrohugger.typeoverride.complex.*; import at.makubi.maven.plugin.avrohugger.typeoverride.logical.AvroScalaTimestampMillisType; import at.makubi.maven.plugin.avrohugger.typeoverride.primitive.*;
package at.makubi.maven.plugin.avrohugger.typeoverride; public class TypeOverrides { private avrohugger.types.AvroScalaArrayType arrayType; private avrohugger.types.AvroScalaEnumType enumType; private avrohugger.types.AvroScalaFixedType fixedType; private avrohugger.types.AvroScalaMapType mapType; ...
// Path: src/main/java/at/makubi/maven/plugin/avrohugger/typeoverride/logical/AvroScalaTimestampMillisType.java // public enum AvroScalaTimestampMillisType { // // JAVA_TIME_INSTANT(JavaTimeInstant$.MODULE$), // JAVA_SQL_TIMESTAMP(JavaSqlTimestamp$.MODULE$); // // public final avrohugger.types.AvroScalaTi...
private avrohugger.types.AvroScalaTimestampMillisType timestampMillisType;
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/storage/DefaultKeyResolution.java
// Path: src/main/java/org/wildfly/metrics/scheduler/polling/Task.java // public class Task { // // private final String host; // private final String server; // private final Address address; // private final String attribute; // private final String subref; // private final Interval interval;...
import org.wildfly.metrics.scheduler.polling.Task;
package org.wildfly.metrics.scheduler.storage; /** * Resolve data input attributes to final metric (storage) names. * * @author Heiko Braun * @since 24/10/14 */ public class DefaultKeyResolution implements KeyResolution { @Override
// Path: src/main/java/org/wildfly/metrics/scheduler/polling/Task.java // public class Task { // // private final String host; // private final String server; // private final Address address; // private final String attribute; // private final String subref; // private final Interval interval;...
public String resolve(Task task) {
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/storage/BufferedStorageDispatcher.java
// Path: src/main/java/org/wildfly/metrics/scheduler/diagnose/Diagnostics.java // public interface Diagnostics { // Timer getRequestTimer(); // Meter getErrorRate(); // Meter getDelayedRate(); // // Meter getStorageErrorRate(); // Counter getStorageBufferSize(); // } // // Path: src/main/java/org/...
import org.wildfly.metrics.scheduler.diagnose.Diagnostics; import org.wildfly.metrics.scheduler.polling.Scheduler; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue;
package org.wildfly.metrics.scheduler.storage; /** * @author Heiko Braun * @since 13/10/14 */ public class BufferedStorageDispatcher implements Scheduler.CompletionHandler { private static final int MAX_BATCH_SIZE = 24; private static final int BUFFER_SIZE = 100; private final StorageAdapter storageA...
// Path: src/main/java/org/wildfly/metrics/scheduler/diagnose/Diagnostics.java // public interface Diagnostics { // Timer getRequestTimer(); // Meter getErrorRate(); // Meter getDelayedRate(); // // Meter getStorageErrorRate(); // Counter getStorageBufferSize(); // } // // Path: src/main/java/org/...
private final Diagnostics diagnostics;
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/Task.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Address.java // public class Address implements Iterable<Address.Tuple> { // // public static Address apply(String address) { // List<String> tokens = address == null ? Collections.<String>emptyList() : // Splitter.on(CharMatcher.a...
import org.wildfly.metrics.scheduler.config.Address; import org.wildfly.metrics.scheduler.config.Interval;
package org.wildfly.metrics.scheduler.polling; /** * Represents a monitoring task. Represents and absolute address within a domain. * * @author Heiko Braun * @since 10/10/14 */ public class Task { private final String host; private final String server;
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Address.java // public class Address implements Iterable<Address.Tuple> { // // public static Address apply(String address) { // List<String> tokens = address == null ? Collections.<String>emptyList() : // Splitter.on(CharMatcher.a...
private final Address address;
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/Task.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Address.java // public class Address implements Iterable<Address.Tuple> { // // public static Address apply(String address) { // List<String> tokens = address == null ? Collections.<String>emptyList() : // Splitter.on(CharMatcher.a...
import org.wildfly.metrics.scheduler.config.Address; import org.wildfly.metrics.scheduler.config.Interval;
package org.wildfly.metrics.scheduler.polling; /** * Represents a monitoring task. Represents and absolute address within a domain. * * @author Heiko Braun * @since 10/10/14 */ public class Task { private final String host; private final String server; private final Address address; private fina...
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Address.java // public class Address implements Iterable<Address.Tuple> { // // public static Address apply(String address) { // List<String> tokens = address == null ? Collections.<String>emptyList() : // Splitter.on(CharMatcher.a...
private final Interval interval;
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/storage/StorageAdapter.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
import org.wildfly.metrics.scheduler.config.Configuration; import org.wildfly.metrics.scheduler.diagnose.Diagnostics; import java.util.Set;
package org.wildfly.metrics.scheduler.storage; /** * @author Heiko Braun * @since 10/10/14 */ public interface StorageAdapter { void store(Set<DataPoint> datapoints);
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
void setConfiguration(Configuration config);
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/storage/StorageAdapter.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
import org.wildfly.metrics.scheduler.config.Configuration; import org.wildfly.metrics.scheduler.diagnose.Diagnostics; import java.util.Set;
package org.wildfly.metrics.scheduler.storage; /** * @author Heiko Braun * @since 10/10/14 */ public interface StorageAdapter { void store(Set<DataPoint> datapoints); void setConfiguration(Configuration config);
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
void setDiagnostics(Diagnostics diag);
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/IntervalGrouping.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Interval.java // public class Interval{ // // public final static Interval EACH_SECOND = new Interval(1, SECONDS); // public final static Interval TWENTY_SECONDS = new Interval(20, SECONDS); // public final static Interval EACH_MINUTE = new Interv...
import org.wildfly.metrics.scheduler.config.Interval; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List;
/* * JBoss, Home of Professional Open Source. * Copyright 2010, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * unde...
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Interval.java // public class Interval{ // // public final static Interval EACH_SECOND = new Interval(1, SECONDS); // public final static Interval TWENTY_SECONDS = new Interval(20, SECONDS); // public final static Interval EACH_MINUTE = new Interv...
Interval interval = tasks.get(0).getInterval();
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/Scheduler.java
// Path: src/main/java/org/wildfly/metrics/scheduler/storage/DataPoint.java // public final class DataPoint { // private Task task; // private long timestamp; // private double value; // // public DataPoint(Task task, double value) { // this.task = task; // this.timestamp = System.curre...
import java.util.List; import org.wildfly.metrics.scheduler.storage.DataPoint;
/* * JBoss, Home of Professional Open Source. * Copyright 2010, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * unde...
// Path: src/main/java/org/wildfly/metrics/scheduler/storage/DataPoint.java // public final class DataPoint { // private Task task; // private long timestamp; // private double value; // // public DataPoint(Task task, double value) { // this.task = task; // this.timestamp = System.curre...
void onCompleted(DataPoint sample);
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/TaskGroup.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Interval.java // public class Interval{ // // public final static Interval EACH_SECOND = new Interval(1, SECONDS); // public final static Interval TWENTY_SECONDS = new Interval(20, SECONDS); // public final static Interval EACH_MINUTE = new Interv...
import com.google.common.collect.Iterators; import org.wildfly.metrics.scheduler.config.Interval; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.UUID;
/* * JBoss, Home of Professional Open Source. * Copyright 2010, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * unde...
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Interval.java // public class Interval{ // // public final static Interval EACH_SECOND = new Interval(1, SECONDS); // public final static Interval TWENTY_SECONDS = new Interval(20, SECONDS); // public final static Interval EACH_MINUTE = new Interv...
private final Interval interval; // impacts thread scheduling
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/storage/RHQStorageAdapter.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
import org.apache.http.HttpResponse; import org.apache.http.StatusLine; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.rhq.metrics.client.common.Batcher; import org.rhq...
package org.wildfly.metrics.scheduler.storage; /** * Pushes the data to RHQ metrics. * * @author Heiko Braun * @since 13/10/14 */ public class RHQStorageAdapter implements StorageAdapter { private Configuration config;
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
private Diagnostics diagnostics;
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/storage/RHQStorageAdapter.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
import org.apache.http.HttpResponse; import org.apache.http.StatusLine; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.rhq.metrics.client.common.Batcher; import org.rhq...
package org.wildfly.metrics.scheduler.storage; /** * Pushes the data to RHQ metrics. * * @author Heiko Braun * @since 13/10/14 */ public class RHQStorageAdapter implements StorageAdapter { private Configuration config; private Diagnostics diagnostics; private final HttpClient httpclient; privat...
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
Task task = datapoint.getTask();
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/IntervalBasedScheduler.java
// Path: src/main/java/org/rhq/wfly/monitor/extension/MonitorLogger.java // @MessageLogger(projectCode = "<<none>>") // public interface MonitorLogger extends BasicLogger { // /** // * A logger with the category {@code org.rhq.wfly.monitor}. // */ // MonitorLogger LOGGER = Logger.getMessageLogger(Moni...
import com.codahale.metrics.Timer; import org.jboss.as.controller.client.ModelControllerClient; import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; import org.rhq.wfly.monitor.extension.MonitorLogger; import org.wildfly.metrics.scheduler.ModelControllerClientFactory; import org.wildfly.metrics.scheduler.Sche...
/* * JBoss, Home of Professional Open Source. * Copyright 2010, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * unde...
// Path: src/main/java/org/rhq/wfly/monitor/extension/MonitorLogger.java // @MessageLogger(projectCode = "<<none>>") // public interface MonitorLogger extends BasicLogger { // /** // * A logger with the category {@code org.rhq.wfly.monitor}. // */ // MonitorLogger LOGGER = Logger.getMessageLogger(Moni...
private final ModelControllerClientFactory clientFactory;
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/IntervalBasedScheduler.java
// Path: src/main/java/org/rhq/wfly/monitor/extension/MonitorLogger.java // @MessageLogger(projectCode = "<<none>>") // public interface MonitorLogger extends BasicLogger { // /** // * A logger with the category {@code org.rhq.wfly.monitor}. // */ // MonitorLogger LOGGER = Logger.getMessageLogger(Moni...
import com.codahale.metrics.Timer; import org.jboss.as.controller.client.ModelControllerClient; import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; import org.rhq.wfly.monitor.extension.MonitorLogger; import org.wildfly.metrics.scheduler.ModelControllerClientFactory; import org.wildfly.metrics.scheduler.Sche...
/* * JBoss, Home of Professional Open Source. * Copyright 2010, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * unde...
// Path: src/main/java/org/rhq/wfly/monitor/extension/MonitorLogger.java // @MessageLogger(projectCode = "<<none>>") // public interface MonitorLogger extends BasicLogger { // /** // * A logger with the category {@code org.rhq.wfly.monitor}. // */ // MonitorLogger LOGGER = Logger.getMessageLogger(Moni...
private final Diagnostics monitor;
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/IntervalBasedScheduler.java
// Path: src/main/java/org/rhq/wfly/monitor/extension/MonitorLogger.java // @MessageLogger(projectCode = "<<none>>") // public interface MonitorLogger extends BasicLogger { // /** // * A logger with the category {@code org.rhq.wfly.monitor}. // */ // MonitorLogger LOGGER = Logger.getMessageLogger(Moni...
import com.codahale.metrics.Timer; import org.jboss.as.controller.client.ModelControllerClient; import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; import org.rhq.wfly.monitor.extension.MonitorLogger; import org.wildfly.metrics.scheduler.ModelControllerClientFactory; import org.wildfly.metrics.scheduler.Sche...
/* * JBoss, Home of Professional Open Source. * Copyright 2010, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * unde...
// Path: src/main/java/org/rhq/wfly/monitor/extension/MonitorLogger.java // @MessageLogger(projectCode = "<<none>>") // public interface MonitorLogger extends BasicLogger { // /** // * A logger with the category {@code org.rhq.wfly.monitor}. // */ // MonitorLogger LOGGER = Logger.getMessageLogger(Moni...
SchedulerLogger.LOGGER.debug("Creating new executor thread");
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/IntervalBasedScheduler.java
// Path: src/main/java/org/rhq/wfly/monitor/extension/MonitorLogger.java // @MessageLogger(projectCode = "<<none>>") // public interface MonitorLogger extends BasicLogger { // /** // * A logger with the category {@code org.rhq.wfly.monitor}. // */ // MonitorLogger LOGGER = Logger.getMessageLogger(Moni...
import com.codahale.metrics.Timer; import org.jboss.as.controller.client.ModelControllerClient; import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; import org.rhq.wfly.monitor.extension.MonitorLogger; import org.wildfly.metrics.scheduler.ModelControllerClientFactory; import org.wildfly.metrics.scheduler.Sche...
long durationMs = requestContext.stop() / 1000000; String outcome = response.get(OUTCOME).asString(); if (SUCCESS.equals(outcome)) { if (durationMs > group.getInterval().millis()) { monitor.getDelayedRate().ma...
// Path: src/main/java/org/rhq/wfly/monitor/extension/MonitorLogger.java // @MessageLogger(projectCode = "<<none>>") // public interface MonitorLogger extends BasicLogger { // /** // * A logger with the category {@code org.rhq.wfly.monitor}. // */ // MonitorLogger LOGGER = Logger.getMessageLogger(Moni...
completionHandler.onCompleted(new DataPoint(task, value));
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/polling/ReadAttributeOperationBuilder.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Address.java // public class Address implements Iterable<Address.Tuple> { // // public static Address apply(String address) { // List<String> tokens = address == null ? Collections.<String>emptyList() : // Splitter.on(CharMatcher.a...
import org.wildfly.metrics.scheduler.config.Address; import java.util.ArrayList; import java.util.List; import org.jboss.dmr.ModelNode;
/* * JBoss, Home of Professional Open Source. * Copyright 2010, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * unde...
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Address.java // public class Address implements Iterable<Address.Tuple> { // // public static Address apply(String address) { // List<String> tokens = address == null ? Collections.<String>emptyList() : // Splitter.on(CharMatcher.a...
Address address = task.getAddress();
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/storage/InfluxStorageAdapter.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
import org.influxdb.InfluxDB; import org.influxdb.InfluxDBFactory; import org.influxdb.dto.Serie; import org.wildfly.metrics.scheduler.config.Configuration; import org.wildfly.metrics.scheduler.diagnose.Diagnostics; import org.wildfly.metrics.scheduler.polling.Task; import java.util.Set; import java.util.concurrent.Tim...
package org.wildfly.metrics.scheduler.storage; /** * Pushes the data to Influx. * * @author Heiko Braun * @since 13/10/14 */ public class InfluxStorageAdapter implements StorageAdapter { private InfluxDB influxDB; private String dbName;
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
private Diagnostics diagnostics;
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/storage/InfluxStorageAdapter.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
import org.influxdb.InfluxDB; import org.influxdb.InfluxDBFactory; import org.influxdb.dto.Serie; import org.wildfly.metrics.scheduler.config.Configuration; import org.wildfly.metrics.scheduler.diagnose.Diagnostics; import org.wildfly.metrics.scheduler.polling.Task; import java.util.Set; import java.util.concurrent.Tim...
package org.wildfly.metrics.scheduler.storage; /** * Pushes the data to Influx. * * @author Heiko Braun * @since 13/10/14 */ public class InfluxStorageAdapter implements StorageAdapter { private InfluxDB influxDB; private String dbName; private Diagnostics diagnostics;
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
private Configuration config;
hawkular/wildfly-monitor
src/main/java/org/wildfly/metrics/scheduler/storage/InfluxStorageAdapter.java
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
import org.influxdb.InfluxDB; import org.influxdb.InfluxDBFactory; import org.influxdb.dto.Serie; import org.wildfly.metrics.scheduler.config.Configuration; import org.wildfly.metrics.scheduler.diagnose.Diagnostics; import org.wildfly.metrics.scheduler.polling.Task; import java.util.Set; import java.util.concurrent.Tim...
package org.wildfly.metrics.scheduler.storage; /** * Pushes the data to Influx. * * @author Heiko Braun * @since 13/10/14 */ public class InfluxStorageAdapter implements StorageAdapter { private InfluxDB influxDB; private String dbName; private Diagnostics diagnostics; private Configuration con...
// Path: src/main/java/org/wildfly/metrics/scheduler/config/Configuration.java // public interface Configuration { // // public enum Diagnostics {STORAGE, CONSOLE}; // public enum Storage {RHQ, INFLUX} // // /** // * The host controller host. // * @return // */ // String getHost(); // ...
Task task = datapoint.getTask();
darugnaa/apache-camel-examples
camel-spring-mqtt/src/main/java/org/darugna/camel/mqtt/AnnotationExclusionStrategy.java
// Path: camel-spring-mqtt/src/main/java/org/darugna/camel/mqtt/dto/Greeting.java // public class Greeting { // // @Expose // private String greeting; // @Expose // private LocalDateTime greetingDate; // @Expose // private Map<String,Integer> recipients; // // // keep away from marshalling...
import com.google.gson.ExclusionStrategy; import com.google.gson.FieldAttributes; import java.lang.annotation.Annotation; import org.darugna.camel.mqtt.dto.Greeting; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.darugna.camel.mqtt; public class AnnotationExclusionStrategy implements ExclusionStrategy { private final static Logger log = LoggerFactory.getLogger(AnnotationExclusionStrategy.class); @Override public boolean shouldSkipField(FieldAttributes fa) { // On other classes marshal all fi...
// Path: camel-spring-mqtt/src/main/java/org/darugna/camel/mqtt/dto/Greeting.java // public class Greeting { // // @Expose // private String greeting; // @Expose // private LocalDateTime greetingDate; // @Expose // private Map<String,Integer> recipients; // // // keep away from marshalling...
if (!fa.getDeclaringClass().equals(Greeting.class)) {
darugnaa/apache-camel-examples
camel-standalone-http/src/main/java/org/darugna/camel/StandaloneLauncher.java
// Path: camel-standalone-http/src/main/java/org/darugna/camel/http/HttpRouteBuilder.java // public class HttpRouteBuilder extends RouteBuilder { // // /** // * Let's configure the Camel routing rules using Java code... // */ // @Override // public void configure() { // from("file:dat...
import org.apache.camel.main.Main; import org.darugna.camel.http.HttpRouteBuilder;
package org.darugna.camel; public class StandaloneLauncher { public static void main(String... args) throws Exception { Main main = new Main();
// Path: camel-standalone-http/src/main/java/org/darugna/camel/http/HttpRouteBuilder.java // public class HttpRouteBuilder extends RouteBuilder { // // /** // * Let's configure the Camel routing rules using Java code... // */ // @Override // public void configure() { // from("file:dat...
main.addRouteBuilder(new HttpRouteBuilder());
darugnaa/apache-camel-examples
camel-blueprint-csv/src/main/java/org/darugna/camel/csv/Stats.java
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/dto/Company.java // @CsvRecord(separator = ",", skipFirstLine = true) // public class Company { // // @DataField(pos = 1) // String symbol; // // @DataField(pos = 2) // String name; // // @DataField(pos = 3) // @Bind...
import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; import org.darugna.camel.csv.dto.Company; import org.darugna.camel.csv.dto.Sector; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.darugna.camel.csv; public class Stats { private final static Logger LOGGER = LoggerFactory.getLogger(Stats.class);
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/dto/Company.java // @CsvRecord(separator = ",", skipFirstLine = true) // public class Company { // // @DataField(pos = 1) // String symbol; // // @DataField(pos = 2) // String name; // // @DataField(pos = 3) // @Bind...
public void printStats(List<Company> companies) {
darugnaa/apache-camel-examples
camel-blueprint-csv/src/main/java/org/darugna/camel/csv/Stats.java
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/dto/Company.java // @CsvRecord(separator = ",", skipFirstLine = true) // public class Company { // // @DataField(pos = 1) // String symbol; // // @DataField(pos = 2) // String name; // // @DataField(pos = 3) // @Bind...
import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; import org.darugna.camel.csv.dto.Company; import org.darugna.camel.csv.dto.Sector; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.darugna.camel.csv; public class Stats { private final static Logger LOGGER = LoggerFactory.getLogger(Stats.class); public void printStats(List<Company> companies) { countBySector(companies); marketCaps(companies); } private void countBySector(List<Company> compan...
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/dto/Company.java // @CsvRecord(separator = ",", skipFirstLine = true) // public class Company { // // @DataField(pos = 1) // String symbol; // // @DataField(pos = 2) // String name; // // @DataField(pos = 3) // @Bind...
Map<Sector,Long> countBySector = companies
darugnaa/apache-camel-examples
camel-blueprint-csv/src/main/java/org/darugna/camel/csv/dto/Company.java
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/formatters/BigDecimalFormatter.java // public class BigDecimalFormatter implements Format<BigDecimal> { // // private final MathContext mathContext = new MathContext(4); // // @Override // public String format(BigDecimal object) throws E...
import java.math.BigDecimal; import org.apache.camel.dataformat.bindy.annotation.BindyConverter; import org.apache.camel.dataformat.bindy.annotation.CsvRecord; import org.apache.camel.dataformat.bindy.annotation.DataField; import org.darugna.camel.csv.formatters.BigDecimalFormatter; import org.darugna.camel.csv.formatt...
package org.darugna.camel.csv.dto; @CsvRecord(separator = ",", skipFirstLine = true) public class Company { @DataField(pos = 1) String symbol; @DataField(pos = 2) String name; @DataField(pos = 3)
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/formatters/BigDecimalFormatter.java // public class BigDecimalFormatter implements Format<BigDecimal> { // // private final MathContext mathContext = new MathContext(4); // // @Override // public String format(BigDecimal object) throws E...
@BindyConverter(BigDecimalFormatter.class)
darugnaa/apache-camel-examples
camel-blueprint-csv/src/main/java/org/darugna/camel/csv/dto/Company.java
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/formatters/BigDecimalFormatter.java // public class BigDecimalFormatter implements Format<BigDecimal> { // // private final MathContext mathContext = new MathContext(4); // // @Override // public String format(BigDecimal object) throws E...
import java.math.BigDecimal; import org.apache.camel.dataformat.bindy.annotation.BindyConverter; import org.apache.camel.dataformat.bindy.annotation.CsvRecord; import org.apache.camel.dataformat.bindy.annotation.DataField; import org.darugna.camel.csv.formatters.BigDecimalFormatter; import org.darugna.camel.csv.formatt...
package org.darugna.camel.csv.dto; @CsvRecord(separator = ",", skipFirstLine = true) public class Company { @DataField(pos = 1) String symbol; @DataField(pos = 2) String name; @DataField(pos = 3) @BindyConverter(BigDecimalFormatter.class) BigDecimal lastSale; @DataF...
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/formatters/BigDecimalFormatter.java // public class BigDecimalFormatter implements Format<BigDecimal> { // // private final MathContext mathContext = new MathContext(4); // // @Override // public String format(BigDecimal object) throws E...
@BindyConverter(SectionFormatter.class)
darugnaa/apache-camel-examples
camel-blueprint-csv/src/main/java/org/darugna/camel/csv/dto/SimpleCompany.java
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/formatters/SectionFormatter.java // public class SectionFormatter implements Format<Sector> { // // private final Map<String, Sector> stringToSector; // private final Map<Sector, String> sectorToString; // // public SectionFormatter() { ...
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import org.apache.camel.dataformat.bindy.annotation.BindyConverter; import org.apache.camel.dataformat.bindy.annotation.CsvRecord;...
package org.darugna.camel.csv.dto; @XmlAccessorType(XmlAccessType.FIELD) @CsvRecord(separator = ",") public class SimpleCompany { @XmlElement @DataField(pos = 1) String symbol; @XmlAttribute @DataField(pos = 2) String name; @XmlAttribute @DataField(pos = 3)
// Path: camel-blueprint-csv/src/main/java/org/darugna/camel/csv/formatters/SectionFormatter.java // public class SectionFormatter implements Format<Sector> { // // private final Map<String, Sector> stringToSector; // private final Map<Sector, String> sectorToString; // // public SectionFormatter() { ...
@BindyConverter(SectionFormatter.class)
darugnaa/apache-camel-examples
camel-spring-mqtt/src/main/java/org/darugna/camel/mqtt/GreetingProducerBean.java
// Path: camel-spring-mqtt/src/main/java/org/darugna/camel/mqtt/dto/Greeting.java // public class Greeting { // // @Expose // private String greeting; // @Expose // private LocalDateTime greetingDate; // @Expose // private Map<String,Integer> recipients; // // // keep away from marshalling...
import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.Random; import java.util.stream.IntStream; import org.darugna.camel.mqtt.dto.Greeting; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.darugna.camel.mqtt; public class GreetingProducerBean { private final static Logger log = LoggerFactory.getLogger(GreetingProducerBean.class); private final Random random = new Random(); // List of greetings. Original writings taken from Wikipedia. private final String[] GREETIN...
// Path: camel-spring-mqtt/src/main/java/org/darugna/camel/mqtt/dto/Greeting.java // public class Greeting { // // @Expose // private String greeting; // @Expose // private LocalDateTime greetingDate; // @Expose // private Map<String,Integer> recipients; // // // keep away from marshalling...
public Greeting produce() {
darugnaa/apache-camel-examples
camel-blueprint-route-as-a-service/raas-service-consumer/src/main/java/org/darugna/camel/raas/consumer/ConsumerBeanThatUsesService.java
// Path: camel-blueprint-route-as-a-service/raas-service-provider/src/main/java/org/darugna/camel/raas/CamelRaas.java // public interface CamelRaas { // // Integer methodOne(@Body String arg0); // // Integer methodTwo(@Header("ARG0")String arg0, // @Header("ARG1") String arg1); // // }
import org.darugna.camel.raas.CamelRaas; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
package org.darugna.camel.raas.consumer; /** * This bean as a reference to CamelRaas interface. It is injected in this context * as an OSGi service. Each method call to this interface will invoke a Camel * route. * * @author Alessandro Da Rugna (alessandro.darugna@gmail.com) */ public class ConsumerBeanThatUse...
// Path: camel-blueprint-route-as-a-service/raas-service-provider/src/main/java/org/darugna/camel/raas/CamelRaas.java // public interface CamelRaas { // // Integer methodOne(@Body String arg0); // // Integer methodTwo(@Header("ARG0")String arg0, // @Header("ARG1") String arg1); // // } ...
private CamelRaas camelRaas;
fengyouchao/sockslib
src/main/java/sockslib/server/msg/MethodSelectionResponseMessage.java
// Path: src/main/java/sockslib/common/methods/SocksMethod.java // public interface SocksMethod { // // /** // * method byte. // * // * @return byte. // */ // int getByte(); // // /** // * Gets method's name. // * // * @return Name of the method. // */ // String getMethodName(); // //...
import sockslib.common.methods.SocksMethod;
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: src/main/java/sockslib/common/methods/SocksMethod.java // public interface SocksMethod { // // /** // * method byte. // * // * @return byte. // */ // int getByte(); // // /** // * Gets method's name. // * // * @return Name of the method. // */ // String getMethodName(); // //...
public MethodSelectionResponseMessage(SocksMethod socksMethod) {
fengyouchao/sockslib
src/main/java/sockslib/server/SSLSocksProxyServer.java
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
import sockslib.common.SSLConfiguration; import sockslib.common.SocksException; import javax.net.ssl.SSLServerSocket; import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors;
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable...
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
throw new SocksException(e.getMessage());
fengyouchao/sockslib
src/main/java/sockslib/client/SocksProxyFactory.java
// Path: src/main/java/sockslib/common/KeyStoreInfo.java // public class KeyStoreInfo { // // private String keyStorePath; // private String password; // private String type = "JKS"; // // public KeyStoreInfo() { // } // // public KeyStoreInfo(String keyStorePath, String password, String type) { // t...
import com.google.common.base.Strings; import sockslib.common.Credentials; import sockslib.common.KeyStoreInfo; import sockslib.common.SSLConfiguration; import sockslib.common.UsernamePasswordCredentials; import sockslib.utils.PathUtil; import java.io.FileNotFoundException; import java.net.InetSocketAddress; import jav...
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: src/main/java/sockslib/common/KeyStoreInfo.java // public class KeyStoreInfo { // // private String keyStorePath; // private String password; // private String type = "JKS"; // // public KeyStoreInfo() { // } // // public KeyStoreInfo(String keyStorePath, String password, String type) { // t...
KeyStoreInfo trustKeyStoreInfo;
fengyouchao/sockslib
src/main/java/sockslib/client/SocksSocket.java
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import sockslib.common.SocksException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import j...
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
SocksException, IOException {
fengyouchao/sockslib
src/main/java/sockslib/common/methods/NoAcceptableMethod.java
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
import sockslib.client.SocksProxy; import sockslib.common.SocksException; import sockslib.server.Session; import java.io.IOException; import static com.google.common.base.Preconditions.checkNotNull;
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
public void doMethod(SocksProxy socksProxy) throws SocksException, IOException {
fengyouchao/sockslib
src/main/java/sockslib/server/msg/MethodSelectionMessage.java
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
import sockslib.common.SocksException; import java.io.IOException; import java.io.InputStream; import static sockslib.utils.StreamUtil.checkEnd;
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
public void read(InputStream inputStream) throws SocksException, IOException {
fengyouchao/sockslib
src/main/java/sockslib/server/msg/MethodSelectionMessage.java
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
import sockslib.common.SocksException; import java.io.IOException; import java.io.InputStream; import static sockslib.utils.StreamUtil.checkEnd;
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
version = checkEnd(inputStream.read());
fengyouchao/sockslib
src/test/java/sockslib/example/AnonymousSocks5Server.java
// Path: src/main/java/sockslib/server/SocksProxyServer.java // public interface SocksProxyServer { // // /** // * SOCKS server default port. // */ // int DEFAULT_SOCKS_PORT = 1080; // // /** // * Starts a SOCKS server. // * // * @throws IOException If any I/O error occurs. // */ // void sta...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sockslib.server.SessionManager; import sockslib.server.SocksProxyServer; import sockslib.server.SocksServerBuilder; import sockslib.server.listener.LoggingListener; import sockslib.utils.Timer; import java.io.IOException;
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: src/main/java/sockslib/server/SocksProxyServer.java // public interface SocksProxyServer { // // /** // * SOCKS server default port. // */ // int DEFAULT_SOCKS_PORT = 1080; // // /** // * Starts a SOCKS server. // * // * @throws IOException If any I/O error occurs. // */ // void sta...
SocksProxyServer proxyServer = SocksServerBuilder.buildAnonymousSocks5Server();
fengyouchao/sockslib
src/main/java/sockslib/server/SocksProxyServer.java
// Path: src/main/java/sockslib/common/methods/SocksMethod.java // public interface SocksMethod { // // /** // * method byte. // * // * @return byte. // */ // int getByte(); // // /** // * Gets method's name. // * // * @return Name of the method. // */ // String getMethodName(); // //...
import sockslib.client.SocksProxy; import sockslib.common.methods.SocksMethod; import sockslib.server.listener.PipeInitializer; import java.io.IOException; import java.net.InetAddress; import java.util.Map; import java.util.concurrent.ExecutorService;
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable...
// Path: src/main/java/sockslib/common/methods/SocksMethod.java // public interface SocksMethod { // // /** // * method byte. // * // * @return byte. // */ // int getByte(); // // /** // * Gets method's name. // * // * @return Name of the method. // */ // String getMethodName(); // //...
void setSupportMethods(SocksMethod... methods);
fengyouchao/sockslib
src/main/java/sockslib/common/methods/SocksMethod.java
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
import sockslib.client.SocksProxy; import sockslib.common.SocksException; import sockslib.server.Session; import java.io.IOException;
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
void doMethod(SocksProxy socksProxy) throws SocksException, IOException;
fengyouchao/sockslib
src/main/java/sockslib/client/SocksServerSocket.java
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
import sockslib.common.SocksException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketAddress;
/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: src/main/java/sockslib/common/SocksException.java // public class SocksException extends IOException { // // /** // * Serial version UID. // */ // private static final long serialVersionUID = 1L; // // private static final String NO_ACCEPTABLE_METHODS = "NO ACCEPTABLE METHODS"; // /** // * M...
SocksException, IOException {
gaffo/scumd
src/main/java/com/asolutions/scmsshd/converters/path/IPathToProjectNameConverter.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 com.asolutions.scmsshd.sshd.UnparsableProjectException;
package com.asolutions.scmsshd.converters.path; public interface IPathToProjectNameConverter { public abstract String convert(String toParse)
// 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...
throws UnparsableProjectException;
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitSCMCommandImpl.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.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.apache.sshd.server.CommandFactory.ExitCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.asolutions.scmsshd.authorizors.AuthorizationLevel; import com.asolutions.scmssh...
package com.asolutions.scmsshd.commands.git; public abstract class GitSCMCommandImpl implements ISCMCommandHandler { protected final Logger log = LoggerFactory.getLogger(getClass()); public GitSCMCommandImpl() { super(); }
// 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...
public void execute(FilteredCommand filteredCommand,
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitSCMCommandImpl.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.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.apache.sshd.server.CommandFactory.ExitCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.asolutions.scmsshd.authorizors.AuthorizationLevel; import com.asolutions.scmssh...
package com.asolutions.scmsshd.commands.git; public abstract class GitSCMCommandImpl implements ISCMCommandHandler { protected final Logger log = LoggerFactory.getLogger(getClass()); public GitSCMCommandImpl() { super(); } public void execute(FilteredCommand filteredCommand, InputStream inputStream, Outp...
// 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...
Properties config, AuthorizationLevel authorizationLevel) {
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.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 java.util.Properties; import org.jmock.Expectations; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.fi...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBaseTest extends MockTestCase { private static final String ARGUMENT = "argument"; private static final String COMMAND = "command"; @Test public void testBadCommandReturnsNoOp() 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 IBadCommandFilter mockBadCommandFilter = context.mock(IBadCommandFilter.class);
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.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 java.util.Properties; import org.jmock.Expectations; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.fi...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBaseTest extends MockTestCase { private static final String ARGUMENT = "argument"; private static final String COMMAND = "command"; @Test public void testBadCommandReturnsNoOp() throws Exception { final IBadComman...
// 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(){ // ...
will(throwException(new BadCommandException()));
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.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 java.util.Properties; import org.jmock.Expectations; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.fi...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBaseTest extends MockTestCase { private static final String ARGUMENT = "argument"; private static final String COMMAND = "command"; @Test public void testBadCommandReturnsNoOp() throws Exception { final IBadComman...
// 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(){ // ...
assertEquals(NoOpCommand.class, factory.createCommand(COMMAND).getClass());
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.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 java.util.Properties; import org.jmock.Expectations; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.fi...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBaseTest extends MockTestCase { private static final String ARGUMENT = "argument"; private static final String COMMAND = "command"; @Test public void testBadCommandReturnsNoOp() throws Exception { final IBadComman...
// 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(COMMAND, ARGUMENT);
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.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 java.util.Properties; import org.jmock.Expectations; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.fi...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBaseTest extends MockTestCase { private static final String ARGUMENT = "argument"; private static final String COMMAND = "command"; @Test public void testBadCommandReturnsNoOp() throws Exception { final IBadComman...
// 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 IProjectAuthorizer mockProjAuth = context.mock(IProjectAuthorizer.class);
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBaseTest.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 java.util.Properties; import org.jmock.Expectations; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.fi...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBaseTest extends MockTestCase { private static final String ARGUMENT = "argument"; private static final String COMMAND = "command"; @Test public void testBadCommandReturnsNoOp() throws Exception { final IBadComman...
// 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 IPathToProjectNameConverter mockPathConverter = context.mock(IPathToProjectNameConverter.class);
gaffo/scumd
src/main/java/com/asolutions/scmsshd/ldap/JavaxNamingProvider.java
// Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSocketFactory.java // public class PromiscuousSSLSocketFactory extends SocketFactory { // protected final Logger log = LoggerFactory.getLogger(getClass()); // private static SocketFactory blindFactory = null; // // /** // * // * Builds an all trus...
import java.util.Properties; import javax.naming.Context; import javax.naming.NamingException; import javax.naming.directory.InitialDirContext; import com.asolutions.scmsshd.ssl.PromiscuousSSLSocketFactory;
package com.asolutions.scmsshd.ldap; public class JavaxNamingProvider implements IJavaxNamingProvider { private String url; private boolean promiscuous; public JavaxNamingProvider(String url, boolean promiscuous) { this.url = url; this.promiscuous = promiscuous; } public InitialDirContext getBinding(S...
// Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSocketFactory.java // public class PromiscuousSSLSocketFactory extends SocketFactory { // protected final Logger log = LoggerFactory.getLogger(getClass()); // private static SocketFactory blindFactory = null; // // /** // * // * Builds an all trus...
properties.setProperty("java.naming.ldap.factory.socket", PromiscuousSSLSocketFactory.class.getName());
gaffo/scumd
src/main/java/com/asolutions/scmsshd/authorizors/AlwaysPassProjectAuthorizer.java
// Path: src/main/java/com/asolutions/scmsshd/sshd/IProjectAuthorizer.java // public interface IProjectAuthorizer { // // AuthorizationLevel userIsAuthorizedForProject(String username, String project) throws UnparsableProjectException; // // } // // Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectE...
import com.asolutions.scmsshd.sshd.IProjectAuthorizer; import com.asolutions.scmsshd.sshd.UnparsableProjectException;
package com.asolutions.scmsshd.authorizors; public class AlwaysPassProjectAuthorizer implements IProjectAuthorizer { public AuthorizationLevel userIsAuthorizedForProject(String username,
// Path: src/main/java/com/asolutions/scmsshd/sshd/IProjectAuthorizer.java // public interface IProjectAuthorizer { // // AuthorizationLevel userIsAuthorizedForProject(String username, String project) throws UnparsableProjectException; // // } // // Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectE...
String project) throws UnparsableProjectException {
gaffo/scumd
src/test/java/com/asolutions/scmsshd/converters/path/regexp/ConfigurablePathToProjectConverterTest.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.fail; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.asynchrony.customizations.AsynchronyPathToProjectNameConverter; import com.asolutions.scmsshd.sshd.UnparsableProjectException;
package com.asolutions.scmsshd.converters.path.regexp; public class ConfigurablePathToProjectConverterTest extends MockTestCase{ @Test public void testMatchReturnsTrue() throws Exception { ConfigurablePathToProjectConverter converter = new ConfigurablePathToProjectConverter(); converter.setProjectPattern("(\...
// 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(){ // ...
new AsynchronyPathToProjectNameConverter().convert("");
gaffo/scumd
src/test/java/com/asolutions/scmsshd/converters/path/regexp/ConfigurablePathToProjectConverterTest.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.fail; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.asynchrony.customizations.AsynchronyPathToProjectNameConverter; import com.asolutions.scmsshd.sshd.UnparsableProjectException;
package com.asolutions.scmsshd.converters.path.regexp; public class ConfigurablePathToProjectConverterTest extends MockTestCase{ @Test public void testMatchReturnsTrue() throws Exception { ConfigurablePathToProjectConverter converter = new ConfigurablePathToProjectConverter(); converter.setProjectPattern("(\...
// 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(){ // ...
catch (UnparsableProjectException e){
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandlerTest.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 static org.junit.Assert.*; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.tr...
package com.asolutions.scmsshd.commands.git; public class GitReceivePackSCMCommandHandlerTest extends MockTestCase { @Test public void testReceivePackPassesCorrectStuffToJGIT() 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/GitReceivePackSCMCommandHandlerTest.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 static org.junit.Assert.*; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.tr...
final OutputStream mockOutputStream = context.mock(OutputStream.class, "mockOutputStream"); final OutputStream mockErrorStream = context.mock(OutputStream.class, "mockErrorStream"); final ExitCallback mockExitCallback = context.mock(ExitCallback.class); final GitSCMRepositoryProvider mockRepoProvider =...
// 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/GitReceivePackSCMCommandHandlerTest.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 static org.junit.Assert.*; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.tr...
final File base = new File(pathtobasedir); final GitReceivePackProvider mockReceivePackProvider = context .mock(GitReceivePackProvider.class); final ReceivePack mockUploadPack = context.mock(ReceivePack.class); final Properties mockConfig = context.mock(Properties.class); checking(new Expectations() { ...
// 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_WRITE);
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandlerTest.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 static org.junit.Assert.*; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.tr...
final OutputStream mockOutputStream = context.mock(OutputStream.class, "mockOutputStream"); final OutputStream mockErrorStream = context.mock(OutputStream.class, "mockErrorStream"); final ExitCallback mockExitCallback = context.mock(ExitCallback.class); final GitSCMRepositoryProvider mockRepoProvider =...
// 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(){ // ...
} catch (Failure e) {
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandlerTest.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 static org.junit.Assert.*; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.tr...
"mockOutputStream"); final OutputStream mockErrorStream = context.mock(OutputStream.class, "mockErrorStream"); final ExitCallback mockExitCallback = context.mock(ExitCallback.class); final GitSCMRepositoryProvider mockRepoProvider = context .mock(GitSCMRepositoryProvider.class); final File base = n...
// 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(){ // ...
assertEquals(MustHaveWritePrivilagesToPushFailure.class, e
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitUploadPackSCMCommandHandler.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.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.apache.sshd.server.CommandFactory.ExitCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.trans...
package com.asolutions.scmsshd.commands.git; public class GitUploadPackSCMCommandHandler extends GitSCMCommandImpl { protected final Logger log = LoggerFactory.getLogger(getClass()); private GitSCMRepositoryProvider repositoryProvider; private GitUploadPackProvider uploadPackProvider; public GitUploadPackSCMC...
// 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...
protected void runCommand(FilteredCommand filteredCommand,
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitUploadPackSCMCommandHandler.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.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.apache.sshd.server.CommandFactory.ExitCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.trans...
package com.asolutions.scmsshd.commands.git; public class GitUploadPackSCMCommandHandler extends GitSCMCommandImpl { protected final Logger log = LoggerFactory.getLogger(getClass()); private GitSCMRepositoryProvider repositoryProvider; private GitUploadPackProvider uploadPackProvider; public GitUploadPackSCMC...
// 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...
Properties config, AuthorizationLevel authorizationLevel)
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitUploadPackSCMCommandHandler.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.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.apache.sshd.server.CommandFactory.ExitCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.trans...
package com.asolutions.scmsshd.commands.git; public class GitUploadPackSCMCommandHandler extends GitSCMCommandImpl { protected final Logger log = LoggerFactory.getLogger(getClass()); private GitSCMRepositoryProvider repositoryProvider; private GitUploadPackProvider uploadPackProvider; public GitUploadPackSCMC...
// 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...
String strRepoBase = config.getProperty(GitSCMCommandFactory.REPOSITORY_BASE);
gaffo/scumd
src/exttest/java/com/asolutions/scmsshd/test/integration/PushTest.java
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
import static org.junit.Assert.assertEquals; import java.io.File; import java.io.IOException; import java.util.Properties; import org.apache.commons.io.FileUtils; import org.apache.sshd.common.keyprovider.FileKeyPairProvider; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.spearce.jgi...
} @After public void closeRepos() { fromRepository.close(); } @Test public void testPush() throws Exception { addRemoteConfigForLocalGitDirectory(fromRepository, toRepoDir, ORIGIN); push(ORIGIN, REFSPEC, fromRepository); assertPushOfMaster(fromRefMaster); } @Test public void testRoundTrip() t...
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
final SCuMD sshd = new SCuMD();
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.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.Properties; import org.apache.sshd.server.CommandFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.filters.BadCommandException; impor...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBase implements CommandFactory { protected final Logger log = LoggerFactory.getLogger(getClass());
// 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; /...
private IProjectAuthorizer projectAuthorizer;
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.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.Properties; import org.apache.sshd.server.CommandFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.filters.BadCommandException; impor...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBase implements CommandFactory { protected final Logger log = LoggerFactory.getLogger(getClass()); private IProjectAuthorizer projectAuthorizer;
// 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; /...
private IBadCommandFilter badCommandFilter;
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.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.Properties; import org.apache.sshd.server.CommandFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.filters.BadCommandException; impor...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBase implements CommandFactory { protected final Logger log = LoggerFactory.getLogger(getClass()); private IProjectAuthorizer projectAuthorizer; private IBadCommandFilter badCommandFilter; private ISCMCommandFactory scmComman...
// 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; /...
private IPathToProjectNameConverter pathToProjectNameConverter;
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.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.Properties; import org.apache.sshd.server.CommandFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.filters.BadCommandException; impor...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBase implements CommandFactory { protected final Logger log = LoggerFactory.getLogger(getClass()); private IProjectAuthorizer projectAuthorizer; private IBadCommandFilter badCommandFilter; private ISCMCommandFactory scmComman...
// 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; /...
FilteredCommand fc = badCommandFilter.filterOrThrow(command);
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.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.Properties; import org.apache.sshd.server.CommandFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.filters.BadCommandException; impor...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBase implements CommandFactory { protected final Logger log = LoggerFactory.getLogger(getClass()); private IProjectAuthorizer projectAuthorizer; private IBadCommandFilter badCommandFilter; private ISCMCommandFactory scmComman...
// 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; /...
} catch (BadCommandException e) {
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/factories/CommandFactoryBase.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.Properties; import org.apache.sshd.server.CommandFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.NoOpCommand; import com.asolutions.scmsshd.commands.filters.BadCommandException; impor...
package com.asolutions.scmsshd.commands.factories; public class CommandFactoryBase implements CommandFactory { protected final Logger log = LoggerFactory.getLogger(getClass()); private IProjectAuthorizer projectAuthorizer; private IBadCommandFilter badCommandFilter; private ISCMCommandFactory scmComman...
// 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; /...
return new NoOpCommand();
gaffo/scumd
src/exttest/java/com/asolutions/scmsshd/test/integration/util/ConstantProjectNameConverter.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 com.asolutions.scmsshd.converters.path.IPathToProjectNameConverter; import com.asolutions.scmsshd.sshd.UnparsableProjectException;
package com.asolutions.scmsshd.test.integration.util; public class ConstantProjectNameConverter implements IPathToProjectNameConverter { public ConstantProjectNameConverter() { }
// 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/authorizors/PassIfAnyInCollectionPassAuthorizorTest.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.*; import java.util.ArrayList; import org.jmock.Expectations; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.scmsshd.sshd.IProjectAuthorizer;
package com.asolutions.scmsshd.authorizors; public class PassIfAnyInCollectionPassAuthorizorTest extends MockTestCase { private static final String PROJECT = "project"; private static final String USERNAME = "username"; @Test public void testAuthingWithEmptyChainFails() throws Exception { assertNull(new P...
// 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 IProjectAuthorizer failsAuth = context.mock(IProjectAuthorizer.class, "failsAuth");
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitSCMCommandHandler.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; import com.asolutions.scmsshd.commands.handlers.ISCMComma...
package com.asolutions.scmsshd.commands.git; public class GitSCMCommandHandler implements ISCMCommandHandler { private ISCMCommandHandler uploadPackHandler; private ISCMCommandHandler receivePackHandler; public GitSCMCommandHandler() { this(new GitUploadPackSCMCommandHandler(), new GitReceivePackSCMCommandH...
// 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...
public void execute(FilteredCommand filteredCommand,
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitSCMCommandHandler.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; import com.asolutions.scmsshd.commands.handlers.ISCMComma...
package com.asolutions.scmsshd.commands.git; public class GitSCMCommandHandler implements ISCMCommandHandler { private ISCMCommandHandler uploadPackHandler; private ISCMCommandHandler receivePackHandler; public GitSCMCommandHandler() { this(new GitUploadPackSCMCommandHandler(), new GitReceivePackSCMCommandH...
// 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...
AuthorizationLevel authorizationLevel) {
gaffo/scumd
src/main/java/com/asolutions/scmsshd/authorizors/PassIfAnyInCollectionPassAuthorizor.java
// Path: src/main/java/com/asolutions/scmsshd/sshd/IProjectAuthorizer.java // public interface IProjectAuthorizer { // // AuthorizationLevel userIsAuthorizedForProject(String username, String project) throws UnparsableProjectException; // // } // // Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectE...
import java.util.ArrayList; import com.asolutions.scmsshd.sshd.IProjectAuthorizer; import com.asolutions.scmsshd.sshd.UnparsableProjectException;
package com.asolutions.scmsshd.authorizors; public class PassIfAnyInCollectionPassAuthorizor implements IProjectAuthorizer { private ArrayList<IProjectAuthorizer> authList = new ArrayList<IProjectAuthorizer>(); public AuthorizationLevel userIsAuthorizedForProject(String username, String project)
// Path: src/main/java/com/asolutions/scmsshd/sshd/IProjectAuthorizer.java // public interface IProjectAuthorizer { // // AuthorizationLevel userIsAuthorizedForProject(String username, String project) throws UnparsableProjectException; // // } // // Path: src/main/java/com/asolutions/scmsshd/sshd/UnparsableProjectE...
throws UnparsableProjectException {
gaffo/scumd
src/main/java/com/asolutions/scmsshd/ldap/LDAPBindingProvider.java
// Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSocketFactory.java // public class PromiscuousSSLSocketFactory extends SocketFactory { // protected final Logger log = LoggerFactory.getLogger(getClass()); // private static SocketFactory blindFactory = null; // // /** // * // * Builds an all trus...
import java.util.Properties; import javax.naming.Context; import javax.naming.NamingException; import javax.naming.directory.InitialDirContext; import com.asolutions.scmsshd.ssl.PromiscuousSSLSocketFactory;
/** * */ package com.asolutions.scmsshd.ldap; public class LDAPBindingProvider { private String lookupUserDN; private String lookupUserPassword; private String url; private boolean promiscuous; public LDAPBindingProvider(String lookupUserDN, String lookupUserPassword, String url, boolean promiscuous) {...
// Path: src/main/java/com/asolutions/scmsshd/ssl/PromiscuousSSLSocketFactory.java // public class PromiscuousSSLSocketFactory extends SocketFactory { // protected final Logger log = LoggerFactory.getLogger(getClass()); // private static SocketFactory blindFactory = null; // // /** // * // * Builds an all trus...
properties.setProperty("java.naming.ldap.factory.socket", PromiscuousSSLSocketFactory.class.getName());
gaffo/scumd
src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.util.Properties; import org.apache.sshd.common.keyprovider.FileKeyPairProvider; import org.junit.Test; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.transport.FetchResult; import com.asolutions.scms...
package com.asolutions.scmsshd.test.integration; public class FetchTest extends IntegrationTestCase { @Test public void testFetchLocal() throws Exception { File gitDir = new File(".git"); String remoteName = "origin"; Repository db = createCloneToRepo(); addRemoteConfigForLocalGitDirectory(db, gitD...
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
final SCuMD sshd = new SCuMD();
gaffo/scumd
src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.util.Properties; import org.apache.sshd.common.keyprovider.FileKeyPairProvider; import org.junit.Test; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.transport.FetchResult; import com.asolutions.scms...
package com.asolutions.scmsshd.test.integration; public class FetchTest extends IntegrationTestCase { @Test public void testFetchLocal() throws Exception { File gitDir = new File(".git"); String remoteName = "origin"; Repository db = createCloneToRepo(); addRemoteConfigForLocalGitDirectory(db, gitD...
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
sshd.setPublickeyAuthenticator(new AlwaysPassPublicKeyAuthenticator());
gaffo/scumd
src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.util.Properties; import org.apache.sshd.common.keyprovider.FileKeyPairProvider; import org.junit.Test; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.transport.FetchResult; import com.asolutions.scms...
package com.asolutions.scmsshd.test.integration; public class FetchTest extends IntegrationTestCase { @Test public void testFetchLocal() throws Exception { File gitDir = new File(".git"); String remoteName = "origin"; Repository db = createCloneToRepo(); addRemoteConfigForLocalGitDirectory(db, gitD...
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
GitCommandFactory factory = new GitCommandFactory();
gaffo/scumd
src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.util.Properties; import org.apache.sshd.common.keyprovider.FileKeyPairProvider; import org.junit.Test; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.transport.FetchResult; import com.asolutions.scms...
package com.asolutions.scmsshd.test.integration; public class FetchTest extends IntegrationTestCase { @Test public void testFetchLocal() throws Exception { File gitDir = new File(".git"); String remoteName = "origin"; Repository db = createCloneToRepo(); addRemoteConfigForLocalGitDirectory(db, gitD...
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
factory.setPathToProjectNameConverter(new ConstantProjectNameConverter());
gaffo/scumd
src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.util.Properties; import org.apache.sshd.common.keyprovider.FileKeyPairProvider; import org.junit.Test; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.transport.FetchResult; import com.asolutions.scms...
package com.asolutions.scmsshd.test.integration; public class FetchTest extends IntegrationTestCase { @Test public void testFetchLocal() throws Exception { File gitDir = new File(".git"); String remoteName = "origin"; Repository db = createCloneToRepo(); addRemoteConfigForLocalGitDirectory(db, gitD...
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
factory.setProjectAuthorizor(new AlwaysPassProjectAuthorizer());
gaffo/scumd
src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.util.Properties; import org.apache.sshd.common.keyprovider.FileKeyPairProvider; import org.junit.Test; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.transport.FetchResult; import com.asolutions.scms...
package com.asolutions.scmsshd.test.integration; public class FetchTest extends IntegrationTestCase { @Test public void testFetchLocal() throws Exception { File gitDir = new File(".git"); String remoteName = "origin"; Repository db = createCloneToRepo(); addRemoteConfigForLocalGitDirectory(db, gitD...
// Path: src/main/java/com/asolutions/scmsshd/SCuMD.java // public class SCuMD extends SshServer { // // /** // * @param args // */ // public static void main(String[] args) { // if (args.length != 1) { // System.err.println("Usage: SCuMD pathToConfigFile"); // return; // } // new FileSystemXmlApplic...
config.setProperty(GitSCMCommandFactory.REPOSITORY_BASE, System.getProperty("user.dir"));
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/AllowedCommandCheckerTest.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 static org.junit.Assert.fail; import org.junit.Test; import com.asolutions.scmsshd.commands.filters.BadCommandException;
package com.asolutions.scmsshd.commands; public class AllowedCommandCheckerTest { @Test public void testParsesGitCommands() throws Exception { new AllowedCommandChecker("git-upload-pack"); new AllowedCommandChecker("git upload-pack"); new AllowedCommandChecker("git-receive-pack"); new AllowedCommandCheck...
// 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...
catch (BadCommandException e){
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandler.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.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.apache.sshd.server.CommandFactory.ExitCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.trans...
package com.asolutions.scmsshd.commands.git; public class GitReceivePackSCMCommandHandler extends GitSCMCommandImpl { protected final Logger log = LoggerFactory.getLogger(getClass()); private GitSCMRepositoryProvider repositoryProvider; private GitReceivePackProvider receivePackProvider; public GitReceivePack...
// 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...
protected void runCommand(FilteredCommand filteredCommand,
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandler.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.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.apache.sshd.server.CommandFactory.ExitCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.trans...
package com.asolutions.scmsshd.commands.git; public class GitReceivePackSCMCommandHandler extends GitSCMCommandImpl { protected final Logger log = LoggerFactory.getLogger(getClass()); private GitSCMRepositoryProvider repositoryProvider; private GitReceivePackProvider receivePackProvider; public GitReceivePack...
// 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...
Properties config, AuthorizationLevel authorizationLevel) throws IOException {
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandler.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.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.apache.sshd.server.CommandFactory.ExitCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.trans...
package com.asolutions.scmsshd.commands.git; public class GitReceivePackSCMCommandHandler extends GitSCMCommandImpl { protected final Logger log = LoggerFactory.getLogger(getClass()); private GitSCMRepositoryProvider repositoryProvider; private GitReceivePackProvider receivePackProvider; public GitReceivePack...
// 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...
throw new MustHaveWritePrivilagesToPushFailure("Tried to push to " + filteredCommand.getArgument());
gaffo/scumd
src/main/java/com/asolutions/scmsshd/commands/git/GitReceivePackSCMCommandHandler.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.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.apache.sshd.server.CommandFactory.ExitCallback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.spearce.jgit.lib.Repository; import org.spearce.jgit.trans...
package com.asolutions.scmsshd.commands.git; public class GitReceivePackSCMCommandHandler extends GitSCMCommandImpl { protected final Logger log = LoggerFactory.getLogger(getClass()); private GitSCMRepositoryProvider repositoryProvider; private GitReceivePackProvider receivePackProvider; public GitReceivePack...
// 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...
.getProperty(GitSCMCommandFactory.REPOSITORY_BASE);
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/git/GitBadCommandFilterTest.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 static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import org.junit.Test; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.filters.BadCommandException; import com.asolutions.scmsshd.commands.filters.git.GitBadCommandFilter;
package com.asolutions.scmsshd.commands.git; public class GitBadCommandFilterTest { @Test public void testCorrect() throws Exception {
// 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; /...
GitBadCommandFilter filter = new GitBadCommandFilter();
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/git/GitBadCommandFilterTest.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 static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import org.junit.Test; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.filters.BadCommandException; import com.asolutions.scmsshd.commands.filters.git.GitBadCommandFilter;
package com.asolutions.scmsshd.commands.git; public class GitBadCommandFilterTest { @Test public void testCorrect() throws Exception { GitBadCommandFilter filter = new GitBadCommandFilter();
// 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; /...
FilteredCommand fc = filter.filterOrThrow("git-upload-pack 'bob'");
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/git/GitBadCommandFilterTest.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 static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import org.junit.Test; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.filters.BadCommandException; import com.asolutions.scmsshd.commands.filters.git.GitBadCommandFilter;
public void testNoArgs() throws Exception { assertThrows("git-upload-pack"); } @Test public void test2Args() throws Exception { assertThrows("git-upload-pack bob tom"); } @Test public void testUnquoted() throws Exception { assertThrows("git-upload-pack bob"); } @Test public void testWithUnsafeBang...
// 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; /...
catch (BadCommandException e){
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;
// 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...
private AuthorizationLevel authorizationLevel;
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...
private LDAPUsernameResolver resolver;