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
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/impl/LicenseTransactionJoinImpl.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/License.java // public interface License extends BaseEntity { // // // Methods for working with properties // // String getName(); // // void setName(String name); // // BigDecimal getPrice(); // // void setPrice(Bi...
import com.labs64.netlicensing.domain.entity.Transaction; import com.labs64.netlicensing.domain.entity.License; import com.labs64.netlicensing.domain.entity.LicenseTransactionJoin;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/License.java // public interface License extends BaseEntity { // // // Methods for working with properties // // String getName(); // // void setName(String name); // // BigDecimal getPrice(); // // void setPrice(Bi...
private License license;
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/Transaction.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Currency.java // public enum Currency { // // NONE(""), // // EUR("EUR"), // // USD("USD"); // // private final String value; // // /** // * Instantiates a new currency. // * // * @param currency // ...
import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; import com.labs64.netlicensing.domain.vo.Currency; import com.labs64.netlicensing.domain.vo.TransactionSource; import com.labs64.netlicensing.domain.vo.TransactionStatus;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Currency.java // public enum Currency { // // NONE(""), // // EUR("EUR"), // // USD("USD"); // // private final String value; // // /** // * Instantiates a new currency. // * // * @param currency // ...
TransactionSource getSource();
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/Transaction.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Currency.java // public enum Currency { // // NONE(""), // // EUR("EUR"), // // USD("USD"); // // private final String value; // // /** // * Instantiates a new currency. // * // * @param currency // ...
import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Map; import com.labs64.netlicensing.domain.vo.Currency; import com.labs64.netlicensing.domain.vo.TransactionSource; import com.labs64.netlicensing.domain.vo.TransactionStatus;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Currency.java // public enum Currency { // // NONE(""), // // EUR("EUR"), // // USD("USD"); // // private final String value; // // /** // * Instantiates a new currency. // * // * @param currency // ...
Currency getCurrency();
Labs64/NetLicensingClient-java
NetLicensingClient/src/test/java/com/labs64/netlicensing/service/NetLicensingServiceTest.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
import javax.ws.rs.GET; import javax.ws.rs.HttpMethod; import javax.ws.rs.Path; import javax.ws.rs.core.Response; import org.junit.BeforeClass; import org.junit.Test; import com.labs64.netlicensing.domain.vo.Context; import com.labs64.netlicensing.exception.RestException; import com.labs64.netlicensing.schema.context.O...
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
@Test(expected = RestException.class)
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/License.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Currency.java // public enum Currency { // // NONE(""), // // EUR("EUR"), // // USD("USD"); // // private final String value; // // /** // * Instantiates a new currency. // * // * @param currency // ...
import com.labs64.netlicensing.domain.vo.Currency; import java.math.BigDecimal; import java.util.Map;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Currency.java // public enum Currency { // // NONE(""), // // EUR("EUR"), // // USD("USD"); // // private final String value; // // /** // * Instantiates a new currency. // * // * @param currency // ...
Currency getCurrency();
Labs64/NetLicensingClient-java
NetLicensingClient-demo/src/main/java/com/labs64/netlicensing/utils/ConsoleWriter.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Page.java // public interface Page<Entity> extends Iterable<Entity> { // // /** // * Returns the number of the current page. Is always non-negative. // * // * @return the number of the current page. // */ // int ge...
import com.labs64.netlicensing.domain.vo.Page; import static java.lang.System.out;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Page.java // public interface Page<Entity> extends Iterable<Entity> { // // /** // * Returns the number of the current page. Is always non-negative. // * // * @return the number of the current page. // */ // int ge...
public void writePage(final String msg, final Page<?> page) {
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/provider/RestProviderJersey.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/exception/RestException.java // public class RestException extends NetLicensingException { // // private static final long serialVersionUID = -3863879794574523844L; // // /** // * Construct a <code>RestException</code> with the specified d...
import java.util.Map; import javax.ws.rs.ProcessingException; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation.Builder; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Media...
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/exception/RestException.java // public class RestException extends NetLicensingException { // // private static final long serialVersionUID = -3863879794574523844L; // // /** // * Construct a <code>RestException</code> with the specified d...
final Map<String, Object> queryParams) throws RestException {
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/provider/RestProviderJersey.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/exception/RestException.java // public class RestException extends NetLicensingException { // // private static final long serialVersionUID = -3863879794574523844L; // // /** // * Construct a <code>RestException</code> with the specified d...
import java.util.Map; import javax.ws.rs.ProcessingException; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation.Builder; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Media...
synchronized (RestProviderJersey.class) { if (client == null) { client = ClientBuilder.newClient(new ClientConfig()); if (configuration.isLoggingEnabled()) { //TODO: enable logging for jersey 2.26 //clien...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/exception/RestException.java // public class RestException extends NetLicensingException { // // private static final long serialVersionUID = -3863879794574523844L; // // /** // * Construct a <code>RestException</code> with the specified d...
private void addAuthHeaders(final WebTarget target, final Authentication auth) {
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/util/SignatureUtils.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
import java.security.KeyFactory; import java.security.NoSuchAlgorithmException; import java.security.PublicKey; import java.security.SignatureException; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; import java.util.Base64; import javax.xml.bind.JAXBContext; import jav...
package com.labs64.netlicensing.util; public class SignatureUtils { /** * Cleanse public key; replace CRLF and strip key headers * @param publicKey * @return cleansed public key */ public static String cleansePublicKey(final String publicKey) { if (publicKey == null) { ...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
public static void check(final Context context, final Netlicensing response) throws BadSignatureException {
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/util/SignatureUtils.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
import java.security.KeyFactory; import java.security.NoSuchAlgorithmException; import java.security.PublicKey; import java.security.SignatureException; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; import java.util.Base64; import javax.xml.bind.JAXBContext; import jav...
package com.labs64.netlicensing.util; public class SignatureUtils { /** * Cleanse public key; replace CRLF and strip key headers * @param publicKey * @return cleansed public key */ public static String cleansePublicKey(final String publicKey) { if (publicKey == null) { ...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
public static void check(final Context context, final Netlicensing response) throws BadSignatureException {
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/schema/converter/ItemToPaymentMethodConverter.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/PaymentMethod.java // public interface PaymentMethod extends BaseEntity { // // // Methods for working with custom properties // // @Deprecated // Map<String, String> getPaymentMethodProperties(); // // } // // Path: NetLice...
import com.labs64.netlicensing.domain.entity.PaymentMethod; import com.labs64.netlicensing.domain.entity.impl.PaymentMethodImpl; import com.labs64.netlicensing.exception.ConversionException; import com.labs64.netlicensing.schema.context.Item; import com.labs64.netlicensing.schema.context.Property;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/PaymentMethod.java // public interface PaymentMethod extends BaseEntity { // // // Methods for working with custom properties // // @Deprecated // Map<String, String> getPaymentMethodProperties(); // // } // // Path: NetLice...
public PaymentMethod convert(final Item source) throws ConversionException {
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/schema/converter/ItemToPaymentMethodConverter.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/PaymentMethod.java // public interface PaymentMethod extends BaseEntity { // // // Methods for working with custom properties // // @Deprecated // Map<String, String> getPaymentMethodProperties(); // // } // // Path: NetLice...
import com.labs64.netlicensing.domain.entity.PaymentMethod; import com.labs64.netlicensing.domain.entity.impl.PaymentMethodImpl; import com.labs64.netlicensing.exception.ConversionException; import com.labs64.netlicensing.schema.context.Item; import com.labs64.netlicensing.schema.context.Property;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/PaymentMethod.java // public interface PaymentMethod extends BaseEntity { // // // Methods for working with custom properties // // @Deprecated // Map<String, String> getPaymentMethodProperties(); // // } // // Path: NetLice...
if (!PaymentMethodImpl.getReservedProps().contains(property.getName())) {
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/Token.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/ITokenType.java // public interface ITokenType { // // String name(); // // }
import com.labs64.netlicensing.domain.vo.ITokenType; import java.util.Date; import java.util.Map;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/ITokenType.java // public interface ITokenType { // // String name(); // // } // Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/entity/Token.java import com.labs64.netlicensing.domain.vo.ITokenType; import java.ut...
ITokenType getTokenType();
Labs64/NetLicensingClient-java
NetLicensingClient-demo/src/main/java/com/labs64/netlicensing/demo/NetLicensingClientDemo.java
// Path: NetLicensingClient-demo/src/main/java/com/labs64/netlicensing/examples/NetLicensingExample.java // public interface NetLicensingExample { // // void execute(); // // }
import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import com.labs64.netlicensing.examples.NetLicensingE...
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient-demo/src/main/java/com/labs64/netlicensing/examples/NetLicensingExample.java // public interface NetLicensingExample { // // void execute(); // // } // Path: NetLicensingClient-demo/src/main/java/com/labs64/netlicensing/demo/NetLicensingClientDemo.java import org.apache.commons.cli.C...
NetLicensingExample ex;
Labs64/NetLicensingClient-java
NetLicensingClient/src/test/java/com/labs64/netlicensing/service/SecurityTest.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
import java.util.Base64; import javax.ws.rs.GET; import javax.ws.rs.HeaderParam; import javax.ws.rs.HttpMethod; import javax.ws.rs.Path; import javax.ws.rs.core.Response; import org.junit.Test; import com.labs64.netlicensing.domain.vo.Context; import com.labs64.netlicensing.domain.vo.SecurityMode; import com.labs64.net...
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
final Context context = new Context()
Labs64/NetLicensingClient-java
NetLicensingClient/src/test/java/com/labs64/netlicensing/service/SecurityTest.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
import java.util.Base64; import javax.ws.rs.GET; import javax.ws.rs.HeaderParam; import javax.ws.rs.HttpMethod; import javax.ws.rs.Path; import javax.ws.rs.core.Response; import org.junit.Test; import com.labs64.netlicensing.domain.vo.Context; import com.labs64.netlicensing.domain.vo.SecurityMode; import com.labs64.net...
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/domain/vo/Context.java // public class Context extends GenericContext<String> { // // private String publicKey; // // public Context() { // super(String.class); // } // // public Context setBaseUrl(final String baseUrl) { // ...
.setSecurityMode(SecurityMode.BASIC_AUTHENTICATION)
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/provider/RestProvider.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/exception/RestException.java // public class RestException extends NetLicensingException { // // private static final long serialVersionUID = -3863879794574523844L; // // /** // * Construct a <code>RestException</code> with the specified d...
import com.labs64.netlicensing.exception.RestException; import com.labs64.netlicensing.provider.auth.Authentication; import java.util.Map;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/exception/RestException.java // public class RestException extends NetLicensingException { // // private static final long serialVersionUID = -3863879794574523844L; // // /** // * Construct a <code>RestException</code> with the specified d...
Map<String, Object> queryParams) throws RestException;
Labs64/NetLicensingClient-java
NetLicensingClient/src/main/java/com/labs64/netlicensing/provider/RestProvider.java
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/exception/RestException.java // public class RestException extends NetLicensingException { // // private static final long serialVersionUID = -3863879794574523844L; // // /** // * Construct a <code>RestException</code> with the specified d...
import com.labs64.netlicensing.exception.RestException; import com.labs64.netlicensing.provider.auth.Authentication; import java.util.Map;
/* 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribute...
// Path: NetLicensingClient/src/main/java/com/labs64/netlicensing/exception/RestException.java // public class RestException extends NetLicensingException { // // private static final long serialVersionUID = -3863879794574523844L; // // /** // * Construct a <code>RestException</code> with the specified d...
RestProvider authenticate(Authentication authentication);
matthewcmead/sleet
src/main/java/sleet/generators/IdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.id.IdType; import sleet.state.IdState;
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
public IdType<?, ?> getId(List<IdState<?, ?>> states) throws SleetException;
matthewcmead/sleet
src/main/java/sleet/generators/fixed/FixedLongIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.state.IdState;
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
private LongId value = null;
matthewcmead/sleet
src/main/java/sleet/generators/fixed/FixedLongIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.state.IdState;
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
public void beginIdSession(Properties config) throws SleetException {
matthewcmead/sleet
src/main/java/sleet/generators/fixed/FixedLongIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.state.IdState;
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
throw new GeneratorSessionException("Session was already started. Stop session by calling endIdSession() then start session by calling beginIdSession()");
matthewcmead/sleet
src/main/java/sleet/generators/fixed/FixedLongIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.state.IdState;
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
throw new GeneratorConfigException("Missing value for fixed long id generation, must be specified in configuration properties key \"" + FIXED_LONG_VALUE_KEY + "\".");
matthewcmead/sleet
src/main/java/sleet/generators/fixed/FixedLongIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.state.IdState;
String bitsStr = config.getProperty(FIXED_BITS_IN_ID_KEY); if (bitsStr == null) { throw new GeneratorConfigException("Missing number of bits for the fixed value, must be specified in configuration properties key \"" + FIXED_BITS_IN_ID_KEY + "\"."); } int bits = -1; try { bits = Integer.v...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
public LongIdType getId(List<IdState<?, ?>> states) throws SleetException {
matthewcmead/sleet
src/main/java/sleet/generators/time/TimeDependentSequenceIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.id.TimeIdType; import sleet.state.Id...
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
public void beginIdSession(Properties config) throws SleetException {
matthewcmead/sleet
src/main/java/sleet/generators/time/TimeDependentSequenceIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.id.TimeIdType; import sleet.state.Id...
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
throw new GeneratorSessionException("Session was already started. Stop session by calling endIdSession() then start session by calling beginIdSession()");
matthewcmead/sleet
src/main/java/sleet/generators/time/TimeDependentSequenceIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.id.TimeIdType; import sleet.state.Id...
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
throw new GeneratorConfigException("Missing number of bits for the sequence value, must be specified in configuration properties key \""
matthewcmead/sleet
src/main/java/sleet/generators/time/TimeDependentSequenceIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.id.TimeIdType; import sleet.state.Id...
String bitsStr = config.getProperty(BITS_IN_SEQUENCE_KEY); if (bitsStr == null) { throw new GeneratorConfigException("Missing number of bits for the sequence value, must be specified in configuration properties key \"" + BITS_IN_SEQUENCE_KEY + "\"."); } int bits = -1; try { bit...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
public LongIdType getId(List<IdState<?, ?>> states) throws SleetException {
matthewcmead/sleet
src/main/java/sleet/generators/time/TimeDependentSequenceIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.id.TimeIdType; import sleet.state.Id...
throw new GeneratorConfigException("Missing number of bits for the sequence value, must be specified in configuration properties key \"" + BITS_IN_SEQUENCE_KEY + "\"."); } int bits = -1; try { bits = Integer.valueOf(bitsStr); } catch (NumberFormatException e) { throw new Gene...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
TimeIdType timeIdType = null;
matthewcmead/sleet
src/main/java/sleet/generators/time/TimeDependentSequenceIdGenerator.java
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
import java.util.List; import java.util.Properties; import sleet.SleetException; import sleet.generators.GeneratorConfigException; import sleet.generators.GeneratorSessionException; import sleet.generators.IdGenerator; import sleet.id.LongId; import sleet.id.LongIdType; import sleet.id.TimeIdType; import sleet.state.Id...
public void checkSessionValidity() throws SleetException { validateSessionStarted(); } @Override public void endIdSession() throws SleetException { validateSessionStarted(); this.maxSequenceValue = -1; } @Override public LongIdType getId(List<IdState<?, ?>> states) throws SleetException { ...
// Path: src/main/java/sleet/SleetException.java // public class SleetException extends Exception { // // /** // * generated by eclipse // */ // private static final long serialVersionUID = -404982431470350032L; // // public SleetException(String message, Throwable cause) { // super(message, cause); /...
return new LongId(-1, new TimeIdReverseSkewError(this.getClass().getName()
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java
// Path: src/main/java/com/github/ddth/kafka/KafkaClient.java // public enum ProducerType {NO_ACK, LEADER_ACK, ALL_ACKS; // public final static ProducerType[] ALL_TYPES = { NO_ACK, LEADER_ACK, ALL_ACKS };} // // Path: src/main/java/com/github/ddth/kafka/KafkaTopicPartitionOffset.java // public class KafkaTopicPart...
import com.github.ddth.kafka.KafkaClient.ProducerType; import com.github.ddth.kafka.KafkaTopicPartitionOffset; import org.apache.commons.lang3.StringUtils; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.clients.producer.KafkaProdu...
package com.github.ddth.kafka.internal; /** * Helper utility class. * * @author Thanh Ba Nguyen <bnguyen2k@gmail.com> * @since 1.2.0 */ public class KafkaHelper { /** * Helper method to create a {@link ExecutorService} instance (internal use). * * @param es * @return */ public s...
// Path: src/main/java/com/github/ddth/kafka/KafkaClient.java // public enum ProducerType {NO_ACK, LEADER_ACK, ALL_ACKS; // public final static ProducerType[] ALL_TYPES = { NO_ACK, LEADER_ACK, ALL_ACKS };} // // Path: src/main/java/com/github/ddth/kafka/KafkaTopicPartitionOffset.java // public class KafkaTopicPart...
public static boolean seek(KafkaConsumer<?, ?> consumer, KafkaTopicPartitionOffset tpo) {
DDTH/ddth-kafka
src/main/java/com/github/ddth/kafka/internal/KafkaHelper.java
// Path: src/main/java/com/github/ddth/kafka/KafkaClient.java // public enum ProducerType {NO_ACK, LEADER_ACK, ALL_ACKS; // public final static ProducerType[] ALL_TYPES = { NO_ACK, LEADER_ACK, ALL_ACKS };} // // Path: src/main/java/com/github/ddth/kafka/KafkaTopicPartitionOffset.java // public class KafkaTopicPart...
import com.github.ddth.kafka.KafkaClient.ProducerType; import com.github.ddth.kafka.KafkaTopicPartitionOffset; import org.apache.commons.lang3.StringUtils; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.clients.producer.KafkaProdu...
public static boolean seekToEnd(KafkaConsumer<?, ?> consumer, String topic) { boolean result = false; synchronized (consumer) { Set<TopicPartition> topicParts = consumer.assignment(); if (topicParts != null) { for (TopicPartition tp : topicParts) { ...
// Path: src/main/java/com/github/ddth/kafka/KafkaClient.java // public enum ProducerType {NO_ACK, LEADER_ACK, ALL_ACKS; // public final static ProducerType[] ALL_TYPES = { NO_ACK, LEADER_ACK, ALL_ACKS };} // // Path: src/main/java/com/github/ddth/kafka/KafkaTopicPartitionOffset.java // public class KafkaTopicPart...
public static KafkaProducer<String, byte[]> createKafkaProducer(ProducerType type, String bootstrapServers) {
jGleitz/JUnit-KIT
src/test/OutputFileWriter.java
// Path: src/test/framework/FrameworkException.java // public class FrameworkException extends RuntimeException { // private static final long serialVersionUID = 2221405766881026986L; // private static final String GIT_HUB_POINTER = "This is a serious issue. But we'd like to help solve this!\n" // + "Please report...
import java.io.FileNotFoundException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; import java.util.M...
for (TestMethod testMethod : classMap.values()) { String indicator = "<span class=\"successIndicator " + ((testMethod.success) ? "succeeded" : "failed") + "\" title=\"" + ((testMethod.success) ? "success" : "fail") + "\">" + CIRCLE_SVG + "</span>"; write(new String[] { "<div cla...
// Path: src/test/framework/FrameworkException.java // public class FrameworkException extends RuntimeException { // private static final long serialVersionUID = 2221405766881026986L; // private static final String GIT_HUB_POINTER = "This is a serious issue. But we'd like to help solve this!\n" // + "Please report...
throw new FrameworkException("We cannot generate an output file, as we're unable to write the file "
jGleitz/JUnit-KIT
src/test/mocking/MockCompiler.java
// Path: src/test/framework/FrameworkException.java // public class FrameworkException extends RuntimeException { // private static final long serialVersionUID = 2221405766881026986L; // private static final String GIT_HUB_POINTER = "This is a serious issue. But we'd like to help solve this!\n" // + "Please report...
import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.StringWriter; import java.io.Writer; import java.util.Arrays; import java.util.HashMap; import ...
package test.mocking; /** * Helper class to compile a {@link MockerJavaSourceFile}. * * @author Joshua Gleitze * @version 1.0 * @since 04.02.2015 */ public abstract class MockCompiler { private static final File cacheFile = new File(".serialization/mockCompilerCache.ser"); private static Map<String, MockerJ...
// Path: src/test/framework/FrameworkException.java // public class FrameworkException extends RuntimeException { // private static final long serialVersionUID = 2221405766881026986L; // private static final String GIT_HUB_POINTER = "This is a serious issue. But we'd like to help solve this!\n" // + "Please report...
throw new FrameworkException("Unable to compile " + sourceFile.getName() + ":\n\n"
jGleitz/JUnit-KIT
src/sheet6/c_bookDatabase/subtests/CompleteSearchScenarioTest.java
// Path: src/test/Input.java // public class Input { // private static HashMap<String, String[]> filesMap = new HashMap<>(); // private static HashMap<String[], String> reverseFileMap = new HashMap<>(); // // /** // * This class is not meant to be instantiated. // */ // private Input() { // } // // /** // ...
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; import java.util.HashMap; import java.util.List; import java.util.Map; import org.hamcrest.Matcher; import org.junit.Test; import test.Input;
queries = new String[] { "creator=ralf_reussner", "year=2006", "AND(creator=ralf_reussner,year=2006)", "OR(creator=ralf_reussner,year=2006)", "isbn=12345" }; // @formatter:off expectedResultMatchers = getMatchers( is("creator=galileocomputing,title=java_ist_auch_eine_insel...
// Path: src/test/Input.java // public class Input { // private static HashMap<String, String[]> filesMap = new HashMap<>(); // private static HashMap<String[], String> reverseFileMap = new HashMap<>(); // // /** // * This class is not meant to be instantiated. // */ // private Input() { // } // // /** // ...
multiLineTest(searchForAll(queries), expectedResultMatchers, "0.5", Input.getFile(file));
jGleitz/JUnit-KIT
src/test/InteractiveConsoleTest.java
// Path: src/test/KitMatchers.java // public static Matcher<Integer> suits(final SystemExitStatus systemExitStatus, final boolean mandatory) { // return new BaseMatcher<Integer>() { // // @Override // public boolean matches(final Object testObject) { // Integer status = (Integer) testObject; // return syste...
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; import static test.KitMatchers.suits; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Vector...
allCommands[commands.length] = "quit"; return allCommands; } protected static String joinAsNumberedLines(String[] strings) { StringBuilder resultBuilder = new StringBuilder(); for (int i = 0; i < strings.length; i++) { if (resultBuilder.length() > 0) { resultBuilder.append(System.lineSeparator...
// Path: src/test/KitMatchers.java // public static Matcher<Integer> suits(final SystemExitStatus systemExitStatus, final boolean mandatory) { // return new BaseMatcher<Integer>() { // // @Override // public boolean matches(final Object testObject) { // Integer status = (Integer) testObject; // return syste...
return new NoOutputRun("quit");
jGleitz/JUnit-KIT
src/test/InteractiveConsoleTest.java
// Path: src/test/KitMatchers.java // public static Matcher<Integer> suits(final SystemExitStatus systemExitStatus, final boolean mandatory) { // return new BaseMatcher<Integer>() { // // @Override // public boolean matches(final Object testObject) { // Integer status = (Integer) testObject; // return syste...
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; import static test.KitMatchers.suits; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Vector...
* Gets called before each test run. Sets the allowed system exit status to {@link SystemExitStatus#WITH_0}. * Override this method if you wish to have another default system exit status. * <p> * <i>Deprecated. Please use {@link #setAllowedSystemExitStatus(SystemExitStatus)} and * {@link #setExpectedSystem...
// Path: src/test/KitMatchers.java // public static Matcher<Integer> suits(final SystemExitStatus systemExitStatus, final boolean mandatory) { // return new BaseMatcher<Integer>() { // // @Override // public boolean matches(final Object testObject) { // Integer status = (Integer) testObject; // return syste...
suits(expectedExitStatus, true));
jGleitz/JUnit-KIT
src/test/InteractiveConsoleTest.java
// Path: src/test/KitMatchers.java // public static Matcher<Integer> suits(final SystemExitStatus systemExitStatus, final boolean mandatory) { // return new BaseMatcher<Integer>() { // // @Override // public boolean matches(final Object testObject) { // Integer status = (Integer) testObject; // return syste...
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; import static test.KitMatchers.suits; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Vector...
* class does not necessary have to call {@code System.exit}. */ protected final void setExpectedSystemExitStatus(SystemExitStatus status) { expectedExitStatus = status; } /** * @param s * A String. * @return An Array containing {@code s} as only element. */ protected ...
// Path: src/test/KitMatchers.java // public static Matcher<Integer> suits(final SystemExitStatus systemExitStatus, final boolean mandatory) { // return new BaseMatcher<Integer>() { // // @Override // public boolean matches(final Object testObject) { // Integer status = (Integer) testObject; // return syste...
throw new FrameworkException("The timeout set in the configuration cannot be parsed into an integer!");
jGleitz/JUnit-KIT
src/test/runs/LineRun.java
// Path: src/test/KitMatchers.java // public static Matcher<String[]> hasExcactlyThatMuch(final int count, final String[] outputDescription) { // return hasExcactlyThatMuch(count, outputDescription, null); // }
import static test.KitMatchers.hasExcactlyThatMuch; import static org.junit.Assert.assertThat; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Scanner; import org.hamcrest.Matcher;
package test.runs; /** * A test run for matching the method's whole output for one command line by line. All calls to * {@code Terminal.printLine} will be merged into one String, each call separated by {@code \n}, and can then be matched * line by line. * * @author Joshua Gleitze * @version 1.0 */ public cl...
// Path: src/test/KitMatchers.java // public static Matcher<String[]> hasExcactlyThatMuch(final int count, final String[] outputDescription) { // return hasExcactlyThatMuch(count, outputDescription, null); // } // Path: src/test/runs/LineRun.java import static test.KitMatchers.hasExcactlyThatMuch; import static org....
assertThat(overallErrorMessage, outputLines, hasExcactlyThatMuch(expectedResults.size(), new String[] {
jGleitz/JUnit-KIT
src/final2/subtests/PrintTest.java
// Path: src/test/Input.java // public class Input { // private static HashMap<String, String[]> filesMap = new HashMap<>(); // private static HashMap<String[], String> reverseFileMap = new HashMap<>(); // // /** // * This class is not meant to be instantiated. // */ // private Input() { // } // // /** // ...
import org.junit.Test; import test.Input; import test.runs.Run;
package final2.subtests; /** * Checks the {@code print} command without running any other commands. Asserts that {@code print} works, which is * crucial for other tests to work. * * @author Joshua Gleitze */ public class PrintTest extends LangtonSubtest { @Test public void correctInputFilePrintTest() { St...
// Path: src/test/Input.java // public class Input { // private static HashMap<String, String[]> filesMap = new HashMap<>(); // private static HashMap<String[], String> reverseFileMap = new HashMap<>(); // // /** // * This class is not meant to be instantiated. // */ // private Input() { // } // // /** // ...
runs = new Run[] {
jGleitz/JUnit-KIT
src/test/runs/ExactRun.java
// Path: src/test/KitMatchers.java // public static Matcher<String[]> hasExcactlyThatMuch(final int count, final String[] outputDescription) { // return hasExcactlyThatMuch(count, outputDescription, null); // }
import static test.KitMatchers.hasExcactlyThatMuch; import static org.junit.Assert.assertThat; import java.util.Arrays; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import org.hamcrest.Matcher;
package test.runs; /** * A test run for exact matching. For each expected call to {@code Terminal.printLine}, one matcher has to be provided. * If {@code n} matchers are provided and the tested class fails to call {@code Terminal.printLine} exactly {@code n} * times, the run is considered to have failed. * * ...
// Path: src/test/KitMatchers.java // public static Matcher<String[]> hasExcactlyThatMuch(final int count, final String[] outputDescription) { // return hasExcactlyThatMuch(count, outputDescription, null); // } // Path: src/test/runs/ExactRun.java import static test.KitMatchers.hasExcactlyThatMuch; import static org...
Matcher<String[]> hasCorrectCallNumber = hasExcactlyThatMuch(expectedOutputMatchers.size(), new String[] {
RetroShare/AndroidClient
RetroShareAndroidIntegration/src/org/retroshare/android/RetroShareAndroidProxy.java
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsCtrlService.java // public enum ConnectionError // { // /** // * No error // */ // NONE, // // /** // * The IP address of the host could not be determined. // */ // UnknownHostException, // // /** // * Signals that an error occurred whi...
import org.retroshare.android.RsCtrlService.ConnectionEvent; import org.retroshare.android.RsCtrlService.RsCtrlServiceListener; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set...
{ for ( RsBund bund : serverBunds.values() ) { RsServerData sd = bund.server.getServerData(); mDatapack.serverDataMap.put( sd.name, sd ); } try { Log.v(TAG, "trying to save Datapack, Datapack.serverDataMapt=" + mDatapack.serverDataMap); ObjectOutputStream o = new ObjectOutputStream(openFileOutp...
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsCtrlService.java // public enum ConnectionError // { // /** // * No error // */ // NONE, // // /** // * The IP address of the host could not be determined. // */ // UnknownHostException, // // /** // * Signals that an error occurred whi...
public void onConnectionStateChanged(ConnectionEvent ce)
RetroShare/AndroidClient
RetroShareAndroidIntegration/src/org/retroshare/android/RetroShareAndroidProxy.java
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsCtrlService.java // public enum ConnectionError // { // /** // * No error // */ // NONE, // // /** // * The IP address of the host could not be determined. // */ // UnknownHostException, // // /** // * Signals that an error occurred whi...
import org.retroshare.android.RsCtrlService.ConnectionEvent; import org.retroshare.android.RsCtrlService.RsCtrlServiceListener; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set...
// new new don't delete public static class HandlerThread extends Handler implements HandlerThreadInterface { @Override public void postToHandlerThread(Runnable r) { post(r); } } @Override public void onConnectionStateChanged(ConnectionEvent ce) { if( ce.kind == RsCtrlService.ConnectionEventKind.SERVER_...
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsCtrlService.java // public enum ConnectionError // { // /** // * No error // */ // NONE, // // /** // * The IP address of the host could not be determined. // */ // UnknownHostException, // // /** // * Signals that an error occurred whi...
else if(bund.server.getLastConnectionError() != ConnectionError.NONE) hasError = true;
RetroShare/AndroidClient
RetroShareAndroidIntegration/src/org/retroshare/android/ContactMethodChooserActivity.java
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsConversationService.java // public static final class PgpChatId extends ConversationId // { // public String getDestPgpId() { return mPgpId; } // @Override public ConversationKind getConversationKind(){ return ConversationKind.PGP_CHAT; } // @Overrid...
import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import org.retroshare.android.RsConversationService.PgpChatId;
/** * @license * * Copyright (c) 2013 Gioacchino Mazzurco <gio@eigenlab.org>. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any...
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsConversationService.java // public static final class PgpChatId extends ConversationId // { // public String getDestPgpId() { return mPgpId; } // @Override public ConversationKind getConversationKind(){ return ConversationKind.PGP_CHAT; } // @Overrid...
i.putExtra(ConversationFragmentActivity.CONVERSATION_ID_EXTRA_KEY, PgpChatId.Factory.getPgpChatId(pgpId));
RetroShare/AndroidClient
RetroShareAndroidIntegration/src/org/retroshare/android/ListSearchesActivity.java
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsSearchService.java // public interface SearchResponseHandler { public void onSearchResponseReceived(int id); }
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.retroshare.android.RsSearchService.SearchResponseHandler; import android.content.Context; import android.content.Intent; import android.database.DataSetObserver; import android.os.Bundle; import android.util.Lo...
setContentView(R.layout.activity_listsearches); editText=(EditText) findViewById(R.id.searchEditText_ListSearchesActivity); listView=(ListView) findViewById(R.id.searchListView_ListSearchesActivity); editText.setOnKeyListener(new KeyListener()); adapter...
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsSearchService.java // public interface SearchResponseHandler { public void onSearchResponseReceived(int id); } // Path: RetroShareAndroidIntegration/src/org/retroshare/android/ListSearchesActivity.java import java.util.ArrayList; import java.util.Hash...
private class ResponseHandler implements SearchResponseHandler
RetroShare/AndroidClient
RetroShareAndroidIntegration/src/org/retroshare/android/LobbiesListFragment.java
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsConversationService.java // public static class RsConversationServiceListenerUniqueHandleFactory // { // public static Long getNewUniqueHandle() // { // Long ret = new Long(System.currentTimeMillis()); // while(repository.contains(ret)) ret = new ...
import android.app.Activity; import android.content.ComponentName; import android.content.Intent; import android.database.DataSetObserver; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.SystemClock; import android.view.ContextMenu; import a...
return fv; } @Override public void onAttach(Activity a) { super.onAttach(a); mInflater = a.getLayoutInflater(); } @Override public void onServiceConnected(ComponentName className, IBinder service) { super.onServiceConnected(className, service); if(mHandler == null) mHandler = new Handler(); mHandler.p...
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsConversationService.java // public static class RsConversationServiceListenerUniqueHandleFactory // { // public static Long getNewUniqueHandle() // { // Long ret = new Long(System.currentTimeMillis()); // while(repository.contains(ret)) ret = new ...
private final Long handle = RsConversationServiceListenerUniqueHandleFactory.getNewUniqueHandle();
RetroShare/AndroidClient
RetroShareAndroidIntegration/src/org/retroshare/android/ConversationFragmentActivity.java
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsConversationService.java // public static abstract class ConversationId implements Parcelable // { // abstract public ConversationKind getConversationKind(); // @Override public int describeContents() { return getConversationKind().ordinal(); } // }
import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import org.retroshare.android.RsConversationService.ConversationId;
/** * @license * * Copyright (c) 2013 Gioacchino Mazzurco <gio@eigenlab.org> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any ...
// Path: RetroShareAndroidIntegration/src/org/retroshare/android/RsConversationService.java // public static abstract class ConversationId implements Parcelable // { // abstract public ConversationKind getConversationKind(); // @Override public int describeContents() { return getConversationKind().ordinal(); } // } ...
private ConversationId lastConversationId;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/CartItemDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
import com.efoodstore.dao.CartItemDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; i...
package com.efoodstore.dao.impl; @Repository @Transactional
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
public class CartItemDaoImpl implements CartItemDao{
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/CartItemDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
import com.efoodstore.dao.CartItemDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; i...
package com.efoodstore.dao.impl; @Repository @Transactional public class CartItemDaoImpl implements CartItemDao{ @Autowired private SessionFactory sessionFactory;
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
public void addCartItem(CartItem cartItem) {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/CartItemDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
import com.efoodstore.dao.CartItemDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; i...
package com.efoodstore.dao.impl; @Repository @Transactional public class CartItemDaoImpl implements CartItemDao{ @Autowired private SessionFactory sessionFactory; public void addCartItem(CartItem cartItem) { Session session = sessionFactory.getCurrentSession(); session.saveOrUpdate(car...
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
public void removeAllCartItems(Cart cart) {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CustomerOrderServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
import com.efoodstore.dao.CustomerOrderDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import com.efoodstore.model.CustomerOrder; import com.efoodstore.service.CartService; import com.efoodstore.service.CustomerOrderService; import org.springframework.beans.factory.annotation.Autowired; imp...
package com.efoodstore.service.impl; @Service public class CustomerOrderServiceImpl implements CustomerOrderService { @Autowired
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
private CustomerOrderDao customerOrderDao;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CustomerOrderServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
import com.efoodstore.dao.CustomerOrderDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import com.efoodstore.model.CustomerOrder; import com.efoodstore.service.CartService; import com.efoodstore.service.CustomerOrderService; import org.springframework.beans.factory.annotation.Autowired; imp...
package com.efoodstore.service.impl; @Service public class CustomerOrderServiceImpl implements CustomerOrderService { @Autowired private CustomerOrderDao customerOrderDao; @Autowired
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
private CartService cartService;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CustomerOrderServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
import com.efoodstore.dao.CustomerOrderDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import com.efoodstore.model.CustomerOrder; import com.efoodstore.service.CartService; import com.efoodstore.service.CustomerOrderService; import org.springframework.beans.factory.annotation.Autowired; imp...
package com.efoodstore.service.impl; @Service public class CustomerOrderServiceImpl implements CustomerOrderService { @Autowired private CustomerOrderDao customerOrderDao; @Autowired private CartService cartService;
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
public void addCustomerOrder(CustomerOrder customerOrder) {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CustomerOrderServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
import com.efoodstore.dao.CustomerOrderDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import com.efoodstore.model.CustomerOrder; import com.efoodstore.service.CartService; import com.efoodstore.service.CustomerOrderService; import org.springframework.beans.factory.annotation.Autowired; imp...
package com.efoodstore.service.impl; @Service public class CustomerOrderServiceImpl implements CustomerOrderService { @Autowired private CustomerOrderDao customerOrderDao; @Autowired private CartService cartService; public void addCustomerOrder(CustomerOrder customerOrder) { customerO...
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
Cart cart = cartService.getCartById(cartId);
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CustomerOrderServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
import com.efoodstore.dao.CustomerOrderDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import com.efoodstore.model.CustomerOrder; import com.efoodstore.service.CartService; import com.efoodstore.service.CustomerOrderService; import org.springframework.beans.factory.annotation.Autowired; imp...
package com.efoodstore.service.impl; @Service public class CustomerOrderServiceImpl implements CustomerOrderService { @Autowired private CustomerOrderDao customerOrderDao; @Autowired private CartService cartService; public void addCustomerOrder(CustomerOrder customerOrder) { customerO...
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static fin...
List<CartItem> cartItems = cart.getCartItems();
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/controller/ProductController.java
// Path: src/main/java/com/efoodstore/model/Product.java // @Entity // public class Product implements Serializable{ // // private static final long serialVersionUID = -3532377236419382983L; // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private int productId; // // @NotEmpty (me...
import com.efoodstore.model.Product; import com.efoodstore.service.ProductService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework...
package com.efoodstore.controller; @Controller @RequestMapping("/product") public class ProductController { @Autowired
// Path: src/main/java/com/efoodstore/model/Product.java // @Entity // public class Product implements Serializable{ // // private static final long serialVersionUID = -3532377236419382983L; // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private int productId; // // @NotEmpty (me...
private ProductService productService;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/controller/ProductController.java
// Path: src/main/java/com/efoodstore/model/Product.java // @Entity // public class Product implements Serializable{ // // private static final long serialVersionUID = -3532377236419382983L; // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private int productId; // // @NotEmpty (me...
import com.efoodstore.model.Product; import com.efoodstore.service.ProductService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework...
package com.efoodstore.controller; @Controller @RequestMapping("/product") public class ProductController { @Autowired private ProductService productService; @RequestMapping("/productList/all") public String getProducts(Model model) {
// Path: src/main/java/com/efoodstore/model/Product.java // @Entity // public class Product implements Serializable{ // // private static final long serialVersionUID = -3532377236419382983L; // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private int productId; // // @NotEmpty (me...
List<Product> products = productService.getProductList();
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CustomerServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CustomerDao.java // public interface CustomerDao { // // void addCustomer (Customer customer); // // Customer getCustomerById (int customerId); // // List<Customer> getAllCustomers(); // // Customer getCustomerByUsername (String username); // // } // // Pa...
import com.efoodstore.dao.CustomerDao; import com.efoodstore.model.Customer; import com.efoodstore.service.CustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List;
package com.efoodstore.service.impl; @Service public class CustomerServiceImpl implements CustomerService{ @Autowired
// Path: src/main/java/com/efoodstore/dao/CustomerDao.java // public interface CustomerDao { // // void addCustomer (Customer customer); // // Customer getCustomerById (int customerId); // // List<Customer> getAllCustomers(); // // Customer getCustomerByUsername (String username); // // } // // Pa...
private CustomerDao customerDao;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CustomerServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CustomerDao.java // public interface CustomerDao { // // void addCustomer (Customer customer); // // Customer getCustomerById (int customerId); // // List<Customer> getAllCustomers(); // // Customer getCustomerByUsername (String username); // // } // // Pa...
import com.efoodstore.dao.CustomerDao; import com.efoodstore.model.Customer; import com.efoodstore.service.CustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List;
package com.efoodstore.service.impl; @Service public class CustomerServiceImpl implements CustomerService{ @Autowired private CustomerDao customerDao;
// Path: src/main/java/com/efoodstore/dao/CustomerDao.java // public interface CustomerDao { // // void addCustomer (Customer customer); // // Customer getCustomerById (int customerId); // // List<Customer> getAllCustomers(); // // Customer getCustomerByUsername (String username); // // } // // Pa...
public void addCustomer (Customer customer) {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/CustomerOrderDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/CustomerOrder.java // @Entity // public class CustomerOrder implements Serializable{ // // p...
import com.efoodstore.dao.CustomerOrderDao; import com.efoodstore.model.CustomerOrder; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Tra...
package com.efoodstore.dao.impl; @Repository @Transactional
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/CustomerOrder.java // @Entity // public class CustomerOrder implements Serializable{ // // p...
public class CustomerOrderDaoImpl implements CustomerOrderDao{
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/CustomerOrderDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/CustomerOrder.java // @Entity // public class CustomerOrder implements Serializable{ // // p...
import com.efoodstore.dao.CustomerOrderDao; import com.efoodstore.model.CustomerOrder; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Tra...
package com.efoodstore.dao.impl; @Repository @Transactional public class CustomerOrderDaoImpl implements CustomerOrderDao{ @Autowired private SessionFactory sessionFactory;
// Path: src/main/java/com/efoodstore/dao/CustomerOrderDao.java // public interface CustomerOrderDao { // // void addCustomerOrder(CustomerOrder customerOrder); // // } // // Path: src/main/java/com/efoodstore/model/CustomerOrder.java // @Entity // public class CustomerOrder implements Serializable{ // // p...
public void addCustomerOrder(CustomerOrder customerOrder) {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/ProductDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/ProductDao.java // public interface ProductDao { // // List<Product> getProductList(); // // Product getProductById(int id); // // void addProduct(Product product); // // void editProduct(Product product); // // void deleteProduct(Product product); // }...
import com.efoodstore.dao.ProductDao; import com.efoodstore.model.Product; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springframework.transactio...
package com.efoodstore.dao.impl; @Repository @Transactional
// Path: src/main/java/com/efoodstore/dao/ProductDao.java // public interface ProductDao { // // List<Product> getProductList(); // // Product getProductById(int id); // // void addProduct(Product product); // // void editProduct(Product product); // // void deleteProduct(Product product); // }...
public class ProductDaoImpl implements ProductDao {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/ProductDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/ProductDao.java // public interface ProductDao { // // List<Product> getProductList(); // // Product getProductById(int id); // // void addProduct(Product product); // // void editProduct(Product product); // // void deleteProduct(Product product); // }...
import com.efoodstore.dao.ProductDao; import com.efoodstore.model.Product; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springframework.transactio...
package com.efoodstore.dao.impl; @Repository @Transactional public class ProductDaoImpl implements ProductDao { @Autowired private SessionFactory sessionFactory;
// Path: src/main/java/com/efoodstore/dao/ProductDao.java // public interface ProductDao { // // List<Product> getProductList(); // // Product getProductById(int id); // // void addProduct(Product product); // // void editProduct(Product product); // // void deleteProduct(Product product); // }...
public Product getProductById (int id) {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/CartItemDao.java
// Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static final long serialVersionUID = 3940548625296145582L; // // @Id // @GeneratedValue // private int cartId; // // @OneToMany(mappedBy = "cart", cascade = CascadeType.AL...
import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem;
package com.efoodstore.dao; public interface CartItemDao { void addCartItem(CartItem cartItem); void removeCartItem(CartItem cartItem);
// Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static final long serialVersionUID = 3940548625296145582L; // // @Id // @GeneratedValue // private int cartId; // // @OneToMany(mappedBy = "cart", cascade = CascadeType.AL...
void removeAllCartItems(Cart cart);
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/controller/CartController.java
// Path: src/main/java/com/efoodstore/model/Customer.java // @Entity // public class Customer implements Serializable{ // // private static final long serialVersionUID = 5140900014886997914L; // // @Id // @GeneratedValue // private int customerId; // // @NotEmpty (message = "The customer name mus...
import com.efoodstore.model.Customer; import com.efoodstore.service.CustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.User; import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; import org.springframework.stere...
package com.efoodstore.controller; @Controller @RequestMapping("/customer/cart") public class CartController { @Autowired
// Path: src/main/java/com/efoodstore/model/Customer.java // @Entity // public class Customer implements Serializable{ // // private static final long serialVersionUID = 5140900014886997914L; // // @Id // @GeneratedValue // private int customerId; // // @NotEmpty (message = "The customer name mus...
private CustomerService customerService;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/controller/CartController.java
// Path: src/main/java/com/efoodstore/model/Customer.java // @Entity // public class Customer implements Serializable{ // // private static final long serialVersionUID = 5140900014886997914L; // // @Id // @GeneratedValue // private int customerId; // // @NotEmpty (message = "The customer name mus...
import com.efoodstore.model.Customer; import com.efoodstore.service.CustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.User; import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; import org.springframework.stere...
package com.efoodstore.controller; @Controller @RequestMapping("/customer/cart") public class CartController { @Autowired private CustomerService customerService; @RequestMapping public String getCart(@AuthenticationPrincipal User activeUser){
// Path: src/main/java/com/efoodstore/model/Customer.java // @Entity // public class Customer implements Serializable{ // // private static final long serialVersionUID = 5140900014886997914L; // // @Id // @GeneratedValue // private int customerId; // // @NotEmpty (message = "The customer name mus...
Customer customer = customerService.getCustomerByUsername (activeUser.getUsername());
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/CartItemService.java
// Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static final long serialVersionUID = 3940548625296145582L; // // @Id // @GeneratedValue // private int cartId; // // @OneToMany(mappedBy = "cart", cascade = CascadeType.AL...
import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem;
package com.efoodstore.service; public interface CartItemService { void addCartItem(CartItem cartItem); void removeCartItem(CartItem cartItem);
// Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implements Serializable { // // private static final long serialVersionUID = 3940548625296145582L; // // @Id // @GeneratedValue // private int cartId; // // @OneToMany(mappedBy = "cart", cascade = CascadeType.AL...
void removeAllCartItems(Cart cart);
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/ProductServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/ProductDao.java // public interface ProductDao { // // List<Product> getProductList(); // // Product getProductById(int id); // // void addProduct(Product product); // // void editProduct(Product product); // // void deleteProduct(Product product); // }...
import com.efoodstore.dao.ProductDao; import com.efoodstore.model.Product; import com.efoodstore.service.ProductService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List;
package com.efoodstore.service.impl; @Service public class ProductServiceImpl implements ProductService { @Autowired
// Path: src/main/java/com/efoodstore/dao/ProductDao.java // public interface ProductDao { // // List<Product> getProductList(); // // Product getProductById(int id); // // void addProduct(Product product); // // void editProduct(Product product); // // void deleteProduct(Product product); // }...
private ProductDao productDao;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/ProductServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/ProductDao.java // public interface ProductDao { // // List<Product> getProductList(); // // Product getProductById(int id); // // void addProduct(Product product); // // void editProduct(Product product); // // void deleteProduct(Product product); // }...
import com.efoodstore.dao.ProductDao; import com.efoodstore.model.Product; import com.efoodstore.service.ProductService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List;
package com.efoodstore.service.impl; @Service public class ProductServiceImpl implements ProductService { @Autowired private ProductDao productDao;
// Path: src/main/java/com/efoodstore/dao/ProductDao.java // public interface ProductDao { // // List<Product> getProductList(); // // Product getProductById(int id); // // void addProduct(Product product); // // void editProduct(Product product); // // void deleteProduct(Product product); // }...
public Product getProductById (int productId) {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/controller/admin/AdminProduct.java
// Path: src/main/java/com/efoodstore/model/Product.java // @Entity // public class Product implements Serializable{ // // private static final long serialVersionUID = -3532377236419382983L; // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private int productId; // // @NotEmpty (me...
import com.efoodstore.model.Product; import com.efoodstore.service.ProductService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bin...
package com.efoodstore.controller.admin; @Controller @RequestMapping("/admin") public class AdminProduct { private Path path; @Autowired
// Path: src/main/java/com/efoodstore/model/Product.java // @Entity // public class Product implements Serializable{ // // private static final long serialVersionUID = -3532377236419382983L; // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private int productId; // // @NotEmpty (me...
private ProductService productService;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/controller/admin/AdminProduct.java
// Path: src/main/java/com/efoodstore/model/Product.java // @Entity // public class Product implements Serializable{ // // private static final long serialVersionUID = -3532377236419382983L; // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private int productId; // // @NotEmpty (me...
import com.efoodstore.model.Product; import com.efoodstore.service.ProductService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bin...
package com.efoodstore.controller.admin; @Controller @RequestMapping("/admin") public class AdminProduct { private Path path; @Autowired private ProductService productService; @RequestMapping("/product/addProduct") public String addProduct(Model model) {
// Path: src/main/java/com/efoodstore/model/Product.java // @Entity // public class Product implements Serializable{ // // private static final long serialVersionUID = -3532377236419382983L; // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private int productId; // // @NotEmpty (me...
Product product = new Product();
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CartItemServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
import com.efoodstore.dao.CartItemDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import com.efoodstore.service.CartItemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;
package com.efoodstore.service.impl; @Service public class CartItemServiceImpl implements CartItemService{ @Autowired
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
private CartItemDao cartItemDao;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CartItemServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
import com.efoodstore.dao.CartItemDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import com.efoodstore.service.CartItemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;
package com.efoodstore.service.impl; @Service public class CartItemServiceImpl implements CartItemService{ @Autowired private CartItemDao cartItemDao;
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
public void addCartItem(CartItem cartItem) {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CartItemServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
import com.efoodstore.dao.CartItemDao; import com.efoodstore.model.Cart; import com.efoodstore.model.CartItem; import com.efoodstore.service.CartItemService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;
package com.efoodstore.service.impl; @Service public class CartItemServiceImpl implements CartItemService{ @Autowired private CartItemDao cartItemDao; public void addCartItem(CartItem cartItem) { cartItemDao.addCartItem(cartItem); } public void removeCartItem(CartItem cartItem) { ...
// Path: src/main/java/com/efoodstore/dao/CartItemDao.java // public interface CartItemDao { // // void addCartItem(CartItem cartItem); // // void removeCartItem(CartItem cartItem); // // void removeAllCartItems(Cart cart); // // CartItem getCartItemByProductId (int productId); // // } // // Path:...
public void removeAllCartItems(Cart cart){
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/CartDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
import com.efoodstore.dao.CartDao; import com.efoodstore.model.Cart; import com.efoodstore.service.CustomerOrderService; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springfr...
package com.efoodstore.dao.impl; @Repository @Transactional
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
public class CartDaoImpl implements CartDao{
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/CartDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
import com.efoodstore.dao.CartDao; import com.efoodstore.model.Cart; import com.efoodstore.service.CustomerOrderService; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springfr...
package com.efoodstore.dao.impl; @Repository @Transactional public class CartDaoImpl implements CartDao{ @Autowired private SessionFactory sessionFactory; @Autowired
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
private CustomerOrderService customerOrderService;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/dao/impl/CartDaoImpl.java
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
import com.efoodstore.dao.CartDao; import com.efoodstore.model.Cart; import com.efoodstore.service.CustomerOrderService; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springfr...
package com.efoodstore.dao.impl; @Repository @Transactional public class CartDaoImpl implements CartDao{ @Autowired private SessionFactory sessionFactory; @Autowired private CustomerOrderService customerOrderService;
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
public Cart getCartById (int cartId) {
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CartServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
import com.efoodstore.dao.CartDao; import com.efoodstore.model.Cart; import com.efoodstore.service.CartService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;
package com.efoodstore.service.impl; @Service public class CartServiceImpl implements CartService { @Autowired
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
private CartDao cartDao;
OliviaLiyuanWei/Foodtastic-e-foodstore-website
src/main/java/com/efoodstore/service/impl/CartServiceImpl.java
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
import com.efoodstore.dao.CartDao; import com.efoodstore.model.Cart; import com.efoodstore.service.CartService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;
package com.efoodstore.service.impl; @Service public class CartServiceImpl implements CartService { @Autowired private CartDao cartDao;
// Path: src/main/java/com/efoodstore/dao/CartDao.java // public interface CartDao { // // Cart getCartById (int cartId); // // Cart validate(int cartId) throws IOException; // // void update(Cart cart); // } // // Path: src/main/java/com/efoodstore/model/Cart.java // @Entity // public class Cart implem...
public Cart getCartById(int cartId) {
jMotif/SAX
src/test/java/net/seninp/jmotif/sax/datastructures/TestFrequencyTableEntry.java
// Path: src/main/java/net/seninp/jmotif/sax/datastructure/FrequencyTableEntry.java // public class FrequencyTableEntry implements Comparable<FrequencyTableEntry> { // // private int position; // private char[] payload; // private int frequency; // // /** // * Constructor. // * // * @param len the l...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.junit.Test; import net.seninp.jmotif.sax.datastructure.FrequencyTableEntry;
package net.seninp.jmotif.sax.datastructures; /** * Test frequency table entry. * * @author psenin * */ public class TestFrequencyTableEntry { @Test public void testFrequencyTableEntryIntInt() {
// Path: src/main/java/net/seninp/jmotif/sax/datastructure/FrequencyTableEntry.java // public class FrequencyTableEntry implements Comparable<FrequencyTableEntry> { // // private int position; // private char[] payload; // private int frequency; // // /** // * Constructor. // * // * @param len the l...
final FrequencyTableEntry fe1 = new FrequencyTableEntry(10, 11);
jMotif/SAX
src/main/java/net/seninp/jmotif/sax/datastructure/DoublyLinkedSortedList.java
// Path: src/main/java/net/seninp/util/StackTrace.java // public final class StackTrace { // // /** Disable public constructor. */ // private StackTrace() { // // do nothing // } // // /** // * Converts the Throwable.getStackTrace to a String representation for logging. // * // * @param throwabl...
import java.util.Comparator; import java.util.Iterator; import java.util.NoSuchElementException; import net.seninp.util.StackTrace;
public MyIterator(DoublyLinkedSortedList<T> doublyLinkedSortedList) { this.list = doublyLinkedSortedList; } @Override public boolean hasNext() { if (null == this.current) { if (this.list.isEmpty()) { return false; } return true; } if (null == th...
// Path: src/main/java/net/seninp/util/StackTrace.java // public final class StackTrace { // // /** Disable public constructor. */ // private StackTrace() { // // do nothing // } // // /** // * Converts the Throwable.getStackTrace to a String representation for logging. // * // * @param throwabl...
"There was an exception thrown: " + StackTrace.toString(e));
jMotif/SAX
src/test/java/net/seninp/jmotif/sax/datastructures/TestMagicArrayEntry.java
// Path: src/main/java/net/seninp/jmotif/sax/registry/MagicArrayEntry.java // public class MagicArrayEntry implements Comparable<MagicArrayEntry> { // // protected String word; // protected int freq; // // public MagicArrayEntry(String payload, int frequency) { // this.word = payload; // this.freq = fre...
import static org.junit.Assert.*; import org.junit.Test; import net.seninp.jmotif.sax.registry.MagicArrayEntry;
package net.seninp.jmotif.sax.datastructures; public class TestMagicArrayEntry { private static final String PAYLOAD1 = "aaa"; private static final int FREQUENCY1 = 2; private static final String PAYLOAD2 = "bbb"; private static final int FREQUENCY2 = 7; @Test public void testHashCode() {
// Path: src/main/java/net/seninp/jmotif/sax/registry/MagicArrayEntry.java // public class MagicArrayEntry implements Comparable<MagicArrayEntry> { // // protected String word; // protected int freq; // // public MagicArrayEntry(String payload, int frequency) { // this.word = payload; // this.freq = fre...
MagicArrayEntry entry1 = new MagicArrayEntry(PAYLOAD1, FREQUENCY1);
jMotif/SAX
src/main/java/net/seninp/jmotif/sax/bitmap/BitmapParameters.java
// Path: src/main/java/net/seninp/jmotif/sax/NumerosityReductionStrategy.java // public enum NumerosityReductionStrategy { // // /** No reduction at all - all the words going make it into collection. */ // NONE(0), // // /** Exact - the strategy based on the exact string match. */ // EXACT(1), // // /** Cl...
import java.util.ArrayList; import java.util.List; import com.beust.jcommander.Parameter; import net.seninp.jmotif.sax.NumerosityReductionStrategy;
package net.seninp.jmotif.sax.bitmap; /** * Parameters accepted by the bitmap printer and their default values. * * @author psenin * */ public class BitmapParameters { // general setup // @Parameter public List<String> parameters = new ArrayList<String>(); @Parameter(names = "--verbose", descriptio...
// Path: src/main/java/net/seninp/jmotif/sax/NumerosityReductionStrategy.java // public enum NumerosityReductionStrategy { // // /** No reduction at all - all the words going make it into collection. */ // NONE(0), // // /** Exact - the strategy based on the exact string match. */ // EXACT(1), // // /** Cl...
public static NumerosityReductionStrategy SAX_NR_STRATEGY = NumerosityReductionStrategy.NONE;
jMotif/SAX
src/main/java/net/seninp/jmotif/sax/alphabet/Alphabet.java
// Path: src/main/java/net/seninp/jmotif/sax/SAXException.java // public class SAXException extends Exception { // // /** The default serial version UID. */ // private static final long serialVersionUID = 1L; // // /** // * Thrown when some problem occurs. // * // * @param description The probl...
import net.seninp.jmotif.sax.SAXException;
package net.seninp.jmotif.sax.alphabet; /** * The Alphabet class template. * * @author Pavel Senin. * */ public abstract class Alphabet { /** * get the max size of the alphabet. * * @return maximum size of the alphabet. */ public abstract Integer getMaxSize(); /** * G...
// Path: src/main/java/net/seninp/jmotif/sax/SAXException.java // public class SAXException extends Exception { // // /** The default serial version UID. */ // private static final long serialVersionUID = 1L; // // /** // * Thrown when some problem occurs. // * // * @param description The probl...
public abstract double[] getCuts(Integer size) throws SAXException;
jMotif/SAX
src/test/java/net/seninp/jmotif/sax/TestSAXException.java
// Path: src/main/java/net/seninp/util/StackTrace.java // public final class StackTrace { // // /** Disable public constructor. */ // private StackTrace() { // // do nothing // } // // /** // * Converts the Throwable.getStackTrace to a String representation for logging. // * // * @param throwabl...
import static org.junit.Assert.assertTrue; import org.junit.Test; import net.seninp.util.StackTrace;
package net.seninp.jmotif.sax; /** * Tests the Stack Trace class. * * @author Philip Johnson */ public class TestSAXException { /** * Tests the Exception thrown. Generates an exception, makes the Stack Trace, and checks to see if * it seems OK. */ @Test public void testStackTrace() { String t...
// Path: src/main/java/net/seninp/util/StackTrace.java // public final class StackTrace { // // /** Disable public constructor. */ // private StackTrace() { // // do nothing // } // // /** // * Converts the Throwable.getStackTrace to a String representation for logging. // * // * @param throwabl...
trace = StackTrace.toString(e);
jMotif/SAX
src/test/java/net/seninp/jmotif/util/TestStackTrace.java
// Path: src/main/java/net/seninp/util/StackTrace.java // public final class StackTrace { // // /** Disable public constructor. */ // private StackTrace() { // // do nothing // } // // /** // * Converts the Throwable.getStackTrace to a String representation for logging. // * // * @param throwabl...
import static org.junit.Assert.assertTrue; import org.junit.Test; import net.seninp.util.StackTrace;
package net.seninp.jmotif.util; /** * Tests the Stack Trace class. * * @author Philip Johnson */ public class TestStackTrace { /** * Tests the Stack Tracing. Generates an exception, makes the Stack Trace, and checks to see if it * seems OK. */ @Test public void testStackTrace() { String trace...
// Path: src/main/java/net/seninp/util/StackTrace.java // public final class StackTrace { // // /** Disable public constructor. */ // private StackTrace() { // // do nothing // } // // /** // * Converts the Throwable.getStackTrace to a String representation for logging. // * // * @param throwabl...
trace = StackTrace.toString(e);
jMotif/SAX
src/test/java/net/seninp/jmotif/sax/datastructures/TestMotifRecord.java
// Path: src/main/java/net/seninp/jmotif/sax/motif/MotifRecord.java // public class MotifRecord { // // private int location; // private TreeSet<Integer> occurrences; // // /** // * Constructor. // * // * @param motifLiocation the motif location. // * @param motifOccurrences occurrence locations. /...
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import org.junit.Test; import net.seninp.jmotif.sax.motif.MotifRecord;
package net.seninp.jmotif.sax.datastructures; public class TestMotifRecord { @Test public void testMotifRecord() {
// Path: src/main/java/net/seninp/jmotif/sax/motif/MotifRecord.java // public class MotifRecord { // // private int location; // private TreeSet<Integer> occurrences; // // /** // * Constructor. // * // * @param motifLiocation the motif location. // * @param motifOccurrences occurrence locations. /...
MotifRecord mr = new MotifRecord(1, new ArrayList<Integer>());
jMotif/SAX
src/test/java/net/seninp/jmotif/sax/datastructures/TestSAXRecord.java
// Path: src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecord.java // public class SAXRecord implements Comparable<SAXRecord> { // // /** The payload. */ // private char[] saxString; // // /** The index of occurrences in the raw sequence. */ // private HashSet<Integer> occurrences; // // /** Disable...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import java.util.Collection; import org.junit.Test; import net.seninp.jmotif.sax.datastructu...
package net.seninp.jmotif.sax.datastructures; /** * Test data structures used in the SAX implementation. * * @author Pavel Senin. * */ public class TestSAXRecord { private static final Integer iNum1 = 7; private static final Integer iNum2 = 3; private static final String str11 = "abggfecbb"...
// Path: src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecord.java // public class SAXRecord implements Comparable<SAXRecord> { // // /** The payload. */ // private char[] saxString; // // /** The index of occurrences in the raw sequence. */ // private HashSet<Integer> occurrences; // // /** Disable...
SAXRecord se = new SAXRecord(str11.toCharArray(), iNum2);
jMotif/SAX
src/test/java/net/seninp/jmotif/util/TestUCRUtils.java
// Path: src/main/java/net/seninp/util/UCRUtils.java // public class UCRUtils { // // private static final String CR = "\n"; // // /** // * Reads bunch of series from file. First column treats as a class label. Rest as a real-valued // * series. // * // * @param fileName the input filename. // * @...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; import org.junit.Test; import net.seninp.util.UCRUtils;
package net.seninp.jmotif.util; public class TestUCRUtils { private static final String CBF_GOOD_FNAME = "src//resources//dataset/test_dataset_good.txt"; private static final String CBF_BAD_FNAME = "src//resources//dataset/test_dataset_bad.txt"; @Test public void testReadUCRData() { try {
// Path: src/main/java/net/seninp/util/UCRUtils.java // public class UCRUtils { // // private static final String CR = "\n"; // // /** // * Reads bunch of series from file. First column treats as a class label. Rest as a real-valued // * series. // * // * @param fileName the input filename. // * @...
Map<String, List<double[]>> data = UCRUtils.readUCRData(CBF_GOOD_FNAME);
jMotif/SAX
src/test/java/net/seninp/jmotif/util/TestMapEntry.java
// Path: src/main/java/net/seninp/util/JmotifMapEntry.java // public class JmotifMapEntry<K, V> implements Map.Entry<K, V> { // private final K key; // private V value; // // public JmotifMapEntry(K key, V value) { // this.key = key; // this.value = value; // } // // @Override // public K getKey()...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; import net.seninp.util.JmotifMapEntry;
package net.seninp.jmotif.util; public class TestMapEntry { private static final String KEY1 = "key1"; private static final String KEY2 = "key2"; private static final Integer KEY3 = 75; private static final String VALUE1 = "value1"; private static final String VALUE2 = "value2"; private static final Dou...
// Path: src/main/java/net/seninp/util/JmotifMapEntry.java // public class JmotifMapEntry<K, V> implements Map.Entry<K, V> { // private final K key; // private V value; // // public JmotifMapEntry(K key, V value) { // this.key = key; // this.value = value; // } // // @Override // public K getKey()...
private JmotifMapEntry<String, String> e1;
slezier/SimpleFunctionalTest
sft-core/src/test/java/sft/integration/set/Settings.java
// Path: sft-core/src/test/java/sft/integration/fixtures/JavaResource.java // public class JavaResource extends SftResource { // // private final HtmlResources htmlResources = new HtmlResources(); // private final SftDocumentationConfiguration configuration; // // public JavaResource(Class javaClass) { //...
import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import sft.Decorate; import sft.DefaultConfiguration; import sft.Displayable; import sft.SimpleFunctionalTest; import sft.Text; import sft.UseCase; import sft.decorators.Breadcrumb; import sft.decorators.Group; import sft.integration.fixtu...
package sft.integration.set; @RunWith(SimpleFunctionalTest.class) @Decorate(decorator = Breadcrumb.class) public class Settings { private static final String AVAILABLE_SETTINGS = "Available settings"; @Displayable private String files; private UseCase useCase; @Decorate(decorator = Group.class,...
// Path: sft-core/src/test/java/sft/integration/fixtures/JavaResource.java // public class JavaResource extends SftResource { // // private final HtmlResources htmlResources = new HtmlResources(); // private final SftDocumentationConfiguration configuration; // // public JavaResource(Class javaClass) { //...
useCase = new UseCase(CommonUseCase.class);
slezier/SimpleFunctionalTest
sft-core/src/test/java/sft/integration/set/Settings.java
// Path: sft-core/src/test/java/sft/integration/fixtures/JavaResource.java // public class JavaResource extends SftResource { // // private final HtmlResources htmlResources = new HtmlResources(); // private final SftDocumentationConfiguration configuration; // // public JavaResource(Class javaClass) { //...
import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import sft.Decorate; import sft.DefaultConfiguration; import sft.Displayable; import sft.SimpleFunctionalTest; import sft.Text; import sft.UseCase; import sft.decorators.Breadcrumb; import sft.decorators.Group; import sft.integration.fixtu...
package sft.integration.set; @RunWith(SimpleFunctionalTest.class) @Decorate(decorator = Breadcrumb.class) public class Settings { private static final String AVAILABLE_SETTINGS = "Available settings"; @Displayable private String files; private UseCase useCase; @Decorate(decorator = Group.class,...
// Path: sft-core/src/test/java/sft/integration/fixtures/JavaResource.java // public class JavaResource extends SftResource { // // private final HtmlResources htmlResources = new HtmlResources(); // private final SftDocumentationConfiguration configuration; // // public JavaResource(Class javaClass) { //...
new JavaResource(CustomConfiguration.class).getOpenResourceHtmlLink(this.getClass(), "custom configuration", "alert-info") +
slezier/SimpleFunctionalTest
sft-core/src/main/java/sft/report/HtmlReport.java
// Path: sft-core/src/main/java/sft/environment/TargetFolder.java // public class TargetFolder extends ResourceFolder { // public TargetFolder(String toProjectPath, String path) { // super(toProjectPath, path); // } // // public File createFileFromClass(Class<?> aClass, String extension) { // ...
import sft.*; import sft.decorators.*; import sft.environment.TargetFolder; import sft.report.decorators.*; import sft.result.*; import java.io.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher;
public String contextInstructionTemplate = " <div>\n" + " <span>@@@instruction.text@@@</span>\n" + " </div>\n"; public String relatedUseCasesTitleTemplate = " <div class=\"panel-heading\">\n" + ...
// Path: sft-core/src/main/java/sft/environment/TargetFolder.java // public class TargetFolder extends ResourceFolder { // public TargetFolder(String toProjectPath, String path) { // super(toProjectPath, path); // } // // public File createFileFromClass(Class<?> aClass, String extension) { // ...
private TargetFolder reportFolder;
slezier/SimpleFunctionalTest
sft-core/src/test/java/sft/integration/use/UsingDecorator.java
// Path: sft-core/src/test/java/sft/integration/fixtures/SftResources.java // public class SftResources { // // private final Class callerClass; // private final JavaResource javaResource; // private final SftResource htmlResource; // // public SftResources(Class callerClass, Class functionalTestClass...
import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import sft.Decorate; import sft.Displayable; import sft.FixturesHelper; import sft.SimpleFunctionalTest; import sft.Text; import sft.decorat...
Assert.assertTrue("Expecting class " + style + " in body", jUnitHtmlHelper.html.select("body.useCase").hasClass(style)); } @Text("Several style can be used together @Decorate(decorator = Style.class, parameters ={\"${style1}\",\"${style2}\",\"${style3}\"}) ") private void severalStylesCanBeSpecifie...
// Path: sft-core/src/test/java/sft/integration/fixtures/SftResources.java // public class SftResources { // // private final Class callerClass; // private final JavaResource javaResource; // private final SftResource htmlResource; // // public SftResources(Class callerClass, Class functionalTestClass...
jUnitHtmlHelper.run(this.getClass(), SubUseCaseBreadcrumb.class);
slezier/SimpleFunctionalTest
sft-core/src/test/java/sft/integration/use/UsingDecorator.java
// Path: sft-core/src/test/java/sft/integration/fixtures/SftResources.java // public class SftResources { // // private final Class callerClass; // private final JavaResource javaResource; // private final SftResource htmlResource; // // public SftResources(Class callerClass, Class functionalTestClass...
import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import sft.Decorate; import sft.Displayable; import sft.FixturesHelper; import sft.SimpleFunctionalTest; import sft.Text; import sft.decorat...
} private void ignoredScenariosAreNumberedAndDisplayedWithDirectAccess() { Elements digestTitles = jUnitHtmlHelper.html.select(".synthesis .digest.ignored .title"); Assert.assertEquals("2 scenarios ignored",digestTitles.get(0).text()); Assert.assertEquals("display: none;", jUnitHtmlHel...
// Path: sft-core/src/test/java/sft/integration/fixtures/SftResources.java // public class SftResources { // // private final Class callerClass; // private final JavaResource javaResource; // private final SftResource htmlResource; // // public SftResources(Class callerClass, Class functionalTestClass...
private ArrayList<SftResources> resources = new ArrayList<SftResources>();
slezier/SimpleFunctionalTest
sft-core/src/test/java/sft/junit/JUnitResultTest.java
// Path: sft-core/src/test/java/sft/integration/set/sut/CommonUseCase.java // @RunWith(SimpleFunctionalTest.class) // public class CommonUseCase { // // public SubUseCase1 subUseCase1 = new SubUseCase1(); // public SubUseCase2 subUseCase2 = new SubUseCase2(); // // @Test // public void scenario(){ // ...
import org.junit.Assert; import org.junit.Test; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import sft.integration.set.sut.CommonUseCase;
package sft.junit; public class JUnitResultTest { @Test public void toto() {
// Path: sft-core/src/test/java/sft/integration/set/sut/CommonUseCase.java // @RunWith(SimpleFunctionalTest.class) // public class CommonUseCase { // // public SubUseCase1 subUseCase1 = new SubUseCase1(); // public SubUseCase2 subUseCase2 = new SubUseCase2(); // // @Test // public void scenario(){ // ...
Result run = new JUnitCore().run(CommonUseCase.class);
slezier/SimpleFunctionalTest
sft-core/src/main/java/sft/ProjectFolder.java
// Path: sft-core/src/main/java/sft/environment/TargetFolder.java // public class TargetFolder extends ResourceFolder { // public TargetFolder(String toProjectPath, String path) { // super(toProjectPath, path); // } // // public File createFileFromClass(Class<?> aClass, String extension) { // ...
import sft.environment.ResourceFolder; import sft.environment.TargetFolder;
package sft; public class ProjectFolder { public static final String MAVEN_CLASSES_TEST_PATH = "target/test-classes/"; public static final String MAVEN_SOURCES_TEST_PATH = "src/test/java/"; private String sourcesTest = MAVEN_SOURCES_TEST_PATH; private String classesTest = MAVEN_CLASSES_TEST_PATH; ...
// Path: sft-core/src/main/java/sft/environment/TargetFolder.java // public class TargetFolder extends ResourceFolder { // public TargetFolder(String toProjectPath, String path) { // super(toProjectPath, path); // } // // public File createFileFromClass(Class<?> aClass, String extension) { // ...
public TargetFolder getTargetFolder(String path ){
slezier/SimpleFunctionalTest
sft-core/src/test/java/sft/integration/use/HumanizationCodeUsage.java
// Path: sft-core/src/test/java/sft/integration/use/sut/HumanizationUsingTextAnnotation.java // @RunWith(SimpleFunctionalTest.class) // @Text("Use case name specified in @Text") // public class HumanizationUsingTextAnnotation { // // @Test // @Text("Scenario name specified in @Text") // public void scenari...
import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import sft.Decorate; import sft.FixturesHelper; import sft.SimpleFunctionalTest; import sft.Text; import sft.decorators.Breadcrumb; import sft.integration.fixtures.JUnitHtmlHelper; import sft.integration.use.sut.HumanizationCamelCaseClassN...
package sft.integration.use; /* Class and methods could be humanized 3 different ways: */ @RunWith(SimpleFunctionalTest.class) @Decorate(decorator = Breadcrumb.class) @Text("Humanized your code: using camelCase or underscore transformation or annotation") public class HumanizationCodeUsage { @FixturesHelp...
// Path: sft-core/src/test/java/sft/integration/use/sut/HumanizationUsingTextAnnotation.java // @RunWith(SimpleFunctionalTest.class) // @Text("Use case name specified in @Text") // public class HumanizationUsingTextAnnotation { // // @Test // @Text("Scenario name specified in @Text") // public void scenari...
jUnitHtmlHelper.run(this.getClass(), Humanization_underscore_class_name_humanized.class);
slezier/SimpleFunctionalTest
sft-core/src/test/java/sft/integration/use/HumanizationCodeUsage.java
// Path: sft-core/src/test/java/sft/integration/use/sut/HumanizationUsingTextAnnotation.java // @RunWith(SimpleFunctionalTest.class) // @Text("Use case name specified in @Text") // public class HumanizationUsingTextAnnotation { // // @Test // @Text("Scenario name specified in @Text") // public void scenari...
import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import sft.Decorate; import sft.FixturesHelper; import sft.SimpleFunctionalTest; import sft.Text; import sft.decorators.Breadcrumb; import sft.integration.fixtures.JUnitHtmlHelper; import sft.integration.use.sut.HumanizationCamelCaseClassN...
@Test public void namingInCamelCase() throws IOException { allCaseChangesAreReplacedBySpaces(); } @Test public void namingUsingUnderscore() throws IOException { underscoreAreReplacedBySpace(); } @Test public void usingTextAnnotation() throws IOException { textsA...
// Path: sft-core/src/test/java/sft/integration/use/sut/HumanizationUsingTextAnnotation.java // @RunWith(SimpleFunctionalTest.class) // @Text("Use case name specified in @Text") // public class HumanizationUsingTextAnnotation { // // @Test // @Text("Scenario name specified in @Text") // public void scenari...
jUnitHtmlHelper.run(this.getClass(),HumanizationUsingTextAnnotation.class);
slezier/SimpleFunctionalTest
sft-md-report/src/main/java/sft/reports/markdown/decorators/MdNullDecorator.java
// Path: sft-core/src/main/java/sft/FixtureCall.java // public class FixtureCall { // // public final UseCase useCase; // public final String name; // public final int line; // public final Fixture fixture; // public final int emptyLine; // public ArrayList<String> parametersValues = new ArrayL...
import sft.ContextHandler; import sft.DefaultConfiguration; import sft.FixtureCall; import sft.UseCase; import sft.decorators.DecoratorReportImplementation; import sft.report.RelativePathResolver; import sft.reports.markdown.MarkdownReport; import sft.result.*; import java.io.PrintWriter; import java.io.StringWriter; i...
package sft.reports.markdown.decorators; public class MdNullDecorator implements DecoratorReportImplementation { private final DefaultConfiguration configuration; private final RelativePathResolver pathResolver = new RelativePathResolver(); public MdNullDecorator(DefaultConfiguration configuration) { ...
// Path: sft-core/src/main/java/sft/FixtureCall.java // public class FixtureCall { // // public final UseCase useCase; // public final String name; // public final int line; // public final Fixture fixture; // public final int emptyLine; // public ArrayList<String> parametersValues = new ArrayL...
for (FixtureCall fixtureCall : beforeUseCase.fixtureCalls) {