Ejemplo n.º 1
0
func (this *ValidityMap) Get(key serial.String) Validity {
	this.RLock()
	defer this.RUnlock()
	if value, found := this.cache[key.String()]; found {
		return value
	}
	return nil
}
Ejemplo n.º 2
0
func (this *ValidityMap) Set(key serial.String, value Validity) {
	this.Lock()
	this.cache[key.String()] = value
	this.Unlock()
	opCount := atomic.AddInt32(&this.opCount, 1)
	if opCount > 1000 {
		atomic.StoreInt32(&this.opCount, 0)
		go this.cleanup()
	}
}
Ejemplo n.º 3
0
func (subject *Subject) Fail(displayString string, verb string, other serial.String) {
	subject.FailWithMessage("Not true that " + displayString + " " + verb + " <" + other.String() + ">.")
}
Ejemplo n.º 4
0
func (this *stdOutLogWriter) Log(log serial.String) {
	this.logger.Print(log.String() + platform.LineSeparator())
}
Ejemplo n.º 5
0
func (this *ValidityMap) Set(key serial.String, value Validity) {
	this.Lock()
	this.cache[key.String()] = value
	this.Unlock()
}
Ejemplo n.º 6
0
func (subject *StringSubject) NotContains(substring serial.String) {
	if strings.Contains(subject.value.String(), substring.String()) {
		subject.Fail(subject.DisplayString(), "doesn't contain", substring)
	}
}
Ejemplo n.º 7
0
func (subject *StringSubject) Contains(substring serial.String) {
	if !strings.Contains(subject.value.String(), substring.String()) {
		subject.Fail(subject.DisplayString(), "contains", substring)
	}
}