summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock')
-rw-r--r--src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/createmock.go245
-rw-r--r--src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/createmock_test.go233
-rw-r--r--src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/gcs/bucket.go23
-rw-r--r--src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.gcs_bucket125
-rw-r--r--src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.gcs_bucket_same_package124
-rw-r--r--src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.no_interfaces1
-rw-r--r--src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.no_package1
-rw-r--r--src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.unknown_interface1
-rw-r--r--src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.unknown_package1
9 files changed, 754 insertions, 0 deletions
diff --git a/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/createmock.go b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/createmock.go
new file mode 100644
index 00000000000..c5427dc8ba9
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/createmock.go
@@ -0,0 +1,245 @@
+// Copyright 2012 Aaron Jacobs. All Rights Reserved.
+// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable 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.
+
+// createmock is used to generate source code for mock versions of interfaces
+// from installed packages.
+package main
+
+import (
+ "errors"
+ "flag"
+ "fmt"
+ "go/build"
+ "io/ioutil"
+ "log"
+ "os"
+ "os/exec"
+ "path"
+ "regexp"
+ "text/template"
+
+ // Ensure that the generate package, which is used by the generated code, is
+ // installed by goinstall.
+ _ "github.com/smartystreets/assertions/internal/oglemock/generate"
+)
+
+var fSamePackage = flag.Bool(
+ "same_package",
+ false,
+ "Generate output appropriate for including in the same package as the "+
+ "mocked interfaces.")
+
+// A template for generated code that is used to print the result.
+const tmplStr = `
+{{$interfacePkgPath := .InterfacePkgPath}}
+
+package main
+
+import (
+ {{range $identifier, $import := .Imports}}
+ {{$identifier}} "{{$import}}"
+ {{end}}
+)
+
+func getTypeForPtr(ptr interface{}) reflect.Type {
+ return reflect.TypeOf(ptr).Elem()
+}
+
+func main() {
+ // Reduce noise in logging output.
+ log.SetFlags(0)
+
+ interfaces := []reflect.Type{
+ {{range $typeName := .TypeNames}}
+ getTypeForPtr((*{{pathBase $interfacePkgPath}}.{{$typeName}})(nil)),
+ {{end}}
+ }
+
+ err := generate.GenerateMockSource(
+ os.Stdout,
+ "{{.OutputPkgPath}}",
+ interfaces)
+
+ if err != nil {
+ log.Fatalf("Error generating mock source: %v", err)
+ }
+}
+`
+
+// A map from import identifier to package to use that identifier for,
+// containing elements for each import needed by the generated code.
+type importMap map[string]string
+
+type tmplArg struct {
+ // The full path of the package from which the interfaces come.
+ InterfacePkgPath string
+
+ // The package path to assume for the generated code.
+ OutputPkgPath string
+
+ // Imports needed by the generated code.
+ Imports importMap
+
+ // Types to be mocked, relative to their package's name.
+ TypeNames []string
+}
+
+var unknownPackageRegexp = regexp.MustCompile(
+ `tool\.go:\d+:\d+: cannot find package "([^"]+)"`)
+
+var undefinedInterfaceRegexp = regexp.MustCompile(`tool\.go:\d+: undefined: [\pL_0-9]+\.([\pL_0-9]+)`)
+
+// Does the 'go build' output indicate that a package wasn't found? If so,
+// return the name of the package.
+func findUnknownPackage(output []byte) *string {
+ if match := unknownPackageRegexp.FindSubmatch(output); match != nil {
+ res := string(match[1])
+ return &res
+ }
+
+ return nil
+}
+
+// Does the 'go build' output indicate that an interface wasn't found? If so,
+// return the name of the interface.
+func findUndefinedInterface(output []byte) *string {
+ if match := undefinedInterfaceRegexp.FindSubmatch(output); match != nil {
+ res := string(match[1])
+ return &res
+ }
+
+ return nil
+}
+
+// Split out from main so that deferred calls are executed even in the event of
+// an error.
+func run() error {
+ // Reduce noise in logging output.
+ log.SetFlags(0)
+
+ // Check the command-line arguments.
+ flag.Parse()
+
+ cmdLineArgs := flag.Args()
+ if len(cmdLineArgs) < 2 {
+ return errors.New("Usage: createmock [package] [interface ...]")
+ }
+
+ // Create a temporary directory inside of $GOPATH to hold generated code.
+ buildPkg, err := build.Import("github.com/smartystreets/assertions/internal/oglemock", "", build.FindOnly)
+ if err != nil {
+ return errors.New(fmt.Sprintf("Couldn't find oglemock in $GOPATH: %v", err))
+ }
+
+ tmpDir, err := ioutil.TempDir(buildPkg.SrcRoot, "tmp-createmock-")
+ if err != nil {
+ return errors.New(fmt.Sprintf("Creating temp dir: %v", err))
+ }
+
+ defer os.RemoveAll(tmpDir)
+
+ // Create a file to hold generated code.
+ codeFile, err := os.Create(path.Join(tmpDir, "tool.go"))
+ if err != nil {
+ return errors.New(fmt.Sprintf("Couldn't create a file to hold code: %v", err))
+ }
+
+ // Create an appropriate path for the built binary.
+ binaryPath := path.Join(tmpDir, "tool")
+
+ // Create an appropriate template argument.
+ arg := tmplArg{
+ InterfacePkgPath: cmdLineArgs[0],
+ TypeNames: cmdLineArgs[1:],
+ }
+
+ if *fSamePackage {
+ arg.OutputPkgPath = arg.InterfacePkgPath
+ } else {
+ arg.OutputPkgPath = "mock_" + path.Base(arg.InterfacePkgPath)
+ }
+
+ arg.Imports = make(importMap)
+ arg.Imports[path.Base(arg.InterfacePkgPath)] = arg.InterfacePkgPath
+ arg.Imports["generate"] = "github.com/smartystreets/assertions/internal/oglemock/generate"
+ arg.Imports["log"] = "log"
+ arg.Imports["os"] = "os"
+ arg.Imports["reflect"] = "reflect"
+
+ // Execute the template to generate code that will itself generate the mock
+ // code. Write the code to the temp file.
+ tmpl := template.Must(
+ template.New("code").Funcs(
+ template.FuncMap{
+ "pathBase": path.Base,
+ }).Parse(tmplStr))
+ if err := tmpl.Execute(codeFile, arg); err != nil {
+ return errors.New(fmt.Sprintf("Error executing template: %v", err))
+ }
+
+ codeFile.Close()
+
+ // Attempt to build the code.
+ cmd := exec.Command("go", "build", "-o", binaryPath)
+ cmd.Dir = tmpDir
+ buildOutput, err := cmd.CombinedOutput()
+
+ if err != nil {
+ // Did the compilation fail due to the user-specified package not being found?
+ pkg := findUnknownPackage(buildOutput)
+ if pkg != nil && *pkg == arg.InterfacePkgPath {
+ return errors.New(fmt.Sprintf("Unknown package: %s", *pkg))
+ }
+
+ // Did the compilation fail due to an unknown interface?
+ if in := findUndefinedInterface(buildOutput); in != nil {
+ return errors.New(fmt.Sprintf("Unknown interface: %s", *in))
+ }
+
+ // Otherwise return a generic error.
+ return errors.New(fmt.Sprintf(
+ "%s\n\nError building generated code:\n\n"+
+ " %v\n\nPlease report this oglemock bug.",
+ buildOutput,
+ err))
+ }
+
+ // Run the binary.
+ cmd = exec.Command(binaryPath)
+ binaryOutput, err := cmd.CombinedOutput()
+
+ if err != nil {
+ return errors.New(fmt.Sprintf(
+ "%s\n\nError running generated code:\n\n"+
+ " %v\n\n Please report this oglemock bug.",
+ binaryOutput,
+ err))
+ }
+
+ // Copy its output.
+ _, err = os.Stdout.Write(binaryOutput)
+ if err != nil {
+ return errors.New(fmt.Sprintf("Error copying binary output: %v", err))
+ }
+
+ return nil
+}
+
+func main() {
+ if err := run(); err != nil {
+ fmt.Fprintf(os.Stderr, "%s\n", err.Error())
+ os.Exit(1)
+ }
+}
diff --git a/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/createmock_test.go b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/createmock_test.go
new file mode 100644
index 00000000000..ddfc07a3e8d
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/createmock_test.go
@@ -0,0 +1,233 @@
+// Copyright 2012 Aaron Jacobs. All Rights Reserved.
+// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable 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 main
+
+import (
+ "bytes"
+ "flag"
+ "fmt"
+ "go/build"
+ "io/ioutil"
+ "os"
+ "os/exec"
+ "path"
+ "syscall"
+ "testing"
+
+ . "github.com/smartystreets/assertions/internal/ogletest"
+)
+
+var dumpNew = flag.Bool("dump_new", false, "Dump new golden files.")
+
+////////////////////////////////////////////////////////////
+// Helpers
+////////////////////////////////////////////////////////////
+
+var tempDir string
+var createmockPath string
+
+type CreateMockTest struct {
+}
+
+func TestOgletest(t *testing.T) { RunTests(t) }
+func init() { RegisterTestSuite(&CreateMockTest{}) }
+
+func (t *CreateMockTest) SetUpTestSuite() {
+ // Create a temporary file to hold the built createmock binary.
+ tempDir, err := ioutil.TempDir("", "createmock-")
+ if err != nil {
+ panic("Creating temporary directory: " + err.Error())
+ }
+
+ createmockPath = path.Join(tempDir, "createmock")
+
+ // Build the createmock tool so that it can be used in the tests below.
+ cmd := exec.Command("go", "build", "-o", createmockPath, "github.com/smartystreets/assertions/internal/oglemock/createmock")
+ if output, err := cmd.CombinedOutput(); err != nil {
+ panic(fmt.Sprintf("Error building createmock: %v\n\n%s", err, output))
+ }
+}
+
+func (t *CreateMockTest) TearDownTestSuite() {
+ // Delete the createmock binary we built above.
+ os.RemoveAll(tempDir)
+ tempDir = ""
+ createmockPath = ""
+}
+
+func (t *CreateMockTest) runGoldenTest(
+ caseName string,
+ expectedReturnCode int,
+ createmockArgs ...string) {
+ // Run createmock.
+ cmd := exec.Command(createmockPath, createmockArgs...)
+ output, err := cmd.CombinedOutput()
+
+ // Make sure the process actually exited.
+ exitError, ok := err.(*exec.ExitError)
+ if err != nil && (!ok || !exitError.Exited()) {
+ panic("exec.Command.CombinedOutput: " + err.Error())
+ }
+
+ // Extract a return code.
+ var actualReturnCode int
+ if exitError != nil {
+ actualReturnCode = exitError.Sys().(syscall.WaitStatus).ExitStatus()
+ }
+
+ // Make sure the return code is correct.
+ ExpectEq(expectedReturnCode, actualReturnCode)
+
+ // Read the golden file.
+ goldenPath := path.Join("testdata", "golden."+caseName)
+ goldenData := readFileOrDie(goldenPath)
+
+ // Compare the two.
+ identical := (string(output) == string(goldenData))
+ ExpectTrue(identical, "Output doesn't match for case '%s'.", caseName)
+
+ // Write out a new golden file if requested.
+ if !identical && *dumpNew {
+ writeContentsToFileOrDie(output, goldenPath)
+ }
+}
+
+// Ensure that when createmock is run with the supplied args, it produces
+// output that can be compiled.
+func (t *CreateMockTest) runCompilationTest(createmockArgs ...string) {
+ // Create a temporary directory inside of $GOPATH to hold generated code.
+ buildPkg, err := build.Import("github.com/smartystreets/assertions/internal/oglemock", "", build.FindOnly)
+ AssertEq(nil, err)
+
+ tmpDir, err := ioutil.TempDir(buildPkg.SrcRoot, "tmp-createmock_test-")
+ AssertEq(nil, err)
+ defer os.RemoveAll(tmpDir)
+
+ // Create a file to hold the mock code.
+ codeFile, err := os.Create(path.Join(tmpDir, "mock.go"))
+ AssertEq(nil, err)
+
+ // Run createmock and save its output to the file created above.
+ stdErrBuf := new(bytes.Buffer)
+
+ cmd := exec.Command(createmockPath, createmockArgs...)
+ cmd.Stdout = codeFile
+ cmd.Stderr = stdErrBuf
+
+ err = cmd.Run()
+ AssertEq(nil, err, "createmock stderr output:\n\n%s", stdErrBuf.String())
+ codeFile.Close()
+
+ // Run 'go build' in the directory and make sure it exits with return code
+ // zero.
+ cmd = exec.Command("go", "build")
+ cmd.Dir = tmpDir
+ output, err := cmd.CombinedOutput()
+
+ ExpectEq(nil, err, "go build output:\n\n%s", output)
+}
+
+func writeContentsToFileOrDie(contents []byte, path string) {
+ if err := ioutil.WriteFile(path, contents, 0600); err != nil {
+ panic("ioutil.WriteFile: " + err.Error())
+ }
+}
+
+func readFileOrDie(path string) []byte {
+ contents, err := ioutil.ReadFile(path)
+ if err != nil {
+ panic("ioutil.ReadFile: " + err.Error())
+ }
+
+ return contents
+}
+
+////////////////////////////////////////////////////////////
+// Tests
+////////////////////////////////////////////////////////////
+
+func (t *CreateMockTest) NoPackage() {
+ t.runGoldenTest(
+ "no_package",
+ 1)
+}
+
+func (t *CreateMockTest) NoInterfaces() {
+ t.runGoldenTest(
+ "no_interfaces",
+ 1,
+ "io")
+}
+
+func (t *CreateMockTest) UnknownPackage() {
+ t.runGoldenTest(
+ "unknown_package",
+ 1,
+ "foo/bar",
+ "Reader")
+}
+
+func (t *CreateMockTest) UnknownInterface() {
+ t.runGoldenTest(
+ "unknown_interface",
+ 1,
+ "io",
+ "Frobnicator")
+}
+
+func (t *CreateMockTest) GCSBucket() {
+ t.runGoldenTest(
+ "gcs_bucket",
+ 0,
+ "github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/gcs",
+ "Bucket")
+}
+
+func (t *CreateMockTest) GCSBucket_SamePackage() {
+ t.runGoldenTest(
+ "gcs_bucket_same_package",
+ 0,
+ "--same_package",
+ "github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/gcs",
+ "Bucket")
+}
+
+func (t *CreateMockTest) IoReaderAndWriter() {
+ t.runCompilationTest(
+ "io",
+ "Reader",
+ "Writer")
+}
+
+func (t *CreateMockTest) OsFileInfo() {
+ // Note that os is also used by the code that createmock generates; there
+ // should be no conflict.
+ t.runCompilationTest(
+ "os",
+ "FileInfo")
+}
+
+func (t *CreateMockTest) ComplicatedSamplePackage() {
+ t.runCompilationTest(
+ "github.com/smartystreets/assertions/internal/oglemock/generate/testdata/complicated_pkg",
+ "ComplicatedThing")
+}
+
+func (t *CreateMockTest) RenamedSamplePackage() {
+ t.runCompilationTest(
+ "github.com/smartystreets/assertions/internal/oglemock/generate/testdata/renamed_pkg",
+ "SomeInterface")
+}
diff --git a/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/gcs/bucket.go b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/gcs/bucket.go
new file mode 100644
index 00000000000..da714f305c5
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/gcs/bucket.go
@@ -0,0 +1,23 @@
+package gcs
+
+import "golang.org/x/net/context"
+
+type Bucket interface {
+ Name() string
+ CreateObject(context.Context, *CreateObjectRequest) (*Object, error)
+ CopyObject(ctx context.Context, req *CopyObjectRequest) (o *Object, err error)
+}
+
+type Object struct {
+}
+
+type CreateObjectRequest struct {
+}
+
+type CopyObjectRequest struct {
+}
+
+type Int int
+type Array []int
+type Chan <-chan int
+type Ptr *int
diff --git a/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.gcs_bucket b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.gcs_bucket
new file mode 100644
index 00000000000..05a5114546c
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.gcs_bucket
@@ -0,0 +1,125 @@
+// This file was auto-generated using createmock. See the following page for
+// more information:
+//
+// https://github.com/smartystreets/assertions/internal/oglemock
+//
+
+package mock_gcs
+
+import (
+ fmt "fmt"
+ oglemock "github.com/smartystreets/assertions/internal/oglemock"
+ gcs "github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/gcs"
+ context "golang.org/x/net/context"
+ runtime "runtime"
+ unsafe "unsafe"
+)
+
+type MockBucket interface {
+ gcs.Bucket
+ oglemock.MockObject
+}
+
+type mockBucket struct {
+ controller oglemock.Controller
+ description string
+}
+
+func NewMockBucket(
+ c oglemock.Controller,
+ desc string) MockBucket {
+ return &mockBucket{
+ controller: c,
+ description: desc,
+ }
+}
+
+func (m *mockBucket) Oglemock_Id() uintptr {
+ return uintptr(unsafe.Pointer(m))
+}
+
+func (m *mockBucket) Oglemock_Description() string {
+ return m.description
+}
+
+func (m *mockBucket) CopyObject(p0 context.Context, p1 *gcs.CopyObjectRequest) (o0 *gcs.Object, o1 error) {
+ // Get a file name and line number for the caller.
+ _, file, line, _ := runtime.Caller(1)
+
+ // Hand the call off to the controller, which does most of the work.
+ retVals := m.controller.HandleMethodCall(
+ m,
+ "CopyObject",
+ file,
+ line,
+ []interface{}{p0, p1})
+
+ if len(retVals) != 2 {
+ panic(fmt.Sprintf("mockBucket.CopyObject: invalid return values: %v", retVals))
+ }
+
+ // o0 *gcs.Object
+ if retVals[0] != nil {
+ o0 = retVals[0].(*gcs.Object)
+ }
+
+ // o1 error
+ if retVals[1] != nil {
+ o1 = retVals[1].(error)
+ }
+
+ return
+}
+
+func (m *mockBucket) CreateObject(p0 context.Context, p1 *gcs.CreateObjectRequest) (o0 *gcs.Object, o1 error) {
+ // Get a file name and line number for the caller.
+ _, file, line, _ := runtime.Caller(1)
+
+ // Hand the call off to the controller, which does most of the work.
+ retVals := m.controller.HandleMethodCall(
+ m,
+ "CreateObject",
+ file,
+ line,
+ []interface{}{p0, p1})
+
+ if len(retVals) != 2 {
+ panic(fmt.Sprintf("mockBucket.CreateObject: invalid return values: %v", retVals))
+ }
+
+ // o0 *gcs.Object
+ if retVals[0] != nil {
+ o0 = retVals[0].(*gcs.Object)
+ }
+
+ // o1 error
+ if retVals[1] != nil {
+ o1 = retVals[1].(error)
+ }
+
+ return
+}
+
+func (m *mockBucket) Name() (o0 string) {
+ // Get a file name and line number for the caller.
+ _, file, line, _ := runtime.Caller(1)
+
+ // Hand the call off to the controller, which does most of the work.
+ retVals := m.controller.HandleMethodCall(
+ m,
+ "Name",
+ file,
+ line,
+ []interface{}{})
+
+ if len(retVals) != 1 {
+ panic(fmt.Sprintf("mockBucket.Name: invalid return values: %v", retVals))
+ }
+
+ // o0 string
+ if retVals[0] != nil {
+ o0 = retVals[0].(string)
+ }
+
+ return
+}
diff --git a/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.gcs_bucket_same_package b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.gcs_bucket_same_package
new file mode 100644
index 00000000000..d78819076f5
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.gcs_bucket_same_package
@@ -0,0 +1,124 @@
+// This file was auto-generated using createmock. See the following page for
+// more information:
+//
+// https://github.com/smartystreets/assertions/internal/oglemock
+//
+
+package gcs
+
+import (
+ fmt "fmt"
+ oglemock "github.com/smartystreets/assertions/internal/oglemock"
+ context "golang.org/x/net/context"
+ runtime "runtime"
+ unsafe "unsafe"
+)
+
+type MockBucket interface {
+ Bucket
+ oglemock.MockObject
+}
+
+type mockBucket struct {
+ controller oglemock.Controller
+ description string
+}
+
+func NewMockBucket(
+ c oglemock.Controller,
+ desc string) MockBucket {
+ return &mockBucket{
+ controller: c,
+ description: desc,
+ }
+}
+
+func (m *mockBucket) Oglemock_Id() uintptr {
+ return uintptr(unsafe.Pointer(m))
+}
+
+func (m *mockBucket) Oglemock_Description() string {
+ return m.description
+}
+
+func (m *mockBucket) CopyObject(p0 context.Context, p1 *CopyObjectRequest) (o0 *Object, o1 error) {
+ // Get a file name and line number for the caller.
+ _, file, line, _ := runtime.Caller(1)
+
+ // Hand the call off to the controller, which does most of the work.
+ retVals := m.controller.HandleMethodCall(
+ m,
+ "CopyObject",
+ file,
+ line,
+ []interface{}{p0, p1})
+
+ if len(retVals) != 2 {
+ panic(fmt.Sprintf("mockBucket.CopyObject: invalid return values: %v", retVals))
+ }
+
+ // o0 *Object
+ if retVals[0] != nil {
+ o0 = retVals[0].(*Object)
+ }
+
+ // o1 error
+ if retVals[1] != nil {
+ o1 = retVals[1].(error)
+ }
+
+ return
+}
+
+func (m *mockBucket) CreateObject(p0 context.Context, p1 *CreateObjectRequest) (o0 *Object, o1 error) {
+ // Get a file name and line number for the caller.
+ _, file, line, _ := runtime.Caller(1)
+
+ // Hand the call off to the controller, which does most of the work.
+ retVals := m.controller.HandleMethodCall(
+ m,
+ "CreateObject",
+ file,
+ line,
+ []interface{}{p0, p1})
+
+ if len(retVals) != 2 {
+ panic(fmt.Sprintf("mockBucket.CreateObject: invalid return values: %v", retVals))
+ }
+
+ // o0 *Object
+ if retVals[0] != nil {
+ o0 = retVals[0].(*Object)
+ }
+
+ // o1 error
+ if retVals[1] != nil {
+ o1 = retVals[1].(error)
+ }
+
+ return
+}
+
+func (m *mockBucket) Name() (o0 string) {
+ // Get a file name and line number for the caller.
+ _, file, line, _ := runtime.Caller(1)
+
+ // Hand the call off to the controller, which does most of the work.
+ retVals := m.controller.HandleMethodCall(
+ m,
+ "Name",
+ file,
+ line,
+ []interface{}{})
+
+ if len(retVals) != 1 {
+ panic(fmt.Sprintf("mockBucket.Name: invalid return values: %v", retVals))
+ }
+
+ // o0 string
+ if retVals[0] != nil {
+ o0 = retVals[0].(string)
+ }
+
+ return
+}
diff --git a/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.no_interfaces b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.no_interfaces
new file mode 100644
index 00000000000..b70535fae6b
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.no_interfaces
@@ -0,0 +1 @@
+Usage: createmock [package] [interface ...]
diff --git a/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.no_package b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.no_package
new file mode 100644
index 00000000000..b70535fae6b
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.no_package
@@ -0,0 +1 @@
+Usage: createmock [package] [interface ...]
diff --git a/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.unknown_interface b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.unknown_interface
new file mode 100644
index 00000000000..c32950a1790
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.unknown_interface
@@ -0,0 +1 @@
+Unknown interface: Frobnicator
diff --git a/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.unknown_package b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.unknown_package
new file mode 100644
index 00000000000..d07e915d2cf
--- /dev/null
+++ b/src/mongo/gotools/vendor/src/github.com/smartystreets/assertions/internal/oglemock/createmock/testdata/golden.unknown_package
@@ -0,0 +1 @@
+Unknown package: foo/bar