Skip to content

Commit

Permalink
write a line into test.file
Browse files Browse the repository at this point in the history
  • Loading branch information
huifer committed Sep 26, 2024
1 parent 8797eff commit 7675992
Show file tree
Hide file tree
Showing 6 changed files with 1,116 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/spring/csb126f69a-7ba7-11ef-8096-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.huifer.design.adapter.login;

/**
* <p>Title : NewLoginService </p>
* <p>Description : </p>
*
* @author huifer
* @date 2019-05-21
*/
public class NewLoginService extends LoginService {

public ResultMsg loginForQQ(String qqNumb) {

ResultMsg msg = super.regist(qqNumb, "qq默认密码");

ResultMsg login = super.login(qqNumb, "qq默认密码");

return login;
}

}
55 changes: 55 additions & 0 deletions docs/spring/csb1695ea4-7ba7-11ef-8096-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Copyright 2009-2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.annotations;

import java.lang.annotation.*;

/**
* The annotation that reference a cache.
*
* <p>If you use this annotation, should be specified either {@link #value()} or {@link #name()} attribute.
*
* <p><br>
* <b>How to use:</b>
* <pre>
* &#064;CacheNamespaceRef(UserMapper.class)
* public interface AdminUserMapper {
* // ...
* }
* </pre>
* @author Clinton Begin
* @author Kazuki Shimizu
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface CacheNamespaceRef {

/**
* Returns the namespace type to reference a cache (the namespace name become a FQCN of specified type).
*
* @return the namespace type to reference a cache
*/
Class<?> value() default void.class;

/**
* Returns the namespace name to reference a cache.
*
* @return the namespace name
* @since 3.4.2
*/
String name() default "";
}
52 changes: 52 additions & 0 deletions docs/spring/csb1a0fcf6-7ba7-11ef-8096-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package dynamic;

import com.rabbitmq.client.Channel;
import java.nio.charset.StandardCharsets;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;

public class DynamicConsumer {


private final SimpleMessageListenerContainer container;
private final DynamicConsumerContainerFactory factory;

public DynamicConsumerContainerFactory getFactory() {
return factory;
}

public DynamicConsumer(DynamicConsumerContainerFactory fac) throws Exception {
this.factory = fac;
SimpleMessageListenerContainer container = fac.getObject();
this.container = container;
}

public SimpleMessageListenerContainer getContainer() {
return container;
}

/**
* 开启处理
*/
public void start() {
container.start();
}

/**
* 停止处理
*/
public void stop() {
container.stop();
}


/**
* 关闭容器
*/
public void shutdown() {
container.shutdown();
}



}
90 changes: 90 additions & 0 deletions docs/spring/csb1d9e1c4-7ba7-11ef-8096-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/**
* Copyright 2009-2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.type;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

class LongTypeHandlerTest extends BaseTypeHandlerTest {

private static final TypeHandler<Long> TYPE_HANDLER = new LongTypeHandler();

@Override
@Test
public void shouldSetParameter() throws Exception {
TYPE_HANDLER.setParameter(ps, 1, 100L, null);
verify(ps).setLong(1, 100L);
}

@Override
@Test
public void shouldGetResultFromResultSetByName() throws Exception {
when(rs.getLong("column")).thenReturn(100L);
assertEquals(Long.valueOf(100L), TYPE_HANDLER.getResult(rs, "column"));

when(rs.getLong("column")).thenReturn(0L);
assertEquals(Long.valueOf(0L), TYPE_HANDLER.getResult(rs, "column"));
}

@Override
@Test
public void shouldGetResultNullFromResultSetByName() throws Exception {
when(rs.getLong("column")).thenReturn(0L);
when(rs.wasNull()).thenReturn(true);
assertNull(TYPE_HANDLER.getResult(rs, "column"));
}

@Override
@Test
public void shouldGetResultFromResultSetByPosition() throws Exception {
when(rs.getLong(1)).thenReturn(100L);
assertEquals(Long.valueOf(100L), TYPE_HANDLER.getResult(rs, 1));

when(rs.getLong(1)).thenReturn(0L);
assertEquals(Long.valueOf(0L), TYPE_HANDLER.getResult(rs, 1));
}

@Override
@Test
public void shouldGetResultNullFromResultSetByPosition() throws Exception {
when(rs.getLong(1)).thenReturn(0L);
when(rs.wasNull()).thenReturn(true);
assertNull(TYPE_HANDLER.getResult(rs, 1));
}

@Override
@Test
public void shouldGetResultFromCallableStatement() throws Exception {
when(cs.getLong(1)).thenReturn(100L);
assertEquals(Long.valueOf(100L), TYPE_HANDLER.getResult(cs, 1));

when(cs.getLong(1)).thenReturn(0L);
assertEquals(Long.valueOf(0L), TYPE_HANDLER.getResult(cs, 1));
}

@Override
@Test
public void shouldGetResultNullFromCallableStatement() throws Exception {
when(cs.getLong(1)).thenReturn(0L);
when(cs.wasNull()).thenReturn(true);
assertNull(TYPE_HANDLER.getResult(cs, 1));
}

}
Loading

0 comments on commit 7675992

Please sign in to comment.